-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfig_manager.py
36 lines (28 loc) · 952 Bytes
/
config_manager.py
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 json
import sys
import traceback
def func_read_config(jsname='conf.json'):
with open(f'{jsname}', 'r') as config_file:
conf = json.load(config_file)
return {
'azure': conf['azure'],
'indexes': conf['indexes'],
'paths': conf['paths'],
'batsFiles': conf['batsFiles'],
'cmdCommands': conf['cmdCommands'],
'vers': conf['vers'],
'freecmd': conf['freecmd'],
'presses': conf['presses']
}
def func_read_log_json(jsname='log.json'):
with open(f'{jsname}', 'r') as log_file:
log_conf = json.load(log_file)
return log_conf
def fjp(jsname='conf.json'):
"""Func json parameters"""
try:
with open(f'{jsname}', 'r') as fjp_file:
fgps = json.load(fjp_file)
return fgps
except Exception as ex:
print(f"Exception: fjp_function has been failed: >>> {ex} >>> {traceback.extract_tb(list(sys.exc_info())[2])}")