-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathdriver.py
More file actions
37 lines (30 loc) · 880 Bytes
/
Copy pathdriver.py
File metadata and controls
37 lines (30 loc) · 880 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
"""
Main driver
Sets up logs & arguments
"""
import source.constants as CONST
import argparse
# Add source/ to syspath
import sys
sys.path.append('./source/')
# Logging
import logging, coloredlogs
coloredlogs.install(level="DEBUG")
logger = logging.getLogger(__name__)
# commandline args
def parse_args() -> dict:
"""Parse required args for script"""
parser = argparse.ArgumentParser("league-draft-analyzer")
parser.add_argument(f'-{CONST.DRIVER_ACTION}', help="Action for the driver to take.", type=str)
args = parser.parse_args()
return {
CONST.DRIVER_ACTION: getattr(args, CONST.DRIVER_ACTION)
}
# driver
if __name__ == "__main__":
driver_args = parse_args()
logger.info(f"Script arguments: {driver_args}")
from source.main import main
ret:int = main(driver_args)
assert isinstance(ret, int)
sys.exit(ret)