-
Notifications
You must be signed in to change notification settings - Fork 5
/
alphaBot.py
52 lines (44 loc) · 1.06 KB
/
alphaBot.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
import alphaBotUtility
import os
import sys
import getopt
import english
import initialization
import bot
import report
import reportExplorer
handleOK = False
debug = False
try:
opts, args = getopt.getopt(sys.argv[1:], "hkdr:e:l", ["help", "handleOK", "debug", "report", "explorer", "exploreLatest"])
except getopt.GetoptError as err:
print str(err)
usage()
sys.exit(2)
verbose = False
for o, a in opts:
if o == "-v":
verbose = True
elif o in ("-h", "--help"):
alphaBotUtility.usage()
sys.exit()
elif o in ("-k", "--handleOK"):
handleOK = True
elif o in ("-d", "--debug"):
debug = True
elif o in ("-r", "--report"):
report.reportDirectory = str(a)
elif o in ("-e", "--explorer"):
report = str(a)
reportExplorer.analyseReport(report)
sys.exit()
elif o in ("-l", "--exploreLatest"):
reportExplorer.analyseReport(None)
sys.exit()
else:
assert False, "unhandled option"
captchaDir = "./captcha"
if not os.path.exists(captchaDir):
os.makedirs(captchaDir)
initialization.initialize(handleOK=handleOK)
bot.run(handleOK=handleOK, debug=debug)