Distribution layout
- For development / standalone version TDL_DIR is the local src path (e.g. ~/code/tdl) and SCRIPT_DIR is TDL_DIR
For site packages version (installed via TDL_DIR/setup.py), TDL_DIR is python/.../site-packages/tdl and SCRIPT_DIR is python/bin/tdl.
- In either case the users 'path' should include the directory with the 'tdl' script and python executable.
SCRIPT_DIR/tdl
startup script
TDL_DIR/tdl_ast.py
startup script for ast implementation
TDL_DIR/tdl_pds.py
startup script for pds implementation
TDL_DIR/setup.py
script for site-packages install
TDL_DIR/astlib/...
contains ast shell program and associated modules
TDL_DIR/pds/...
contains pds shell program and associated modules
TDL_DIR/modules/...
contains add-on/application modules
TDL_DIR/examples/...
examples
TDL_DIR/tests/...
tests
Startup script and PYTHONPATH
- The tdl script should take as an argument a keyword to chose which shell to run (ast or pds).
- The tdl_ast.py or tdl_pds.py script then should add the following to sys.path:
.
current working directory
TDL_DIR
parent directory (will be on pythonpath already if its in site-packages)
TDL_DIR/astlib
if ast make sure astlib on path, otherwise exclude it
TDL_DIR/pds
if pds male sure pds on path, otherwise exclude it
TDL_DIR/modules/*
add-on modules (recursively add all paths)
Startup options
In pds shell there is a file pds/startup.pds that is read/executed at startup. This can be used to set local site preferences (e.g. which modules to import on default, default editor etc).
- After initial startup of the interactive shell (both ast and pds) search for a 'HOME' environment variable, and pass HOME/.tdl_init for execution if it exists. This can be used to set user specific options (e.g. load specific modules, change to a default working directory etc.).