From 0668db2b5a19718e1024b189eba9453d5d1361a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pierre=20Mazi=C3=A8re?= Date: Sat, 4 Jan 2014 14:53:02 +0100 Subject: [PATCH] ReplApplication.get_object(): fix backend lookup MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit because self.enabled_backends contains BaseBackend objects and not backend name strings Signed-off-by: Pierre Mazière --- weboob/tools/application/repl.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/weboob/tools/application/repl.py b/weboob/tools/application/repl.py index a49fa9ed..a5c6e9c6 100644 --- a/weboob/tools/application/repl.py +++ b/weboob/tools/application/repl.py @@ -265,7 +265,10 @@ class ReplApplication(Cmd, ConsoleApplication): # remove backends that do not have the required method new_backend_names=[] for backend in backend_names: - actual_backend = self.weboob.get_backend(backend) + if isinstance(backend,str): + actual_backend = self.weboob.get_backend(backend) + else: + actual_backend = backend if getattr(actual_backend, method, None) is not None: new_backend_names.append(backend) backend_names = tuple(new_backend_names)