Some pep8 cleaning

This commit is contained in:
Florent 2014-04-01 11:56:15 +02:00
commit 2ab48d4800
4 changed files with 10 additions and 16 deletions

View file

@ -19,9 +19,9 @@
from weboob.capabilities.bank import ICapBank, AccountNotFound,\ from weboob.capabilities.bank import ICapBank, AccountNotFound,\
Account, Recipient Account, Recipient
from weboob.capabilities.bill import ICapBill, Bill, Subscription,\ from weboob.capabilities.bill import ICapBill, Bill, Subscription,\
SubscriptionNotFound, BillNotFound SubscriptionNotFound, BillNotFound
from weboob.capabilities.base import UserError from weboob.capabilities.base import UserError
from weboob.tools.backend import BaseBackend, BackendConfig from weboob.tools.backend import BaseBackend, BackendConfig
from weboob.tools.value import ValueBackendPassword from weboob.tools.value import ValueBackendPassword
@ -48,7 +48,7 @@ class INGBackend(BaseBackend, ICapBank, ICapBill):
label='Date de naissance', label='Date de naissance',
regexp='^(\d{8}|)$', regexp='^(\d{8}|)$',
masked=False) masked=False)
) )
BROWSER = IngBrowser BROWSER = IngBrowser
def create_default_browser(self): def create_default_browser(self):

View file

@ -22,10 +22,8 @@ from weboob.tools.browser2 import LoginBrowser, URL, need_login
from weboob.tools.browser import BrowserIncorrectPassword from weboob.tools.browser import BrowserIncorrectPassword
from weboob.capabilities.bank import Account, TransferError from weboob.capabilities.bank import Account, TransferError
from .pages import AccountsList, LoginPage, \ from .pages import AccountsList, LoginPage, TitrePage, TitreHistory,\
TransferPage, TransferConfirmPage, \ TransferPage, TransferConfirmPage, BillsPage, StopPage
BillsPage, StopPage, TitrePage, \
TitreHistory
__all__ = ['IngBrowser'] __all__ = ['IngBrowser']
@ -51,7 +49,6 @@ class IngBrowser(LoginBrowser):
titrehistory = URL('https://bourse.ingdirect.fr/priv/compte.php\?ong=3', TitreHistory) titrehistory = URL('https://bourse.ingdirect.fr/priv/compte.php\?ong=3', TitreHistory)
titrerealtime = URL('https://bourse.ingdirect.fr/streaming/compteTempsReelCK.php', TitrePage) titrerealtime = URL('https://bourse.ingdirect.fr/streaming/compteTempsReelCK.php', TitrePage)
# CapBill # CapBill
billpage = URL('/protected/pages/common/estatement/eStatement.jsf', BillsPage) billpage = URL('/protected/pages/common/estatement/eStatement.jsf', BillsPage)
@ -121,7 +118,7 @@ class IngBrowser(LoginBrowser):
self.logger.info('There is no history for this account') self.logger.info('There is no history for this account')
return return
index = 0 # index, we get always the same page, but with more informations index = 0 # index, we get always the same page, but with more informations
hashlist = [] hashlist = []
while True: while True:
i = index i = index
@ -198,7 +195,6 @@ class IngBrowser(LoginBrowser):
self.where = "titre" self.where = "titre"
self.titrepage.go() self.titrepage.go()
def get_investments(self, account): def get_investments(self, account):
if account.type != Account.TYPE_MARKET: if account.type != Account.TYPE_MARKET:
raise NotImplementedError() raise NotImplementedError()
@ -212,7 +208,6 @@ class IngBrowser(LoginBrowser):
self.titrehistory.go() self.titrehistory.go()
return self.page.iter_history() return self.page.iter_history()
############# CapBill ############# ############# CapBill #############
@need_login @need_login
def get_subscriptions(self): def get_subscriptions(self):
@ -227,7 +222,7 @@ class IngBrowser(LoginBrowser):
"autoScroll": "", "autoScroll": "",
"javax.faces.ViewState": subscription._javax, "javax.faces.ViewState": subscription._javax,
"transfer_issuer_radio": subscription.id "transfer_issuer_radio": subscription.id
} }
self.billpage.go(data=data) self.billpage.go(data=data)
return self.page.iter_bills(subid=subscription.id) return self.page.iter_bills(subid=subscription.id)

View file

@ -25,6 +25,7 @@ from weboob.tools.browser2.page import ListElement, ItemElement, method
__all__ = ['BillsPage'] __all__ = ['BillsPage']
class FormId(Filter): class FormId(Filter):
def filter(self, txt): def filter(self, txt):
formid = txt.split("parameters")[1] formid = txt.split("parameters")[1]
@ -45,7 +46,6 @@ class BillsPage(LoggedPage, HTMLPage):
obj_label = CleanText('label') obj_label = CleanText('label')
obj__formid = FormId(Attr('input', 'onclick')) obj__formid = FormId(Attr('input', 'onclick'))
def postpredown(self, _id): def postpredown(self, _id):
_id = _id.split("'")[5] _id = _id.split("'")[5]
form = self.get_form(name="statements_form") form = self.get_form(name="statements_form")
@ -60,8 +60,7 @@ class BillsPage(LoggedPage, HTMLPage):
class item(ItemElement): class item(ItemElement):
klass = Bill klass = Bill
def condition(self): condition = lambda self: not (u"tous les relev" in CleanText('a[1]')(self.el))
return not (u"tous les relev" in CleanText('a[1]')(self.el))
obj_label = CleanText('a[1]', replace=[(' ', '-')]) obj_label = CleanText('a[1]', replace=[(' ', '-')])
obj_id = Format(u"%s-%s", Env('subid'), Field('label')) obj_id = Format(u"%s-%s", Env('subid'), Field('label'))

View file

@ -39,7 +39,7 @@ class INGVirtKeyboard(VirtKeyboard):
'7': 'fb495b5cf7f46201af0b4977899b56d4', '7': 'fb495b5cf7f46201af0b4977899b56d4',
'8': 'e8fea1e1aa86f8fca7f771db9a1dca4d', '8': 'e8fea1e1aa86f8fca7f771db9a1dca4d',
'9': '82e63914f2e52ec04c11cfc6fecf7e08' '9': '82e63914f2e52ec04c11cfc6fecf7e08'
} }
color = 64 color = 64
def __init__(self, basepage): def __init__(self, basepage):