Make trick (Python package) a namespace package

Namespace packages are a mechanism for splitting a single Python
package across multiple directories on disk. With the addition of
$(TRICK_HOME)/pymods/trick, there now exists a package named 'trick' at
$(TRICK_HOME)/pymods and in each SIM_* directory. This change allows sims
to import modules from both locations.

Refs #365
This commit is contained in:
Derek Bankieris
2017-01-20 09:49:55 -06:00
parent fc63f5c6b1
commit 4146b440b8
3 changed files with 5 additions and 0 deletions

View File

@ -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"