works with any subbank
This commit is contained in:
parent
f16f1ddb87
commit
95af3239f1
1 changed files with 13 additions and 18 deletions
|
|
@ -18,6 +18,8 @@
|
||||||
# along with weboob. If not, see <http://www.gnu.org/licenses/>.
|
# along with weboob. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
|
||||||
|
from urlparse import urlparse
|
||||||
|
|
||||||
from weboob.tools.browser import BaseBrowser, BrowserIncorrectPassword
|
from weboob.tools.browser import BaseBrowser, BrowserIncorrectPassword
|
||||||
from weboob.capabilities.bank import Transfer, TransferError
|
from weboob.capabilities.bank import Transfer, TransferError
|
||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
|
|
@ -46,10 +48,7 @@ class CICBrowser(BaseBrowser):
|
||||||
'https://www.cic.fr/.*/fr/banque/.*Vir.*': TransfertPage
|
'https://www.cic.fr/.*/fr/banque/.*Vir.*': TransfertPage
|
||||||
}
|
}
|
||||||
|
|
||||||
def __init__(self, *args, **kwargs):
|
currentSubBank = None
|
||||||
BaseBrowser.__init__(self, *args, **kwargs)
|
|
||||||
#self.SUB_BANKS = ['cmdv','cmcee','cmse', 'cmidf', 'cmsmb', 'cmma', 'cmmabn', 'cmc', 'cmlaco', 'cmnormandie', 'cmm']
|
|
||||||
#self.currentSubBank = None
|
|
||||||
|
|
||||||
def is_logged(self):
|
def is_logged(self):
|
||||||
return self.page and not self.is_on_page(LoginPage) and not self.is_on_page(LoginErrorPage)
|
return self.page and not self.is_on_page(LoginPage) and not self.is_on_page(LoginErrorPage)
|
||||||
|
|
@ -69,7 +68,6 @@ class CICBrowser(BaseBrowser):
|
||||||
if not self.is_logged() or self.is_on_page(LoginErrorPage):
|
if not self.is_logged() or self.is_on_page(LoginErrorPage):
|
||||||
raise BrowserIncorrectPassword()
|
raise BrowserIncorrectPassword()
|
||||||
|
|
||||||
self.SUB_BANKS = ['cmdv', 'cmcee', 'cmse', 'cmidf', 'cmsmb', 'cmma', 'cmmabn', 'cmc', 'cmlaco', 'cmnormandie', 'cmm', 'sb']
|
|
||||||
self.getCurrentSubBank()
|
self.getCurrentSubBank()
|
||||||
|
|
||||||
def get_accounts_list(self):
|
def get_accounts_list(self):
|
||||||
|
|
@ -89,11 +87,8 @@ class CICBrowser(BaseBrowser):
|
||||||
|
|
||||||
def getCurrentSubBank(self):
|
def getCurrentSubBank(self):
|
||||||
# the account list and history urls depend on the sub bank of the user
|
# the account list and history urls depend on the sub bank of the user
|
||||||
current_url = self.geturl()
|
url = urlparse(self.geturl())
|
||||||
current_url_parts = current_url.split('/')
|
self.currentSubBank = url.path.lstrip('/').split('/')[0]
|
||||||
for subbank in self.SUB_BANKS:
|
|
||||||
if subbank in current_url_parts:
|
|
||||||
self.currentSubBank = subbank
|
|
||||||
|
|
||||||
def get_history(self, account):
|
def get_history(self, account):
|
||||||
page_url = account._link_id
|
page_url = account._link_id
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue