From 3b74ed2bb7dfd741480407f42449efbc2cf8cef0 Mon Sep 17 00:00:00 2001 From: Fabio Manganiello Date: Mon, 11 Dec 2017 10:05:45 +0100 Subject: [PATCH] Don't include disabled sections in the config --- runbullet/__init__.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/runbullet/__init__.py b/runbullet/__init__.py index 4a3f17807..011ee9e8d 100644 --- a/runbullet/__init__.py +++ b/runbullet/__init__.py @@ -118,6 +118,10 @@ def parse_config_file(config_file=None): except FileNotFoundError as e: pass + for section in config: + if 'disabled' in config[section] and config[section]['disabled']: + del config[section] + return config @@ -125,8 +129,7 @@ def get_backends(config): backends = [] for k in config.keys(): - if k.startswith('backend.') and ( - 'disabled' not in config[k] or not config[k]['disabled']): + if k.startswith('backend.'): module = importlib.import_module(__package__ + '.' + k) # e.g. backend.pushbullet main class: PushbulletBackend