diff --git a/libexec/trick/make_makefile_swig b/libexec/trick/make_makefile_swig index 37abefaf..addc2a0e 100755 --- a/libexec/trick/make_makefile_swig +++ b/libexec/trick/make_makefile_swig @@ -377,6 +377,8 @@ py_%.cpp: %.i } open INITFILE , ">trick/__init__.py" or return ; + print INITFILE "from pkgutil import extend_path\n" ; + print INITFILE "__path__ = extend_path(__path__, __name__)\n" ; print INITFILE "import sys\n" ; print INITFILE "import os\n" ; print INITFILE "sys.path.append(os.getcwd() + \"/trick\")\n" ; diff --git a/pymods/trick/__init__.py b/pymods/trick/__init__.py index e69de29b..3ad9513f 100644 --- a/pymods/trick/__init__.py +++ b/pymods/trick/__init__.py @@ -0,0 +1,2 @@ +from pkgutil import extend_path +__path__ = extend_path(__path__, __name__) diff --git a/trick_source/sim_services/InputProcessor/IPPython.cpp b/trick_source/sim_services/InputProcessor/IPPython.cpp index 8de087a6..4d2fd02f 100644 --- a/trick_source/sim_services/InputProcessor/IPPython.cpp +++ b/trick_source/sim_services/InputProcessor/IPPython.cpp @@ -103,6 +103,7 @@ int Trick::IPPython::init() { "import struct\n" "import binascii\n" "sys.path.append(os.getcwd())\n" + "sys.path.append(os.path.join(os.environ['TRICK_HOME'], 'pymods'))\n" "sys.path += map(str.strip, os.environ['TRICK_PYTHON_PATH'].split(':'))\n" "import trick\n" "sys.path.append(os.getcwd() + \"/Modified_data\")\n"