LCL: fix history command due to website changes

Signed-off-by: Pierre Mazière <pierre.maziere@gmail.com>
Signed-off-by: Romain Bignon <romain@peerfuse.org>
This commit is contained in:
Pierre Mazière 2011-04-21 14:14:54 +02:00 committed by Romain Bignon
commit c7968faa20

View file

@ -73,14 +73,13 @@ class AccountsPage(BasePage):
class AccountHistoryPage(BasePage):
def on_loaded(self):
self.operations = []
done=False
for table in self.document.getiterator('table'):
title_tr=table.find('tr')
if title_tr is None:
for td in self.document.iter('td'):
text=td.findtext("b")
if text is None:
continue
for text in title_tr.itertext():
prefix='Opérations effectuées'
if text.startswith(prefix.decode('utf-8')):
table=td.getparent().getparent()
for tr in table.iter('tr'):
tr_class=tr.attrib.get('class')
if tr_class == 'tbl1' or tr_class=='tbl2':
@ -96,10 +95,6 @@ class AccountHistoryPage(BasePage):
operation.label=label
operation.amount=amount
self.operations.append(operation)
done=True
break
if done:
break
def get_operations(self):
return self.operations