From 2c4862ee625b3984a6fea5b52ef4cf163566df43 Mon Sep 17 00:00:00 2001 From: Vincent Ardisson Date: Thu, 8 Dec 2016 15:48:17 +0100 Subject: [PATCH] [bforbank] import spirica browser with AbstractBrowser instead of symlinks --- modules/bforbank/browser.py | 6 +++--- modules/bforbank/module.py | 3 ++- modules/bforbank/spirica/browser.py | 1 - modules/bforbank/spirica/pages.py | 1 - modules/bforbank/spirica_browser.py | 24 ++++++++++++++++++++++++ 5 files changed, 29 insertions(+), 6 deletions(-) delete mode 120000 modules/bforbank/spirica/browser.py delete mode 120000 modules/bforbank/spirica/pages.py create mode 100644 modules/bforbank/spirica_browser.py diff --git a/modules/bforbank/browser.py b/modules/bforbank/browser.py index 4f59259506..e2ac4f2863 100644 --- a/modules/bforbank/browser.py +++ b/modules/bforbank/browser.py @@ -26,7 +26,7 @@ LoginPage, ErrorPage, AccountsPage, HistoryPage, LoanHistoryPage, RibPage, LifeInsuranceIframe, LifeInsuranceRedir ) -from .spirica.browser import SpiricaBrowser +from .spirica_browser import SpiricaBrowser class BforbankBrowser(LoginBrowser): @@ -42,12 +42,12 @@ class BforbankBrowser(LoginBrowser): lifeinsurance_iframe = URL(r'/client/accounts/lifeInsurance/consultationDetailSpirica.action', LifeInsuranceIframe) lifeinsurance_redir = URL(r'https://assurance-vie.bforbank.com:443/sylvea/welcomeSSO.xhtml', LifeInsuranceRedir) - def __init__(self, birthdate, *args, **kwargs): + def __init__(self, weboob, birthdate, *args, **kwargs): super(BforbankBrowser, self).__init__(*args, **kwargs) self.birthdate = birthdate self.accounts = None - self.spirica = SpiricaBrowser('https://assurance-vie.bforbank.com:443/', None, None) + self.spirica = SpiricaBrowser(weboob, 'https://assurance-vie.bforbank.com:443/', None, None) def do_login(self): assert isinstance(self.username, basestring) diff --git a/modules/bforbank/module.py b/modules/bforbank/module.py index bf24d5f639..9a468b3b85 100644 --- a/modules/bforbank/module.py +++ b/modules/bforbank/module.py @@ -43,7 +43,8 @@ class BforbankModule(Module, CapBank): BROWSER = BforbankBrowser def create_default_browser(self): - return self.create_browser(self.config['birthdate'].get(), + return self.create_browser(self.weboob, + self.config['birthdate'].get(), self.config['login'].get(), self.config['password'].get()) diff --git a/modules/bforbank/spirica/browser.py b/modules/bforbank/spirica/browser.py deleted file mode 120000 index c6e5247cba..0000000000 --- a/modules/bforbank/spirica/browser.py +++ /dev/null @@ -1 +0,0 @@ -../../spirica/browser.py \ No newline at end of file diff --git a/modules/bforbank/spirica/pages.py b/modules/bforbank/spirica/pages.py deleted file mode 120000 index 09325e4584..0000000000 --- a/modules/bforbank/spirica/pages.py +++ /dev/null @@ -1 +0,0 @@ -../../spirica/pages.py \ No newline at end of file diff --git a/modules/bforbank/spirica_browser.py b/modules/bforbank/spirica_browser.py new file mode 100644 index 0000000000..e29bb29853 --- /dev/null +++ b/modules/bforbank/spirica_browser.py @@ -0,0 +1,24 @@ +# -*- coding: utf-8 -*- + +# Copyright(C) 2011 Edouard Lambert +# +# This file is part of weboob. +# +# weboob 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. +# +# weboob 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 weboob. If not, see . + +from weboob.browser.browsers import AbstractBrowser + + +class SpiricaBrowser(AbstractBrowser): + PARENT = 'spirica' -- GitLab