From 359b91daf88773f8c01e4daa3bd6b42cb18bd0e2 Mon Sep 17 00:00:00 2001 From: Florent Date: Thu, 24 Jan 2013 22:54:24 +0100 Subject: [PATCH] Pep8 cleaning --- modules/leclercmobile/backend.py | 3 ++- modules/leclercmobile/browser.py | 7 ++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/modules/leclercmobile/backend.py b/modules/leclercmobile/backend.py index 1ea9cd5f..cf39b3a6 100644 --- a/modules/leclercmobile/backend.py +++ b/modules/leclercmobile/backend.py @@ -19,7 +19,8 @@ from __future__ import with_statement -from weboob.capabilities.bill import ICapBill, SubscriptionNotFound, BillNotFound, Subscription, Bill +from weboob.capabilities.bill import ICapBill, SubscriptionNotFound,\ + BillNotFound, Subscription, Bill from weboob.tools.backend import BaseBackend, BackendConfig from weboob.tools.value import ValueBackendPassword diff --git a/modules/leclercmobile/browser.py b/modules/leclercmobile/browser.py index 4d7412fa..2bbe76ca 100644 --- a/modules/leclercmobile/browser.py +++ b/modules/leclercmobile/browser.py @@ -38,6 +38,7 @@ class Leclercmobile(BaseBrowser): accueil = "/EspaceClient/pgeWERL013_Accueil.aspx" login = "/EspaceClient/pgeWERL008_Login.aspx" conso = "/EspaceClient/pgeWERL009_ReleveConso.aspx" + bills = '/EspaceClient/pgeWERL015_RecupReleveConso.aspx?m=-' def __init__(self, *args, **kwargs): BaseBrowser.__init__(self, *args, **kwargs) @@ -102,7 +103,7 @@ class Leclercmobile(BaseBrowser): maxid = self.page.getmaxid() for i in range(maxid + 1): - response = self.openurl('/EspaceClient/pgeWERL015_RecupReleveConso.aspx?m=-' + str(i)) + response = self.openurl(self.bills + str(i)) mimetype = response.info().get('Content-Type', '').split(';')[0] if mimetype == "application/pdf": pdf = PdfPage(StringIO.StringIO(response.read())) @@ -112,7 +113,7 @@ class Leclercmobile(BaseBrowser): def get_details(self): if not self.is_on_page(HistoryPage): self.location(self.conso) - response = self.openurl('/EspaceClient/pgeWERL015_RecupReleveConso.aspx?m=-0') + response = self.openurl(self.bills + "0") pdf = PdfPage(StringIO.StringIO(response.read())) for detail in pdf.get_details(): yield detail @@ -133,6 +134,6 @@ class Leclercmobile(BaseBrowser): def get_balance(self): if not self.is_on_page(HistoryPage): self.location(self.conso) - response = self.openurl('/EspaceClient/pgeWERL015_RecupReleveConso.aspx?m=-0') + response = self.openurl(self.bills + "0") pdf = PdfPage(StringIO.StringIO(response.read())) return pdf.get_balance()