-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrun_config.py
More file actions
36 lines (29 loc) · 829 Bytes
/
run_config.py
File metadata and controls
36 lines (29 loc) · 829 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
import argparse
import json
import logging
import sys
import time
import shaclapi.logger as shaclapi_logger
from shaclapi.api import run_multiprocessing
shaclapi_logger.setup(level=logging.DEBUG)
logger = logging.getLogger(__name__)
def main(pre_config):
# Starting the processes of the runners
try:
api_output = run_multiprocessing(pre_config)
time.sleep(1)
if type(api_output) != str:
print(api_output.to_json())
else:
print(api_output)
except KeyboardInterrupt:
print('SIGINT', file=sys.stderr)
pass
except Exception as e:
print(e)
pass
if __name__ == '__main__':
parser = argparse.ArgumentParser()
parser.add_argument('-c', '--config', type=json.loads)
args = parser.parse_args()
main(args.config)