-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
50 lines (40 loc) · 1 KB
/
main.py
File metadata and controls
50 lines (40 loc) · 1 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
import getopt
import sys
import config
from torqueclient import Torque
from scoreNormalization.main import main
__doc__ = """
Normalize competition scores and upload
Usage:
$ python main.py [--csv]
Command-line options:
--csv Output to CSV rather than uploading results back to torque
"""
torque = Torque(
config.TORQUE_LINK,
config.TORQUE_USERNAME,
config.TORQUE_API_KEY
)
competition = config.COMPETITION
score_type = config.SCORE_TYPE
judge_data_types = config.JUDGE_DATA_TYPES
try:
opts, args = getopt.getopt(
sys.argv[1:],
"",
[
"csv",
],
)
except getopt.GetoptError as err:
sys.stderr.write("ERROR: '%s'\n" % err)
sys.exit(2)
output_to_csv = False
for o, a in opts:
if o == "--csv":
output_to_csv = True
else:
sys.stderr.write("ERROR: unrecognized option '%s'\n" % o)
sys.stderr.write(__doc__)
sys.exit(2)
main(torque, competition, score_type, judge_data_types, output_to_csv)