fix coding style and login errors handling

This commit is contained in:
Romain Bignon 2014-04-14 16:41:54 +02:00
commit 558b94e9b9
3 changed files with 54 additions and 40 deletions

View file

@ -20,6 +20,7 @@
from weboob.capabilities.bank import ICapBank, AccountNotFound
from weboob.capabilities.base import find_object
from weboob.tools.backend import BaseBackend, BackendConfig
from weboob.tools.value import ValueBackendPassword, Value
@ -51,12 +52,7 @@ class HSBCBackend(BaseBackend, ICapBank):
yield account
def get_account(self, _id):
with self.browser:
account = self.browser.get_account(_id)
if account:
return account
else:
raise AccountNotFound()
return find_object(self.browser.get_accounts_list(), id=_id, error=AccountNotFound)
def iter_history(self, account):
for tr in self.browser.get_history(account):