From b70779b6bd66d946381f947df6e17806958a4284 Mon Sep 17 00:00:00 2001 From: Nicolas Vergnac Date: Tue, 29 Jun 2021 14:18:35 +0200 Subject: [PATCH] [cmes] remove useless page --- modules/cmes/browser.py | 15 ++++++++------- modules/cmes/pages.py | 32 -------------------------------- 2 files changed, 8 insertions(+), 39 deletions(-) diff --git a/modules/cmes/browser.py b/modules/cmes/browser.py index 257b885b39..4e6ff55aeb 100644 --- a/modules/cmes/browser.py +++ b/modules/cmes/browser.py @@ -26,7 +26,7 @@ from woob.exceptions import BrowserIncorrectPassword, ActionNeeded from .pages import ( LoginPage, AccountsPage, OperationsListPage, OperationPage, ActionNeededPage, - InvestmentPage, InvestmentDetailsPage, AssetManagementPage, + InvestmentPage, InvestmentDetailsPage, ) @@ -48,12 +48,13 @@ class CmesBrowser(LoginBrowser): AccountsPage ) - investments = URL(r'(?P.*)(?P.*)fr/epargnants/supports/fiche-du-support.html', InvestmentPage) - investment_details = URL(r'(?P.*)(?P.*)fr/epargnants/supports/epargne-sur-le-support.html', InvestmentDetailsPage) - asset_management = URL( - r'https://www.creditmutuel-am.eu/fr/conseillers-gestion-patrimoine/nos-fonds/VALE_FicheSynthese.aspx', - r'https://www.creditmutuel-am.eu/fr/conseillers-gestion-patrimoine/nos-fonds/VALE_Fiche.aspx', - AssetManagementPage + investments = URL( + r'(?P.*)(?P.*)fr/epargnants/supports/fiche-du-support.html', + InvestmentPage + ) + investment_details = URL( + r'(?P.*)(?P.*)fr/epargnants/supports/epargne-sur-le-support.html', + InvestmentDetailsPage ) operations_list = URL(r'(?P.*)(?P.*)fr/epargnants/operations/index.html', OperationsListPage) diff --git a/modules/cmes/pages.py b/modules/cmes/pages.py index 675f908206..5282fd9842 100644 --- a/modules/cmes/pages.py +++ b/modules/cmes/pages.py @@ -199,38 +199,6 @@ def go_investment_details(self): self.browser.location(investment_details_url) -class AssetManagementPage(LoggedPage, HTMLPage): - def get_page_params(self): - return { - 'forceActualisation': 0, - 'ddp': Regexp(CleanText('//script[contains(text(), "window.location.href")]'), 'window.location.href = ".*?ddp=(.*?)"')(self.doc) - } - - @method - class fill_investment(ItemElement): - def obj_asset_category(self): - asset_category = Title(CleanText('//th[span[contains(text(),"Catégorie")]]/following-sibling::td//span'))(self) - if asset_category == '-': - return NotAvailable - return asset_category - - def obj_performance_history(self): - # Getting cells by th index - performance_xpath = '//table[@id="t_PerformancesEnDate"]/tbody/tr/td[@class="i d " and position()=count(//table[@id="t_PerformancesEnDate"]//th[@id="%s"]/preceding-sibling::th)]' - one_year = CleanDecimal.French(performance_xpath % 'th1an', default=None)(self) - three_years = CleanDecimal.French(performance_xpath % 'th3ans', default=None)(self) - five_years = CleanDecimal.French(performance_xpath % 'th5ans', default=None)(self) - - perfs = {} - if one_year: - perfs[1] = one_year / 100 - if three_years: - perfs[3] = three_years / 100 - if five_years: - perfs[5] = five_years / 100 - return perfs - - POCKET_CONDITIONS = { 'retraite': Pocket.CONDITION_RETIREMENT, 'disponibilites': Pocket.CONDITION_DATE, -- GitLab