Commit 39485806 authored by Romain Bignon's avatar Romain Bignon Committed by Romain Bignon

bnporc: rename 'get_accounts_list' to 'iter_accounts'

parent 10e98041
......@@ -51,13 +51,13 @@ class BNPCompany(LoginBrowser):
@need_login
def get_accounts_list(self):
def iter_accounts(self):
self.accounts.go()
return self.page.iter_accounts()
@need_login
def get_account(self, _id):
return find_object(self.get_accounts_list(), id=_id, error=AccountNotFound)
return find_object(self.iter_accounts(), id=_id, error=AccountNotFound)
def get_transactions(self, id_account, typeReleve, dateMin, dateMax='null'):
self.open('https://secure1.entreprises.bnpparibas.net/NCCPresentationWeb/e11_releve_op/init.do?e10=true')
......
......@@ -86,7 +86,7 @@ class BNPEnterprise(LoginBrowser):
raise BrowserIncorrectPassword
@need_login
def get_accounts_list(self):
def iter_accounts(self):
accounts = []
# Fetch checking accounts:
for account in self.accounts.stay_or_go().iter_accounts():
......@@ -113,7 +113,7 @@ class BNPEnterprise(LoginBrowser):
@need_login
def get_account(self, _id):
for account in self.get_accounts_list():
for account in self.iter_accounts():
if account.id == _id:
return account
......
......@@ -74,8 +74,7 @@ class BNPorcModule(Module, CapBankWealth, CapBankTransferAddRecipient, CapMessag
return self.create_browser(self.config)
def iter_accounts(self):
for account in self.browser.get_accounts_list():
yield account
return self.browser.iter_accounts()
def get_account(self, _id):
account = self.browser.get_account(_id)
......
......@@ -158,7 +158,7 @@ class BNPParibasBrowser(JsonBrowserMixin, LoginBrowser):
raise ProfileMissing(self.page.get_error_message())
@need_login
def get_accounts_list(self):
def iter_accounts(self):
if self.accounts_list is None:
self.accounts_list = []
# In case of password renewal, we need to go on ibans twice.
......@@ -213,7 +213,7 @@ class BNPParibasBrowser(JsonBrowserMixin, LoginBrowser):
@need_login
def get_account(self, _id):
return find_object(self.get_accounts_list(), id=_id, error=AccountNotFound)
return find_object(self.iter_accounts(), id=_id, error=AccountNotFound)
@need_login
def iter_history(self, account, coming=False):
......
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