-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
24 lines (20 loc) · 692 Bytes
/
main.py
File metadata and controls
24 lines (20 loc) · 692 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
from apps.my_argparse import *
from apps.mylogger import *
if __name__ == '__main__':
logger.info('----------STARTING----------')
parser = create_parser()
if len(sys.argv) == 1:
parser.print_help()
logger.info('----------COMPLETED----------')
sys.exit(1)
elif not sys.argv[1] in ['manager', 'salesman']:
parser.print_help()
logger.info('----------COMPLETED----------')
sys.exit(1)
else:
namespace = parser.parse_args()
if namespace.command == "manager":
run_manager(namespace)
elif namespace.command == "salesman":
run_salesman(namespace)
logger.info('----------COMPLETED----------')