correctly handle BrowserUnavailable and BrowserIncorrectPassword exceptions in repl applications (closes #302)
It asks user to reconfigure backend when BrowserIncorrectPassword is raised.
This commit is contained in:
parent
ccc663be70
commit
6dfbda042c
4 changed files with 67 additions and 31 deletions
|
|
@ -97,6 +97,7 @@ class Weboob(object):
|
|||
return loaded
|
||||
|
||||
def unload_backends(self, names=None):
|
||||
unloaded = {}
|
||||
if isinstance(names, basestring):
|
||||
names = [names]
|
||||
elif names is None:
|
||||
|
|
@ -106,6 +107,9 @@ class Weboob(object):
|
|||
backend = self.backend_instances.pop(name)
|
||||
with backend:
|
||||
backend.deinit()
|
||||
unloaded[backend.name] = backend
|
||||
|
||||
return unloaded
|
||||
|
||||
def get_backend(self, name):
|
||||
return self.backend_instances[name]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue