OpenCog Framework  Branch: master, revision 6f0b7fc776b08468cf1b74aa9db028f387b4f0c0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
PythonEval.cc File Reference
#include <boost/filesystem/operations.hpp>
#include <opencog/util/Config.h>
#include <opencog/util/exceptions.h>
#include <opencog/util/Logger.h>
#include <opencog/util/misc.h>
#include <opencog/util/oc_assert.h>
#include <opencog/atomspace/Atom.h>
#include <opencog/atomspace/Link.h>
#include "PythonEval.h"
#include "opencog/atomspace_api.h"
+ Include dependency graph for PythonEval.cc:

Go to the source code of this file.

Macros

#define DPRINTF(...)
 
#define NO_COMPILER_FLAGS   NULL
 
#define CHECK_SINGLETON
 

Functions

static const char ** get_module_paths ()
 
static bool try_to_load_modules (const char **config_paths)
 

Variables

const int NO_SIGNAL_HANDLERS = 0
 
const char * NO_FUNCTION_NAME = NULL
 
const int SIMPLE_STRING_SUCCESS = 0
 
const int SIMPLE_STRING_FAILURE = -1
 
const int MISSING_FUNC_CODE = -1
 
static bool already_initialized = false
 
static bool initialized_outside_opencog = false
 
static const char * DEFAULT_PYTHON_MODULE_PATHS []
 
static const char * PROJECT_PYTHON_MODULE_PATHS []
 
const int ABSOLUTE_IMPORTS_ONLY = 0
 

Macro Definition Documentation

#define CHECK_SINGLETON
#define DPRINTF (   ...)

Definition at line 47 of file PythonEval.cc.

#define NO_COMPILER_FLAGS   NULL

Definition at line 58 of file PythonEval.cc.

Function Documentation

static const char** get_module_paths ( )
static

Definition at line 124 of file PythonEval.cc.

References DEFAULT_PYTHON_MODULE_PATHS, and PROJECT_PYTHON_MODULE_PATHS.

+ Here is the caller graph for this function:

static bool try_to_load_modules ( const char **  config_paths)
static

Ongoing python nuttiness. Because we never know in advance whether python will be able to find a module or not, until it actually does, we have to proceed by trial and error, trying different path combinations, until it finally works. The sequence of paths that leads to success will then be delcared the official system path, henceforth. Woe unto those try to defy the will of the python gods.

Return true if the load worked, else return false.

Definition at line 173 of file PythonEval.cc.

+ Here is the caller graph for this function:

Variable Documentation

const int ABSOLUTE_IMPORTS_ONLY = 0

Definition at line 990 of file PythonEval.cc.

bool already_initialized = false
static

Definition at line 60 of file PythonEval.cc.

const char* DEFAULT_PYTHON_MODULE_PATHS[]
static
Initial value:
=
{
DATADIR"/python",
"/usr/local/share/opencog/python",
"/usr/share/opencog/python",
NULL
}

Definition at line 81 of file PythonEval.cc.

bool initialized_outside_opencog = false
static

Definition at line 61 of file PythonEval.cc.

const int MISSING_FUNC_CODE = -1

Definition at line 55 of file PythonEval.cc.

const char* NO_FUNCTION_NAME = NULL

Definition at line 52 of file PythonEval.cc.

const int NO_SIGNAL_HANDLERS = 0

Definition at line 51 of file PythonEval.cc.

const char* PROJECT_PYTHON_MODULE_PATHS[]
static
Initial value:
=
{
PROJECT_BINARY_DIR"/opencog/cython",
PROJECT_SOURCE_DIR"/opencog/python",
PROJECT_SOURCE_DIR"/tests/cython",
NULL
}

Definition at line 91 of file PythonEval.cc.

const int SIMPLE_STRING_FAILURE = -1

Definition at line 54 of file PythonEval.cc.

const int SIMPLE_STRING_SUCCESS = 0

Definition at line 53 of file PythonEval.cc.