diff --git a/modules/fortuneo/backend.py b/modules/fortuneo/backend.py index 1c629d60..4a5a5fce 100644 --- a/modules/fortuneo/backend.py +++ b/modules/fortuneo/backend.py @@ -73,10 +73,6 @@ class FortuneoBackend(BaseBackend, ICapBank): else: raise AccountNotFound() - def iter_coming(self, account): - """Iter coming transactions on a specific account Not supported yet""" - raise NotImplementedError() - def iter_history(self, account): """Iter history of transactions on a specific account""" diff --git a/modules/fortuneo/browser.py b/modules/fortuneo/browser.py index 6c7875d0..60fe596e 100644 --- a/modules/fortuneo/browser.py +++ b/modules/fortuneo/browser.py @@ -19,7 +19,7 @@ # along with weboob. If not, see . -from weboob.tools.browser import BaseBrowser #, BrowserIncorrectPassword +from weboob.tools.browser import BaseBrowser from .pages.login import LoginPage from .pages.accounts_list import AccountsList, AccountHistoryPage @@ -37,7 +37,9 @@ class Fortuneo(BaseBrowser): '.*/prive/mes-comptes/synthese-tous-comptes\.jsp.*': AccountsList, '.*/prive/mes-comptes/livret/consulter-situation/consulter-solde\.jsp\?COMPTE_ACTIF=.*': - AccountHistoryPage + AccountHistoryPage, + '.*/prive/default\.jsp.*': + AccountsList } def __init__(self, *args, **kwargs): @@ -45,7 +47,8 @@ class Fortuneo(BaseBrowser): def home(self): """main page (login)""" - self.location('/fr/prive/identification.jsp') + + self.location('https://' + self.DOMAIN_LOGIN + '/fr/prive/identification.jsp') def is_logged(self): """Return True if we are logged on website""" @@ -67,7 +70,7 @@ class Fortuneo(BaseBrowser): self.location('https://' + self.DOMAIN_LOGIN + '/fr/identification.jsp') self.page.login(self.username, self.password) - self.location('/fr/prive/mes-comptes/synthese-tous-comptes.jsp') + self.location('https://' + self.DOMAIN_LOGIN + '/fr/prive/mes-comptes/synthese-tous-comptes.jsp') def get_history(self, account): if not self.is_on_page(AccountHistoryPage): @@ -78,12 +81,13 @@ class Fortuneo(BaseBrowser): """accounts list""" if not self.is_on_page(AccountsList): - self.location('/fr/prive/mes-comptes/synthese-tous-comptes.jsp') + self.location('https://' + self.DOMAIN_LOGIN + '/fr/prive/mes-comptes/synthese-tous-comptes.jsp') return self.page.get_list() def get_account(self, id): """Get an account from its ID""" + assert isinstance(id, basestring) l = self.get_accounts_list() diff --git a/modules/fortuneo/pages/accounts_list.py b/modules/fortuneo/pages/accounts_list.py index db990d36..bc23eba0 100644 --- a/modules/fortuneo/pages/accounts_list.py +++ b/modules/fortuneo/pages/accounts_list.py @@ -29,7 +29,6 @@ from weboob.capabilities import NotAvailable __all__ = ['AccountsList', 'AccountHistoryPage'] - class AccountHistoryPage(BasePage): def get_operations(self, _id): """history, see http://docs.weboob.org/api/capabilities/bank.html?highlight=transaction#weboob.capabilities.bank.Transaction""" @@ -47,7 +46,7 @@ class AccountHistoryPage(BasePage): date_oper = tables[i].xpath("./td[2]/text()")[0] date_val = tables[i].xpath("./td[3]/text()")[0] label = tables[i].xpath("./td[4]/text()")[0] - operation.label = operation.raw = label.strip() + operation.label = unicode(label.strip()) amount = tables[i].xpath("./td[5]/text() | ./td[6]/text()") operation.date = datetime.datetime.strptime(date_val, "%d/%m/%Y") operation.rdate = datetime.datetime.strptime(date_oper,"%d/%m/%Y") @@ -95,7 +94,7 @@ class AccountsList(BasePage): # account.label tpl = cpt.xpath("./td[2]/a/text()")[0].split(' ') - account.label = ' '.join(tpl[:2]) + account.label = unicode(' '.join(tpl[:2])) l.append(account) diff --git a/modules/fortuneo/test.py b/modules/fortuneo/test.py index d4d243c3..4894c651 100644 --- a/modules/fortuneo/test.py +++ b/modules/fortuneo/test.py @@ -27,5 +27,6 @@ class FortuneoTest(BackendTest): l = list(self.backend.iter_accounts()) self.assertTrue(len(l) > 0) a = l[0] - list(self.backend.iter_coming(a)) list(self.backend.iter_history(a)) + +# vim:ts=4:sw=4