diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/local/server-tools/rz.py | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/local/server-tools/rz.py b/src/local/server-tools/rz.py index 4bcf6c05..52c9ed83 100644 --- a/src/local/server-tools/rz.py +++ b/src/local/server-tools/rz.py @@ -1,4 +1,14 @@ # hack to setup rhizi path - needs a proper install import sys import os -sys.path.append(os.path.join(os.path.dirname(__file__), '..', '..', 'server')) + +# to work both from source dir and from deployment dir +candidate = None +for down in [['..', '..'], ['..']]: + candidate = os.path.join(*([os.path.dirname(__file__)] + down + ['server'])) + if os.path.exists(candidate): + break +if None is candidate: + print("must be run from one or two directories above server") + raise SystemExit +sys.path.append(candidate) |
