-
Notifications
You must be signed in to change notification settings - Fork 3
/
oldrun.py
executable file
·81 lines (70 loc) · 1.69 KB
/
oldrun.py
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
#!venv/bin/python
"""
Author: Bryce Drew
"""
import os
import sys
import subprocess
sys.path.append(os.getcwd()+"/venv/lib/python2.7/site-packages")
import superphy
from superphy.shared import config
config.import_env()
#Debug allows the execution of arbitrary code. Do not use it with production
def run():
"""
This compiles files in the project, and restarts nessesary systems.
After this is run, if you have installed properly you will have a working superphy
"""
os.system("bash superphy/database/scripts/start.sh")
os.system("cd app/SuperPhy/static; bash compile.sh; cd ../../..")
os.system("sudo /etc/init.d/apache2 reload")
exit()
def install():
"""
.
"""
os.system("bash superphy/database/scripts/start.sh")
config.install()
exit()
def uploader():
"""
.
"""
superphy.upload.foo()
exit()
def shell():
"""
.
"""
import code
code.interact(local=dict(globals(), **locals()))
def test():
"""
.
"""
config.start_database("testing")
from superphy.upload import main as upload
upload.init()
subprocess.call(
"for f in superphy/src/*; do echo $f; nosetests $f -vv --exe; done",
shell=True
)
OPTIONS = {
"install" : install,
"run" : run,
"upload" : uploader,
"sparql" : superphy.shared.config.start_database,
"shell" : shell,
"test" : test
}
if __name__ == '__main__':
if len(sys.argv) >= 2:
if sys.argv[1] in OPTIONS:
OPTIONS[sys.argv[1]]()
else:
print "OPTIONS:"
for key in OPTIONS:
print key
else:
#Default
OPTIONS['run']()