fix navigation

This commit is contained in:
Romain Bignon 2012-12-20 16:22:18 +01:00 committed by Romain Bignon
commit 0329c73067
2 changed files with 7 additions and 1 deletions

View file

@ -94,6 +94,9 @@ class Barclays(BaseBrowser):
return None
def get_history(self, account):
if not self.is_on_page(AccountsPage):
self.location('tbord.do')
self.location(account._link)
assert self.is_on_page((TransactionsPage, ValuationPage))
@ -101,6 +104,9 @@ class Barclays(BaseBrowser):
return self.page.get_history()
def get_coming_operations(self, account):
if not self.is_on_page(AccountsPage):
self.location('tbord.do')
for card in account._card_links:
self.location(card)

View file

@ -160,7 +160,7 @@ class CardPage(BasePage):
raw = u' '.join([txt.strip() for txt in tds[1].itertext()])
amount = u''.join([txt.strip() for txt in tds[-1].itertext()])
t.parse(date, re.sub(r'[ ]+', ' ', raw))
t.label = tds[1].find('span').text.strip()
t.label = unicode(tds[1].find('span').text.strip())
t.type = t.TYPE_CARD
t.set_amount(amount)
yield t