Skip to content

Commit 5e4bd8b

Browse files
committed
add pmt in bin directory, runs pmt.py in pymodel directory
also add pymodel_paths and pymodel_symlinks in bin directory also tweak bin README.md to remind that there are no Windows versions of some scripts
1 parent dec9262 commit 5e4bd8b

File tree

4 files changed

+38
-3
lines changed

4 files changed

+38
-3
lines changed

bin/README.md

+4-3
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,10 @@ To use PyModel, this directory must be on your execution *PATH*.
88
Or, its contents must be installed in some directory that is on your
99
execution *PATH*.
1010

11-
There are two versions of some commands. The version without a
12-
file type is a *bash* script for Unix/Linux/Mac; the version with
13-
*.bat* is a batch file for Windows.
11+
There are two versions of some commands. The version without a file
12+
type is a *bash* script for Unix/Linux/Mac; the version with *.bat* is
13+
a batch file for Windows. There are no Windows versions of some
14+
commands.
1415

1516
The commands are:
1617

bin/pmt

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#!/usr/bin/env python
2+
"""
3+
This is pmt command in bin directory, runs pmt.py module in pymodel directory
4+
"""
5+
6+
import pmt # find pmt.py anywhere on Python path
7+
8+
pmt.main()

bin/pymodel_paths

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# Assign paths to run PyModel out of PyModel/ development directories
2+
# Must set both execution path for commands and Python path for modules
3+
# If you install PyModel, commands and modules may go to some standard place
4+
# and you will no longer need these assignments
5+
6+
# execution path to bin, to run PyModel commands: pmt, dotsvg, etc.
7+
export PATH=$PATH:$HOME/PyModel/bin
8+
9+
# Python path to pymodule, to import PyModel modules: pmt.py etc.
10+
export PYTHONPATH=$HOME/PyModel/pymodel:$PYTHONPATH
11+
12+
# Python path to current directory (wherever it is), to import modules,
13+
# some PyModel command line args are names of modules in current directory
14+
export PYTHONPATH=.:$PYTHONPATH

bin/pymodel_symlinks

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# Make symlinks to invoke pmt.py in pymodel directory from pmt in bin directory
2+
# pmt.py etc. all begin with this "shebang line": #!/usr/bin/env python
3+
# Only works on Unix systems where pymodel and bin dirs are side-by-side,
4+
# will not work in the general case where bin and pymodel are separated.
5+
# bin directory must be on execution path, pymodel dir must be on Python path
6+
# This is a stopgap awaiting a more general solution to invoke pmt from pmt.py
7+
ln -s ../pymodel/pma.py pma
8+
ln -s ../pymodel/pmg.py pmg
9+
ln -s ../pymodel/pmt.py pmt
10+
ln -s ../pymodel/pmv.py pmv
11+
ln -s ../pymodel/trun.py trun
12+
ln -s ../pymodel/wsgirunner.py wsgirunner

0 commit comments

Comments
 (0)