From d095811799c082b02611a389c1d98e353394d172 Mon Sep 17 00:00:00 2001 From: Florent Date: Wed, 18 Apr 2012 11:13:24 +0200 Subject: [PATCH] Use yield to return objects an not a list --- modules/ing/pages/account_history.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/modules/ing/pages/account_history.py b/modules/ing/pages/account_history.py index c6861619..03ab699d 100644 --- a/modules/ing/pages/account_history.py +++ b/modules/ing/pages/account_history.py @@ -40,7 +40,9 @@ class Transaction(FrenchTransaction): class AccountHistory(BasePage): def on_loaded(self): - self.transactions = [] + pass + + def get_transactions(self): table = self.document.findall('//tbody')[0] i = 1 for tr in table.xpath('tr'): @@ -53,9 +55,7 @@ class AccountHistory(BasePage): op.category = texte[4] op.amount = Decimal(op.clean_amount(texte[5])) - - self.transactions.append(op) + print "coin" i += 1 + yield op - def get_transactions(self): - return self.transactions