-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
executable file
·25 lines (21 loc) · 741 Bytes
/
Copy pathmain.py
File metadata and controls
executable file
·25 lines (21 loc) · 741 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
#!/usr/bin/env python
import sys
from src.utils import init, release, autorelease, check, ligue_stats
import logging
from src.constants import ligues, base_path, args
switch_case = {
'init': lambda: init(),
'release': lambda: release(),
'autorelease': lambda: autorelease(),
'check': lambda: check(),
}
if __name__ == '__main__':
logging.basicConfig(filename=f'{base_path}/fantasy.log', filemode='a', format='%(asctime)s - %(message)s', level=logging.DEBUG)
case = sys.argv[1]
if case not in args and case not in ligues:
print(f'Usage: {sys.argv[0]} {"|".join(args)}|{"|".join(ligues)}')
sys.exit(1)
if case in ligues:
ligue_stats()
if case in args:
switch_case[case]()