Commit 5309faa4 authored by Sylvie Ye's avatar Sylvie Ye Committed by Romain Bignon

[cmb] accounts info page is not needed anymore

parent 6714978c
...@@ -33,7 +33,7 @@ from weboob.capabilities.base import find_object ...@@ -33,7 +33,7 @@ from weboob.capabilities.base import find_object
from weboob.tools.capabilities.bank.transactions import sorted_transactions from weboob.tools.capabilities.bank.transactions import sorted_transactions
from .pages import ( from .pages import (
LogoutPage, InfosPage, AccountsPage, HistoryPage, LifeinsurancePage, MarketPage, LogoutPage, AccountsPage, HistoryPage, LifeinsurancePage, MarketPage,
AdvisorPage, LoginPage, ProfilePage, AdvisorPage, LoginPage, ProfilePage,
) )
from .transfer_pages import TransferInfoPage, RecipientsListPage, TransferPage from .transfer_pages import TransferInfoPage, RecipientsListPage, TransferPage
...@@ -84,7 +84,6 @@ class CmsoParBrowser(LoginBrowser, StatesMixin): ...@@ -84,7 +84,6 @@ class CmsoParBrowser(LoginBrowser, StatesMixin):
logout = URL('/securityapi/revoke', logout = URL('/securityapi/revoke',
'/auth/errorauthn', '/auth/errorauthn',
'/\/auth/errorauthn', LogoutPage) '/\/auth/errorauthn', LogoutPage)
infos = URL('/comptes/', InfosPage)
accounts = URL('/domiapi/oauth/json/accounts/synthese(?P<type>.*)', AccountsPage) accounts = URL('/domiapi/oauth/json/accounts/synthese(?P<type>.*)', AccountsPage)
history = URL('/domiapi/oauth/json/accounts/(?P<page>.*)', HistoryPage) history = URL('/domiapi/oauth/json/accounts/(?P<page>.*)', HistoryPage)
loans = URL('/creditapi/rest/oauth/v1/synthese', AccountsPage) loans = URL('/creditapi/rest/oauth/v1/synthese', AccountsPage)
...@@ -171,8 +170,7 @@ class CmsoParBrowser(LoginBrowser, StatesMixin): ...@@ -171,8 +170,7 @@ class CmsoParBrowser(LoginBrowser, StatesMixin):
accounts_eligibilite_debit = self.page.get_eligibilite_debit() accounts_eligibilite_debit = self.page.get_eligibilite_debit()
# First get all checking accounts... # First get all checking accounts...
data = dict(self.infos.stay_or_go().get_typelist()) self.accounts.go(json={'typeListeCompte': 'COMPTE_SOLDE_COMPTES_CHEQUES'}, type='comptes')
self.accounts.go(data=json.dumps(data), type='comptes', headers=self.json_headers)
self.page.check_response() self.page.check_response()
for key in self.page.get_keys(): for key in self.page.get_keys():
for a in self.page.iter_accounts(key=key): for a in self.page.iter_accounts(key=key):
......
...@@ -55,15 +55,6 @@ class LogoutPage(RawPage): ...@@ -55,15 +55,6 @@ class LogoutPage(RawPage):
pass pass
class InfosPage(LoggedPage, HTMLPage):
def get_typelist(self):
url = Attr(None, 'src').filter(self.doc.xpath('//script[contains(@src, "comptes/scripts")]'))
m = re.findall(r'synthesecomptes[^\w]+([^:]+)[^\w]+([^"]+)', self.browser.open(url).text)
for data in m:
if data[0] != 'method':
return {data[0]: data[1]}
class AccountsPage(LoggedPage, JsonPage): class AccountsPage(LoggedPage, JsonPage):
TYPES = OrderedDict([('courant', Account.TYPE_CHECKING), TYPES = OrderedDict([('courant', Account.TYPE_CHECKING),
('pee', Account.TYPE_PEE), ('pee', Account.TYPE_PEE),
......
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