forked from talhasch/stx-node-map-backend
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrun.py
More file actions
35 lines (24 loc) · 739 Bytes
/
run.py
File metadata and controls
35 lines (24 loc) · 739 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
import argparse
import os
import sys
import logging
logging.basicConfig(level=logging.INFO)
assert sys.version_info[0] == 3 and sys.version_info[1] >= 6, 'Requires Python 3.6 or newer'
os.sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), 'src')))
def main():
parser = argparse.ArgumentParser(description='')
cmd_list = (
'api',
'discoverer',
)
parser.add_argument('cmd', choices=cmd_list, nargs='?', default='')
args = parser.parse_args()
cmd = args.cmd
if cmd == 'api':
from stx_node_map.api.app import main
main()
if cmd == 'discoverer':
from stx_node_map.discoverer import main
main()
if __name__ == '__main__':
main()