diff options
| author | Alon Levy <alon@pobox.com> | 2015-08-15 09:05:40 +0300 |
|---|---|---|
| committer | Alon Levy <alon@pobox.com> | 2015-08-15 10:31:01 +0300 |
| commit | 46404014a08158d1b8c491cda26f9880576ebe4c (patch) | |
| tree | cd1eb7d80ad3e5cb491f4c948f91fabaa6758d2f /src | |
| parent | 21e56e5776b84109a16085dfc4ccea59be2b7c71 (diff) | |
rz-user-tool: support multiple install locations (hack, should have externally setup system path)
Diffstat (limited to 'src')
| -rwxr-xr-x | src/local/server-tools/rz-user-tool.py | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/local/server-tools/rz-user-tool.py b/src/local/server-tools/rz-user-tool.py index 24dc3c20..55c6bdad 100755 --- a/src/local/server-tools/rz-user-tool.py +++ b/src/local/server-tools/rz-user-tool.py @@ -24,8 +24,13 @@ import re import sys from getpass import getpass -server_path = os.path.realpath(os.path.join(os.path.dirname(sys.modules[__name__].__file__), '..', '..', 'server')) -if not os.path.exists(server_path): +server_path = None +for parts in [('..', '..', 'server'), ('..', '..', 'rhizi-server')]: + candidate = os.path.realpath(os.path.join(os.path.dirname(sys.modules[__name__].__file__), *parts)) + if os.path.exists(candidate): + server_path = candidate + break +if server_path is None: print("error: path not setup correctly") raise SystemExit sys.path.append(server_path) |
