Don't include disabled sections in the config
This commit is contained in:
parent
b4c445ecec
commit
3b74ed2bb7
1 changed files with 5 additions and 2 deletions
|
@ -118,6 +118,10 @@ def parse_config_file(config_file=None):
|
||||||
except FileNotFoundError as e:
|
except FileNotFoundError as e:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
for section in config:
|
||||||
|
if 'disabled' in config[section] and config[section]['disabled']:
|
||||||
|
del config[section]
|
||||||
|
|
||||||
return config
|
return config
|
||||||
|
|
||||||
|
|
||||||
|
@ -125,8 +129,7 @@ def get_backends(config):
|
||||||
backends = []
|
backends = []
|
||||||
|
|
||||||
for k in config.keys():
|
for k in config.keys():
|
||||||
if k.startswith('backend.') and (
|
if k.startswith('backend.'):
|
||||||
'disabled' not in config[k] or not config[k]['disabled']):
|
|
||||||
module = importlib.import_module(__package__ + '.' + k)
|
module = importlib.import_module(__package__ + '.' + k)
|
||||||
|
|
||||||
# e.g. backend.pushbullet main class: PushbulletBackend
|
# e.g. backend.pushbullet main class: PushbulletBackend
|
||||||
|
|
Loading…
Reference in a new issue