misc: small fix or general refactoring i did not bother commenting

This commit is contained in:
Simone Margaritelli 2019-10-04 00:50:33 +02:00
parent dae50bc65d
commit 683d260c74
No known key found for this signature in database
GPG Key ID: 82E42E7F3B34C97E

@ -43,8 +43,12 @@ def load_from_path(path, enabled=()):
def load(config):
load_from_path(default_path, enabled=config['main']['plugins'])
if 'custom_plugins' in config['main'] and config['main']['custom_plugins'] is not None:
load_from_path(config['main']['custom_plugins'], enabled=config['main']['plugins'])
enabled = config['main']['plugins']
custom_path = config['main']['custom_plugins'] if 'custom_plugins' in config['main'] else None
# load default plugins
load_from_path(default_path, enabled=enabled)
# load custom ones
if custom_path is not None:
load_from_path(custom_path, enabled=enabled)
on('loaded')