Commit 5b7560f9 authored by Quentin Defenouillere's avatar Quentin Defenouillere Committed by Romain Bignon

[pradoepargne] Make module completely inherit from Humanis

The Prado website has been engulfed by Humanis.
It is currently 100% broken but works when using the Humanis URLs.
Since pradoepargne now behaves exactly like humanis, there is no point
in keeping a browser.py and a pages.py since it works with total
inheritance from humanis.

Closes: 35971@sibi, 35867@sibi, 36065@sibi
parent d7b32af6
# -*- coding: utf-8 -*-
# Copyright(C) 2017 Edouard Lambert
#
# This file is part of a weboob module.
#
# This weboob module is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This weboob module is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this weboob module. If not, see <http://www.gnu.org/licenses/>.
from weboob.browser import AbstractBrowser, URL
from .pages import LoginPage
class PradoBrowser(AbstractBrowser):
PARENT = 'cmes'
login = URL('pradoepargne/fr/identification/default.cgi', LoginPage)
def __init__(self, baseurl, subsite, login, password, *args, **kwargs):
self.weboob = kwargs['weboob']
super(PradoBrowser, self).__init__(baseurl, login, password, subsite, *args, **kwargs)
......@@ -18,18 +18,15 @@
# along with this weboob module. If not, see <http://www.gnu.org/licenses/>.
from weboob.capabilities.bank import CapBankPockets, AccountNotFound
from weboob.tools.backend import Module, BackendConfig
from weboob.tools.backend import AbstractModule, BackendConfig
from weboob.tools.value import ValueBackendPassword
from weboob.capabilities.base import find_object
from .browser import PradoBrowser
from weboob.capabilities.bank import CapBankPockets
__all__ = ['PradoepargneModule']
class PradoepargneModule(Module, CapBankPockets):
class PradoepargneModule(AbstractModule, CapBankPockets):
NAME = 'pradoepargne'
DESCRIPTION = u'Prado Épargne Salariale'
MAINTAINER = u'Edouard Lambert'
......@@ -40,26 +37,4 @@ class PradoepargneModule(Module, CapBankPockets):
ValueBackendPassword('login', label='Identifiant', masked=False),
ValueBackendPassword('password', label='Mot de passe'))
BROWSER = PradoBrowser
def create_default_browser(self):
return self.create_browser("https://www.gestion-epargne-salariale.fr",
"pradoepargne/",
self.config['login'].get(),
self.config['password'].get(),
weboob=self.weboob)
def get_account(self, _id):
return find_object(self.browser.iter_accounts(), id=_id, error=AccountNotFound)
def iter_accounts(self):
return self.browser.iter_accounts()
def iter_history(self, account):
return self.browser.iter_history(account)
def iter_investment(self, account):
return self.browser.iter_investment(account)
def iter_pocket(self, account):
return self.browser.iter_pocket(account)
PARENT = 'humanis'
# -*- coding: utf-8 -*-
# Copyright(C) 2012-2019 Budget Insight
from weboob.browser.pages import AbstractPage
class LoginPage(AbstractPage):
PARENT = 'cmes'
PARENT_URL = 'login'
BROWSER_ATTR = 'package.browser.CmesBrowser'
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