definitively fix the fucking infinite loop
This commit is contained in:
parent
c71576b7ae
commit
a5f32bbd1b
1 changed files with 8 additions and 5 deletions
|
|
@ -120,17 +120,20 @@ class Ing(BaseBrowser):
|
||||||
self.location(self.accountspage, urllib.urlencode(data))
|
self.location(self.accountspage, urllib.urlencode(data))
|
||||||
self.where = "history"
|
self.where = "history"
|
||||||
jid = self.page.get_history_jid()
|
jid = self.page.get_history_jid()
|
||||||
i = 0 # index, we get always the same page, but with more informations
|
index = 0 # index, we get always the same page, but with more informations
|
||||||
while 1:
|
while 1:
|
||||||
hashlist = []
|
hashlist = []
|
||||||
for transaction in self.page.get_transactions(i):
|
i = index
|
||||||
|
for transaction in self.page.get_transactions(index):
|
||||||
while transaction.id in hashlist:
|
while transaction.id in hashlist:
|
||||||
transaction.id = hashlib.md5(transaction.id + "1").hexdigest()
|
transaction.id = hashlib.md5(transaction.id + "1").hexdigest()
|
||||||
hashlist.append(transaction.id)
|
hashlist.append(transaction.id)
|
||||||
i += 1
|
i += 1
|
||||||
yield transaction
|
yield transaction
|
||||||
if self.page.islast():
|
# if there is no more transactions, it is useless to continue
|
||||||
|
if i == index or self.page.islast():
|
||||||
return
|
return
|
||||||
|
index = i
|
||||||
data = {"AJAX:EVENTS_COUNT": 1,
|
data = {"AJAX:EVENTS_COUNT": 1,
|
||||||
"AJAXREQUEST": "_viewRoot",
|
"AJAXREQUEST": "_viewRoot",
|
||||||
"autoScroll": "",
|
"autoScroll": "",
|
||||||
|
|
@ -138,7 +141,7 @@ class Ing(BaseBrowser):
|
||||||
"index:%s:moreTransactions" % jid: "index:%s:moreTransactions" % jid,
|
"index:%s:moreTransactions" % jid: "index:%s:moreTransactions" % jid,
|
||||||
"javax.faces.ViewState": account._jid
|
"javax.faces.ViewState": account._jid
|
||||||
}
|
}
|
||||||
self.location(self.accountspage, urllib.urlencode(data))
|
self.location(self.accountspage, urllib.urlencode(data))
|
||||||
|
|
||||||
def get_recipients(self, account):
|
def get_recipients(self, account):
|
||||||
if not self.is_on_page(TransferPage):
|
if not self.is_on_page(TransferPage):
|
||||||
|
|
@ -189,7 +192,7 @@ class Ing(BaseBrowser):
|
||||||
yield bill
|
yield bill
|
||||||
if self.page.islast():
|
if self.page.islast():
|
||||||
return
|
return
|
||||||
|
|
||||||
self.page.next_page()
|
self.page.next_page()
|
||||||
|
|
||||||
def predownload(self, bill):
|
def predownload(self, bill):
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue