From b8227b69b1ac8097983d182639e76e3fe800c690 Mon Sep 17 00:00:00 2001 From: Florent Date: Tue, 8 Jan 2013 21:03:19 +0100 Subject: [PATCH] pep8 cleaning --- modules/freemobile/backend.py | 4 ---- modules/freemobile/pages/history.py | 9 ++++----- 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/modules/freemobile/backend.py b/modules/freemobile/backend.py index 3864ef2b..0cfbd86a 100644 --- a/modules/freemobile/backend.py +++ b/modules/freemobile/backend.py @@ -70,7 +70,6 @@ class FreeMobileBackend(BaseBackend, ICapBill): for history in self.browser.get_history(subscription): yield history - def get_bill(self, id): with self.browser: bill = self.browser.get_bill(id) @@ -79,7 +78,6 @@ class FreeMobileBackend(BaseBackend, ICapBill): else: raise BillNotFound() - def iter_bills(self, subscription): if not isinstance(subscription, Subscription): subscription = self.get_subscription(subscription) @@ -88,7 +86,6 @@ class FreeMobileBackend(BaseBackend, ICapBill): for bill in self.browser.iter_bills(subscription.id): yield bill - def get_details(self, subscription): if not isinstance(subscription, Subscription): subscription = self.get_subscription(subscription) @@ -97,7 +94,6 @@ class FreeMobileBackend(BaseBackend, ICapBill): for detail in self.browser.get_details(subscription): yield detail - def download_bill(self, bill): if not isinstance(bill, Bill): bill = self.get_bill(bill) diff --git a/modules/freemobile/pages/history.py b/modules/freemobile/pages/history.py index f1194264..ef2843ae 100644 --- a/modules/freemobile/pages/history.py +++ b/modules/freemobile/pages/history.py @@ -48,7 +48,6 @@ class DetailsPage(BasePage): virtualnumber = div.attrib['onclick'].split('(')[1][1] self.details['num' + str(phonenumber)] = virtualnumber - for div in self.document.xpath('//div[@class="infosConso"]'): num = div.attrib['id'].split('_')[1][0] self.details[num] = [] @@ -129,10 +128,10 @@ class DetailsPage(BasePage): mydate = div.xpath('span[@class="actif"]')[0].text mydate = date(*reversed([int(x) for x in mydate.split("/")])) if mydate.month == 12: - mydate = mydate.replace(month = 1) - mydate = mydate.replace(year= mydate.year + 1) + mydate = mydate.replace(month=1) + mydate = mydate.replace(year=mydate.year + 1) else: - mydate = mydate.replace(month = mydate.month + 1) + mydate = mydate.replace(month=mydate.month + 1) return mydate @@ -146,7 +145,7 @@ class HistoryPage(BasePage): self.calls = [] for tr in self.document.xpath('//tr'): tds = tr.xpath('td') - if tds[0].text == None or tds[0].text == "Date": + if tds[0].text is None or tds[0].text == "Date": pass else: detail = Detail()