handling timeout when fetching old history
This commit is contained in:
parent
e822f16980
commit
e8ab487681
1 changed files with 10 additions and 6 deletions
|
|
@ -21,6 +21,7 @@
|
||||||
import datetime
|
import datetime
|
||||||
from dateutil.relativedelta import relativedelta
|
from dateutil.relativedelta import relativedelta
|
||||||
|
|
||||||
|
from weboob.exceptions import BrowserHTTPError
|
||||||
from weboob.deprecated.browser import Browser, BrowserIncorrectPassword
|
from weboob.deprecated.browser import Browser, BrowserIncorrectPassword
|
||||||
|
|
||||||
from .pages import LoginPage, AccountPage, UselessPage, HomePage, ProHistoryPage, PartHistoryPage, HistoryDetailsPage, ErrorPage
|
from .pages import LoginPage, AccountPage, UselessPage, HomePage, ProHistoryPage, PartHistoryPage, HistoryDetailsPage, ErrorPage
|
||||||
|
|
@ -128,12 +129,15 @@ class Paypal(Browser):
|
||||||
return iter([])
|
return iter([])
|
||||||
|
|
||||||
assert step_max <= 365*2 # PayPal limitations as of 2014-06-16
|
assert step_max <= 365*2 # PayPal limitations as of 2014-06-16
|
||||||
for i in self.smart_fetch(beginning=self.BEGINNING,
|
try:
|
||||||
end=datetime.date.today(),
|
for i in self.smart_fetch(beginning=self.BEGINNING,
|
||||||
step_min=step_min,
|
end=datetime.date.today(),
|
||||||
step_max=step_max,
|
step_min=step_min,
|
||||||
fetch_fn=fetch_fn):
|
step_max=step_max,
|
||||||
yield i
|
fetch_fn=fetch_fn):
|
||||||
|
yield i
|
||||||
|
except BrowserHTTPError:
|
||||||
|
self.logger.warning("Paypal timeout")
|
||||||
|
|
||||||
def smart_fetch(self, beginning, end, step_min, step_max, fetch_fn):
|
def smart_fetch(self, beginning, end, step_min, step_max, fetch_fn):
|
||||||
"""
|
"""
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue