Support for accounts without "coming" in bnporc

This commit is contained in:
Laurent Bachelier 2010-10-01 19:12:48 +02:00
commit 879445ead2

View file

@ -49,10 +49,14 @@ class AccountsList(BasePage):
balance = balance.replace('.','').replace(',','.')
account.balance = float(balance)
elif td.attrib.get('headers', '').startswith('Avenir'):
a = td.findall('a')
coming = a[0].text
coming = coming.replace('.','').replace(',','.')
account.coming = float(coming)
# Some accounts don't have a "coming"
if td.text.strip() == '-':
account.coming = 0.0
else:
a = td.findall('a')
coming = a[0].text
coming = coming.replace('.','').replace(',','.')
account.coming = float(coming)
l.append(account)
return l