fix parsing account label

This commit is contained in:
Romain Bignon 2012-04-13 14:59:56 +02:00
commit e8e9302731

View file

@ -147,7 +147,10 @@ class AccountsPage(BasePage):
# TODO parse this string to get the right Account.TYPE_* to
# store in account.type.
account._type=value
account.label=u''+a.getparent().getprevious().text.strip()
div = a.getparent().getprevious()
if not div.text.strip():
div = div.find('div')
account.label=u''+div.text.strip()
balance=a.text.replace(u"\u00A0",'').replace(' ','').replace('.','').replace('+','').replace(',','.')
if '-' in balance:
balance='-'+balance.strip().replace('-', '')