From 3eafe21b2cb85e61fbff6a5e0a68a523c580cb79 Mon Sep 17 00:00:00 2001 From: Vincent Ardisson Date: Tue, 12 May 2020 17:11:17 +0200 Subject: [PATCH] ReplApplication: expose "backend" and "browser" symbols in "debug" command We mimic weboob-debug command which exposes "backend" and "browser" variables. The "debug" command of REPL applications will expose them if there's only one backend loaded. --- weboob/tools/application/repl.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/weboob/tools/application/repl.py b/weboob/tools/application/repl.py index 88217de462..7fb6be9393 100644 --- a/weboob/tools/application/repl.py +++ b/weboob/tools/application/repl.py @@ -1346,6 +1346,10 @@ def do_debug(self, line): app = weboobdebug.WeboobDebug() locs = dict(application=self, weboob=self.weboob) + if len(self.weboob.backend_instances): + locs['backend'] = next(iter(self.weboob.backend_instances.values())) + locs['browser'] = locs['backend'].browser + banner = ('Weboob debug shell\n\nAvailable variables:\n' + '\n'.join([' %s: %s' % (k, v) for k, v in locs.items()])) -- GitLab