From 306d25242db5b9a962183eec097a1ff12a1465e6 Mon Sep 17 00:00:00 2001 From: Baptiste Delpey Date: Wed, 3 Jun 2015 15:44:51 +0200 Subject: [PATCH] fix bforbank --- modules/bforbank/module.py | 4 ++-- modules/bforbank/pages.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/bforbank/module.py b/modules/bforbank/module.py index 89cd7f50..03ca0512 100644 --- a/modules/bforbank/module.py +++ b/modules/bforbank/module.py @@ -21,7 +21,7 @@ from weboob.tools.backend import Module, BackendConfig from weboob.capabilities.bank import CapBank, AccountNotFound from weboob.capabilities.base import find_object -from weboob.tools.value import ValueBackendPassword +from weboob.tools.value import ValueBackendPassword, Value from .browser import BforbankBrowser @@ -37,7 +37,7 @@ class BforbankModule(Module, CapBank): VERSION = '1.1' CONFIG = BackendConfig(ValueBackendPassword('login', label='Identifiant', masked=False), ValueBackendPassword('password', label='Code personnel'), - ValueBackendPassword('birthdate', label='Date de naissance'), + Value('birthdate', label='Date de naissance', regexp='^(\d{2}[/-]?\d{2}[/-]?\d{4}|)$') ) BROWSER = BforbankBrowser diff --git a/modules/bforbank/pages.py b/modules/bforbank/pages.py index 2a34bd63..b7664f20 100644 --- a/modules/bforbank/pages.py +++ b/modules/bforbank/pages.py @@ -106,7 +106,7 @@ class AccountsPage(LoggedPage, HTMLPage): balance = re.sub(r'[^\d\-\,]', '', balance) return Decimal(re.sub(r',(?!(\d+$))', '', balance).replace(',', '.')) - obj_id = CleanText('./td/div/div[3]/span') + obj_id = CleanText('./td/div/div[3]/span') & Regexp(pattern=r'(\d+)') obj_label = CleanText('./td/div/div[2]/span') obj_currency = FrenchTransaction.Currency('./td/div/div[1]/div/span') obj_type = Map(Regexp(Field('label'), r'^(\w+)'), TYPE, default=Account.TYPE_UNKNOWN)