From 3b2fb9cfbd6f9a4a05bd24ebd3972bed51cd725e Mon Sep 17 00:00:00 2001 From: Romain Bignon Date: Tue, 14 May 2013 10:37:54 +0200 Subject: [PATCH] pyflakes fixes --- modules/gdfsuez/backend.py | 4 ++-- modules/gdfsuez/browser.py | 4 ++-- modules/gdfsuez/pages/history.py | 8 +++----- modules/gdfsuez/pages/homepage.py | 3 +-- 4 files changed, 8 insertions(+), 11 deletions(-) diff --git a/modules/gdfsuez/backend.py b/modules/gdfsuez/backend.py index ab57a849..cdd624da 100644 --- a/modules/gdfsuez/backend.py +++ b/modules/gdfsuez/backend.py @@ -51,7 +51,7 @@ class GdfSuezBackend(BaseBackend, ICapBill): def get_subscription(self, _id): if not _id.isdigit(): - raise SubscriptionnotFound() + raise SubscriptionNotFound() with self.browser: subscription = self.browser.get_subscription(_id) if not subscription: @@ -65,7 +65,7 @@ class GdfSuezBackend(BaseBackend, ICapBill): with self.browser: for history in self.browser.get_history(subscription): yield history - + def get_details(self, subscription): if not isinstance(subscription, Subscription): subscription = self.get_subscription(subscription) diff --git a/modules/gdfsuez/browser.py b/modules/gdfsuez/browser.py index d000267d..eba8fb97 100644 --- a/modules/gdfsuez/browser.py +++ b/modules/gdfsuez/browser.py @@ -44,11 +44,11 @@ class GdfSuez(BaseBrowser): def home(self): self.location(self.homep) - def is_logged(self): + def is_logged(self): if self.is_on_page(LoginPage) or self.is_on_page(TimeoutPage): return False return True - + def login(self): assert isinstance(self.username, basestring) assert isinstance(self.password, basestring) diff --git a/modules/gdfsuez/pages/history.py b/modules/gdfsuez/pages/history.py index 270d0b6a..63fe7b52 100644 --- a/modules/gdfsuez/pages/history.py +++ b/modules/gdfsuez/pages/history.py @@ -23,7 +23,7 @@ import subprocess import tempfile import shutil -from datetime import datetime, date +from datetime import date from decimal import Decimal from weboob.tools.browser import BasePage @@ -60,14 +60,14 @@ class HistoryPage(BasePage): def _create_bill(self, date, price, link): bill = Bill() - bill.id = date.__str__().replace('-', '') + bill.id = date.__str__().replace('-', '') bill.date = date bill._price = price bill._url = link bill.format = u'pdf' bill.label = unicode(price) return bill - + def get_details(self): return self.details @@ -100,10 +100,8 @@ class PdfPage(): footnote = re.compile(r'\([0-9]\) ') # (f) ht = re.compile('HT par mois') base = re.compile('la base de') - begindate = re.compile(' \d\d\/\d\d ') # MM/DD enddate = re.compile('\d\d\/\d\d\/\d\d') # YY/MM/DD endwithdigit = re.compile('\d+$') # blah blah 42 - endwitheuro = re.compile('€$') # blah 00,00 € textwithcoma = re.compile('([a-z]|\d{4})\,') # blah 2012, blah blah # Parsing diff --git a/modules/gdfsuez/pages/homepage.py b/modules/gdfsuez/pages/homepage.py index 1f7fecab..dc908842 100644 --- a/modules/gdfsuez/pages/homepage.py +++ b/modules/gdfsuez/pages/homepage.py @@ -17,10 +17,9 @@ # You should have received a copy of the GNU Affero General Public License # along with weboob. If not, see . -from datetime import datetime, date +from datetime import date from weboob.tools.browser import BasePage -from weboob.tools.mech import ClientForm from weboob.capabilities.bill import Subscription __all__ = ['LoginPage', 'HomePage', 'AccountPage', 'TimeoutPage']