-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
39 lines (29 loc) · 977 Bytes
/
main.py
File metadata and controls
39 lines (29 loc) · 977 Bytes
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
import sys
from pprint import pprint
import example.min_tree as example
import example.state_machine as state_example
import example.calc as calc_example
def display_help():
pprint("Possible args -- test, example, help")
pprint("test -- Run tests")
pprint("exampletree -- run example Min Tree in example folder")
pprint("examplestate -- run example State Machine in example folder")
pprint("examplecalc -- run example Calc in example folder")
pprint("help -- Diplsay this text")
if len(sys.argv) != 2:
display_help()
else:
first_arg = sys.argv[1]
if first_arg == 'test':
import subprocess
subprocess.Popen("pytest")
elif first_arg == 'exampletree':
example.run_example()
elif first_arg == 'examplestate':
state_example.run_example()
elif first_arg == 'examplecalc':
calc_example.run_example()
elif first_arg == 'help':
display_help()
else:
display_help()