From 39485806afa5f1d5969a9dbec054d17d83978a95 Mon Sep 17 00:00:00 2001 From: Romain Bignon Date: Sat, 24 Nov 2018 14:32:08 +0100 Subject: [PATCH] bnporc: rename 'get_accounts_list' to 'iter_accounts' --- modules/bnporc/company/browser.py | 4 ++-- modules/bnporc/enterprise/browser.py | 4 ++-- modules/bnporc/module.py | 3 +-- modules/bnporc/pp/browser.py | 4 ++-- 4 files changed, 7 insertions(+), 8 deletions(-) diff --git a/modules/bnporc/company/browser.py b/modules/bnporc/company/browser.py index 07ee0c77d6..b9a50f44cc 100644 --- a/modules/bnporc/company/browser.py +++ b/modules/bnporc/company/browser.py @@ -51,13 +51,13 @@ def do_login(self): @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') diff --git a/modules/bnporc/enterprise/browser.py b/modules/bnporc/enterprise/browser.py index b644d67022..cfbac1d8fb 100644 --- a/modules/bnporc/enterprise/browser.py +++ b/modules/bnporc/enterprise/browser.py @@ -86,7 +86,7 @@ def do_login(self): 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 @@ def get_accounts_list(self): @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 diff --git a/modules/bnporc/module.py b/modules/bnporc/module.py index 803e513825..1d6827b44e 100644 --- a/modules/bnporc/module.py +++ b/modules/bnporc/module.py @@ -74,8 +74,7 @@ def create_default_browser(self): 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) diff --git a/modules/bnporc/pp/browser.py b/modules/bnporc/pp/browser.py index 7575425cea..0b3d9305de 100644 --- a/modules/bnporc/pp/browser.py +++ b/modules/bnporc/pp/browser.py @@ -158,7 +158,7 @@ def get_profile(self): 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 @@ def get_accounts_list(self): @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): -- GitLab