From 01efd09a093b3c632992327387dd3b5662dbaac2 Mon Sep 17 00:00:00 2001 From: Simon Date: Fri, 25 Sep 2020 12:15:14 +0100 Subject: [PATCH] Config for MySQL --- config.py | 12 ++++++++++++ mysql.py | 0 2 files changed, 12 insertions(+) create mode 100644 mysql.py diff --git a/config.py b/config.py index 965f142..e4cd3f4 100755 --- a/config.py +++ b/config.py @@ -108,6 +108,7 @@ def build_config(_config_file): CONFIG['LOGGER'] = {} CONFIG['ALIASES'] = {} CONFIG['SYSTEMS'] = {} + CONFIG['MYSQL'] = {} try: for section in config.sections(): @@ -152,6 +153,17 @@ def build_config(_config_file): 'SUBSCRIBER_URL': config.get(section, 'SUBSCRIBER_URL'), 'STALE_TIME': config.getint(section, 'STALE_DAYS') * 86400, }) + + elif section == 'MYSQL': + CONFIG['MYSQL'].update({ + 'USE_MYSQL': config.getboolean(section, 'USE_MYSQL'), + 'USER': config.get(section, 'USER'), + 'PASS': config.get(section, 'PASS'), + 'DB': config.get(section, 'DB'), + 'SERVER': config.get(section, 'SERVER'), + 'PORT': config.getint('PORT') + }) + elif config.getboolean(section, 'ENABLED'): if config.get(section, 'MODE') == 'PEER': diff --git a/mysql.py b/mysql.py new file mode 100644 index 0000000..e69de29