Support for both enabled and disabled flags on plugin level

This commit is contained in:
Fabio Manganiello 2019-02-13 15:14:35 +01:00
parent 0a81b43f1d
commit 27e4ea5b5b

View file

@ -93,6 +93,16 @@ def get_plugin(plugin_name, reload=False):
plugin_conf = Config.get_plugins()[plugin_name] \
if plugin_name in Config.get_plugins() else {}
if 'disabled' in plugin_conf:
if plugin_conf['disabled'] is True:
return None
del plugin_conf['disabled']
if 'enabled' in plugin_conf:
if plugin_conf['enabled'] is False:
return None
del plugin_conf['enabled']
try:
plugin_class = getattr(plugin, cls_name)
except AttributeError as e: