- Typos
git-svn-id: svn://svn.gna.org/svn/sgpemv2/trunk@365 3ecf2c5c-341e-0410-92b4-d18e462d057c
This commit is contained in:
parent
7d58c965ff
commit
ea70e2f092
3 changed files with 39 additions and 38 deletions
|
@ -26,8 +26,8 @@ using namespace sgpem;
|
|||
//static object
|
||||
PythonPolicyManager* PythonPolicyManager::_instance = NULL;
|
||||
|
||||
|
||||
PythonPolicyManager::PythonPolicyManager() //private constructor. The parameter is discarded
|
||||
PythonPolicyManager::PythonPolicyManager()
|
||||
: _initialized(false)
|
||||
{
|
||||
}
|
||||
|
||||
|
@ -35,7 +35,7 @@ PythonPolicyManager&
|
|||
PythonPolicyManager::get_instance()
|
||||
{
|
||||
if(!_instance)
|
||||
_instance = new PythonPolicyManager();
|
||||
_instance = new PythonPolicyManager();
|
||||
return *_instance;
|
||||
}
|
||||
|
||||
|
@ -49,23 +49,21 @@ PythonPolicyManager::get_policy()
|
|||
void
|
||||
PythonPolicyManager::init()
|
||||
{
|
||||
static bool initialized = false;
|
||||
|
||||
if(initialized)
|
||||
Py_Finalize();
|
||||
|
||||
Py_Initialize();
|
||||
initialized = true;
|
||||
|
||||
// The following line is ugly, but necessary if we use
|
||||
// non-standard installation directories. Theoretically,
|
||||
// it should be up to the user to set correct
|
||||
// environment variables.
|
||||
// FIXME: find better way to achieve this.
|
||||
|
||||
PyRun_SimpleString("import sys\n"
|
||||
"sys.path[:0] = [ '" MODDIR "', '" PYCDIR "' ]\n");
|
||||
|
||||
if(_initialized)
|
||||
Py_Finalize();
|
||||
|
||||
Py_Initialize();
|
||||
_initialized = true;
|
||||
|
||||
// The following line is ugly, but necessary if we use
|
||||
// non-standard installation directories. Theoretically,
|
||||
// it should be up to the user to set correct
|
||||
// environment variables.
|
||||
// FIXME: find better way to achieve this.
|
||||
|
||||
PyRun_SimpleString("import sys\n"
|
||||
"sys.path[:0] = [ '" MODDIR "', '" PYCDIR "' ]\n");
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue