Split CFG.py to private/lib/cfgparse.py

This commit is contained in:
Darksider3 2019-10-19 14:02:52 +02:00
parent 192e70e4a2
commit 8c3ac4060f
2 changed files with 17 additions and 11 deletions

View file

@ -1,12 +1,6 @@
import configparser
import logging
import lib.uis.default as default_cmd
import lib.cfgparse
args = default_cmd.argparser.parse_args()
CONF_FILE = args.config
config = configparser.ConfigParser()
config.read(CONF_FILE)
logging.basicConfig(format="%(asctime)s: %(message)s",
level=int(config['LOG_LEVEL']['log_level'])
)
REG_FILE = config['DEFAULT']['applications_db']
args = lib.cfgparse.args
CONF_FILE = lib.cfgparse.CONF_FILE
config = lib.cfgparse.config
REG_FILE = lib.cfgparse.REG_FILE

12
private/lib/cfgparse.py Normal file
View file

@ -0,0 +1,12 @@
import configparser
import logging
import lib.uis.default as default_cmd
args = default_cmd.argparser.parse_args()
CONF_FILE = args.config
config = configparser.ConfigParser()
config.read(CONF_FILE)
logging.basicConfig(format="%(asctime)s: %(message)s",
level=int(config['LOG_LEVEL']['log_level'])
)
REG_FILE = config['DEFAULT']['applications_db']