use a local instance of LinearDateGuesser instead of global one

When giving LinearDateGuesser instance to DateGuesser at Page's
declaration, that'll be the SAME object for all the life-time of the
module. So when listing transactions of a second account, the first taken
date is the date of the oldest transaction of the first account!
This commit is contained in:
Romain Bignon 2015-01-13 16:59:13 +01:00
commit 87070bf05a
4 changed files with 15 additions and 13 deletions

View file

@ -24,6 +24,7 @@ from itertools import chain
from weboob.exceptions import BrowserHTTPError, BrowserIncorrectPassword
from weboob.browser import LoginBrowser, URL, need_login
from weboob.tools.date import LinearDateGuesser
from .pages import LoginPage, AccountsPage, HistoryPage
@ -71,4 +72,6 @@ class CmsoProBrowser(LoginBrowser):
first_page = self.page
rest_page = self.history.go(data=query)
return chain(first_page.iter_history(), rest_page.iter_history())
date_guesser = LinearDateGuesser()
return chain(first_page.iter_history(date_guesser=date_guesser), rest_page.iter_history(date_guesser=date_guesser))