-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.py
executable file
·47 lines (35 loc) · 902 Bytes
/
main.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
#!/usr/bin/env python
import importlib
import sys
import os
import parser
def main(*args, **kwargs):
modname = None
#try:
# modname = os.environ["testing_mod"]
#except Exception:
# modname = "QL.parser"
parser = importlib.import_module(modname if modname else "parser")
times = 0
while True:
times += 1
print(parser)
try:
parser.repl(sys.argv, times=times)
except:
print(sys.exc_info())
try:
input("Hit enter to reload parser, or ^D> ")
except KeyboardInterrupt:
print("Interrupted")
break
except EOFError:
print("EOF")
break
newparser = importlib.reload(parser)
parser = newparser
#print(parser)
########## MAIN ##################
if (__name__ == "__main__"):
main(sys.argv)
...