Commit 3eafe21b authored by Vincent Ardisson's avatar Vincent Ardisson Committed by Vincent A

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.
parent ea997b03
......@@ -1346,6 +1346,10 @@ class ReplApplication(ConsoleApplication, MyCmd):
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()]))
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