all loaded backends are now configured (refs #368)

This commit is contained in:
Romain Bignon 2010-08-19 22:13:01 +02:00
commit 9581fa0b19
15 changed files with 17 additions and 45 deletions

View file

@ -179,14 +179,6 @@ class BaseApplication(object):
logging.warning(u'No backend loaded')
return loaded
def load_configured_backends(self, caps=None, names=None, *args, **kwargs):
if names is None:
names = self.requested_backends
loaded = self.weboob.load_configured_backends(caps, names, *args, **kwargs)
if not loaded:
logging.warning(u'No configured backend loaded')
return loaded
def _get_optparse_version(self):
version = None
if self.VERSION:

View file

@ -273,8 +273,8 @@ class ConsoleApplication(BaseApplication):
register_command = staticmethod(register_command)
command = staticmethod(command)
def load_configured_backends(self, caps=None, names=None, *args, **kwargs):
loaded_backends = BaseApplication.load_configured_backends(self, caps, names, *args, **kwargs)
def load_backends(self, caps=None, names=None, *args, **kwargs):
loaded_backends = BaseApplication.load_backends(self, caps, names, *args, **kwargs)
if not loaded_backends:
logging.error(u'Cannot start application: no configured backend was found.\nHere is a list of all available backends:')
from weboob.applications.weboobcfg import WeboobCfg

View file

@ -310,6 +310,6 @@ class BackendCfg(QDialog):
ret = (len(self.to_load) > 0 or len(self.to_unload) > 0)
self.weboob.unload_backends(self.to_unload)
self.weboob.load_configured_backends(names=self.to_load)
self.weboob.load_backends(names=self.to_load)
return ret

View file

@ -32,7 +32,7 @@ class BackendTest(TestCase):
self.backend = None
self.weboob = Weboob()
if self.weboob.load_configured_backends(modules=[self.BACKEND]):
if self.weboob.load_backends(modules=[self.BACKEND]):
self.backend = choice(self.weboob.backend_instances.values())
def run(self, result):