forked from ScopeFoundry/ScopeFoundry
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path__main__.py
More file actions
63 lines (45 loc) · 1.84 KB
/
__main__.py
File metadata and controls
63 lines (45 loc) · 1.84 KB
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
import sys
def invalid_input():
print("----------------------------------------------------------")
print("Invalid command. Please use one of the following commands:")
print("----------------------------------------------------------")
print_cmds()
def print_cmds():
print("python -m ScopeFoundry init")
print("python -m ScopeFoundry ipynb")
print("python -m ScopeFoundry tools")
print("python -m ScopeFoundry new_hardware")
print("python -m ScopeFoundry new_measurement")
print("python -m ScopeFoundry publish_hardware")
if __name__ == "__main__":
cmd = sys.argv[1].lower() if len(sys.argv) > 1 else None
if cmd is None:
invalid_input()
if cmd in ("init", "new_app"):
from ScopeFoundry.tools.features.new_app import new_app
run_str = new_app()
print("")
print("Or use one of the following commmands to extent your app")
print("----------------------------------------------------------")
print_cmds()
print("----------------------------------------------------------")
print("")
print("To run your app, use the following command:")
print(run_str)
elif cmd in ("ipynb",):
from ScopeFoundry.h5_analyze_with_ipynb import analyze_with_ipynb
analyze_with_ipynb()
elif cmd in ("tools",):
from ScopeFoundry.tools.app import start_app
start_app()
elif cmd in ("new_hw", "new_hardware"):
from ScopeFoundry.tools.app import start_app
start_app("new hardware")
elif cmd in ("new_mm", "new_measurement"):
from ScopeFoundry.tools.features.new_measurement import main
main()
elif cmd in ("publish_hw", "publish_hardware"):
from ScopeFoundry.tools.app import start_app
start_app("publish HW on GitHub")
else:
invalid_input()