fix bforbank

This commit is contained in:
Baptiste Delpey 2015-06-03 15:44:51 +02:00 committed by Romain Bignon
commit 306d25242d
2 changed files with 3 additions and 3 deletions

View file

@ -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

View file

@ -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)