From 8e4e2598a8e97cbc915228b1d5a5d0bf72874e75 Mon Sep 17 00:00:00 2001 From: Baptiste Delpey Date: Wed, 30 Jan 2019 17:07:52 +0100 Subject: [PATCH] ing: this method also get balance of market accounts on bourse website --- modules/ing/browser.py | 12 ++++++------ modules/ing/pages/transfer.py | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/modules/ing/browser.py b/modules/ing/browser.py index 89a2db3e24..848cc4f359 100644 --- a/modules/ing/browser.py +++ b/modules/ing/browser.py @@ -195,7 +195,7 @@ def get_market_balance(self, account): self.cache["investments_data"][account.id] = self.page.doc or None @need_login - def get_iban(self, account): + def fill_account(self, account): if account.type in [Account.TYPE_CHECKING, Account.TYPE_SAVINGS]: self.go_account_page(account) account.iban = self.ibanpage.go().get_iban() @@ -204,7 +204,7 @@ def get_iban(self, account): self.get_market_balance(account) @need_login - def get_accounts_on_space(self, space, get_iban=True): + def get_accounts_on_space(self, space, fill_account=True): accounts_list = [] self.change_space(space) @@ -227,19 +227,19 @@ def get_accounts_on_space(self, space, get_iban=True): @need_login @start_with_main_site - def get_accounts_list(self, space=None, get_iban=True): + def get_accounts_list(self, space=None, fill_account=True): self.accountspage.go() self.where = 'start' self.set_multispace() if space: - for acc in self.get_accounts_on_space(space, get_iban=get_iban): + for acc in self.get_accounts_on_space(space, fill_account=fill_account): yield acc elif self.multispace: for space in self.multispace: - for acc in self.get_accounts_on_space(space, get_iban=get_iban): + for acc in self.get_accounts_on_space(space, fill_account=fill_account): yield acc else: for acc in self.page.get_list(): @@ -288,7 +288,7 @@ def return_from_loan_site(self): self.location('https://secure.ing.fr/', data={'token': self.response.text}) def get_account(self, _id, space=None): - return find_object(self.get_accounts_list(get_iban=False, space=space), id=_id, error=AccountNotFound) + return find_object(self.get_accounts_list(fill_account=False, space=space), id=_id, error=AccountNotFound) def go_account_page(self, account): diff --git a/modules/ing/pages/transfer.py b/modules/ing/pages/transfer.py index 034bd08599..b05ec9e098 100644 --- a/modules/ing/pages/transfer.py +++ b/modules/ing/pages/transfer.py @@ -73,7 +73,7 @@ class item(MyRecipient): def parse(self, el): _id = Attr('.', 'data-acct-number')(self) - accounts = [acc for acc in self.page.browser.get_accounts_list(get_iban=False, space=self.env['origin']._space) if _id in acc.id] + accounts = [acc for acc in self.page.browser.get_accounts_list(fill_account=False, space=self.env['origin']._space) if _id in acc.id] assert len(accounts) == 1 account = accounts[0] self.env['id'] = account.id -- GitLab