-
Notifications
You must be signed in to change notification settings - Fork 1
/
start
executable file
·30 lines (26 loc) · 961 Bytes
/
start
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#!/usr/bin/python2.5
from os.path import expanduser, join
import os, os.path, sys
import popen2
add_py_path = ""
if "PYTHONPATH" in os.environ:
add_py_path += os.environ["PYTHONPATH"] + ":"
add_py_path += join(expanduser("~"), "rad")
os.environ["PYTHONPATH"] = add_py_path
#os.environ["PYTHONPATH"] = os.environ["PYTHONPATH"] + ":" \
# + join(expanduser("~"), "rad")
if len(sys.argv) > 1 and "/" not in sys.argv[1]:
command = "run-standalone.sh python2.5 client/%s/main.py %s" \
% (sys.argv[1], " ".join(sys.argv[2:]))
elif len(sys.argv) == 1:
command = "run-standalone.sh python2.5"
elif ".py" not in sys.argv[1]:
command = "run-standalone.sh python2.5 %s/main.py %s" \
% (sys.argv[1], " ".join(sys.argv[2:]))
else:
command = "run-standalone.sh python2.5 %s" \
% (" ".join(sys.argv[1:]))
print command
#print "Setting PYTHONPATH and running '%s'" % command
#os.system(path_command)
os.system(command)