Commit 59b957d3 authored by Christophe Benz's avatar Christophe Benz

do not load disabled backends

parent bcf32029
...@@ -73,10 +73,11 @@ class Weboob(object): ...@@ -73,10 +73,11 @@ class Weboob(object):
def load_configured_backends(self, caps=None, names=None, storage=None): def load_configured_backends(self, caps=None, names=None, storage=None):
loaded = {} loaded = {}
for instance_name, backend_name, params in self.backends_config.iter_backends(): for instance_name, backend_name, params in self.backends_config.iter_backends():
if '_enabled' in params and not params['_enabled']:
continue
backend = self.backends_loader.get_or_load_backend(backend_name) backend = self.backends_loader.get_or_load_backend(backend_name)
if caps is not None and not backend.has_caps(caps) or \ if caps is not None and not backend.has_caps(caps) or \
names is not None and instance_name not in names or \ names is not None and instance_name not in names:
'_enabled' in params and not params['_enabled']:
continue continue
backend_instance = backend.create_instance(self, instance_name, params, storage) backend_instance = backend.create_instance(self, instance_name, params, storage)
self.backend_instances[instance_name] = loaded[instance_name] = backend_instance self.backend_instances[instance_name] = loaded[instance_name] = backend_instance
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment