Fix obvious pep8 errors
This commit is contained in:
parent
2a7f373168
commit
a155337b4f
3 changed files with 18 additions and 16 deletions
|
|
@ -24,6 +24,7 @@ from .pages import LoginPage, HomePage, AccountPage, LastPaymentsPage, PaymentDe
|
|||
|
||||
__all__ = ['AmeliBrowser']
|
||||
|
||||
|
||||
class AmeliBrowser(BaseBrowser):
|
||||
PROTOCOL = 'https'
|
||||
DOMAIN = 'assure.ameli.fr'
|
||||
|
|
|
|||
|
|
@ -31,10 +31,12 @@ __all__ = ['AmeliBasePage', 'LoginPage', 'HomePage', 'AccountPage', 'LastPayment
|
|||
# Ugly array to avoid the use of french locale
|
||||
FRENCH_MONTHS = [u'janvier', u'février', u'mars', u'avril', u'mai', u'juin', u'juillet', u'août', u'septembre', u'octobre', u'novembre', u'décembre']
|
||||
|
||||
|
||||
class AmeliBasePage(BasePage):
|
||||
def is_logged(self):
|
||||
return len(self.document.xpath('//a[@id="logout"]')) > 0
|
||||
|
||||
|
||||
class LoginPage(AmeliBasePage):
|
||||
def login(self, login, password):
|
||||
self.browser.select_form('connexionCompteForm')
|
||||
|
|
@ -42,8 +44,8 @@ class LoginPage(AmeliBasePage):
|
|||
self.browser["connexioncompte_2codeConfidentiel"] = password.encode('utf8')
|
||||
self.browser.submit()
|
||||
|
||||
class HomePage(AmeliBasePage):
|
||||
|
||||
class HomePage(AmeliBasePage):
|
||||
def on_loaded(self):
|
||||
pass
|
||||
|
||||
|
|
@ -70,8 +72,8 @@ class AccountPage(AmeliBasePage):
|
|||
sub.subscriber = unicode(name)
|
||||
yield sub
|
||||
|
||||
class LastPaymentsPage(AmeliBasePage):
|
||||
|
||||
class LastPaymentsPage(AmeliBasePage):
|
||||
def iter_last_payments(self):
|
||||
list_table = self.document.xpath('//table[@id="ligneTabDerniersPaiements"]')
|
||||
if len(list_table) > 0:
|
||||
|
|
@ -82,8 +84,8 @@ class LastPaymentsPage(AmeliBasePage):
|
|||
continue
|
||||
yield list_a[0].attrib.get('href')
|
||||
|
||||
class PaymentDetailsPage(AmeliBasePage):
|
||||
|
||||
class PaymentDetailsPage(AmeliBasePage):
|
||||
def iter_payment_details(self, sub):
|
||||
if sub._id.isdigit():
|
||||
idx = 0
|
||||
|
|
@ -100,7 +102,7 @@ class PaymentDetailsPage(AmeliBasePage):
|
|||
line = 1
|
||||
last_date = None
|
||||
for tr in table:
|
||||
tds = tr.xpath('.//td');
|
||||
tds = tr.xpath('.//td')
|
||||
if len(tds) == 0:
|
||||
continue
|
||||
date_str = tds[0].text
|
||||
|
|
@ -118,8 +120,8 @@ class PaymentDetailsPage(AmeliBasePage):
|
|||
line = line + 1
|
||||
yield det
|
||||
|
||||
class BillsPage(AmeliBasePage):
|
||||
|
||||
class BillsPage(AmeliBasePage):
|
||||
def iter_bills(self, sub):
|
||||
table = self.document.xpath('//table[@id="tableauDecompte"]')[0].xpath('.//tr')
|
||||
for tr in table:
|
||||
|
|
@ -145,4 +147,3 @@ class BillsPage(AmeliBasePage):
|
|||
|
||||
def get_bill(self, bill):
|
||||
self.location(bill._url, urllib.urlencode(bill._args))
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue