sgpe: Can login

This commit is contained in:
Laurent Bachelier 2013-07-19 19:03:13 +02:00 committed by Romain Bignon
commit 23c0954353
4 changed files with 169 additions and 4 deletions

View file

@ -23,9 +23,10 @@ from __future__ import with_statement
from weboob.capabilities.bank import ICapBank, AccountNotFound
from weboob.tools.backend import BaseBackend, BackendConfig
from weboob.tools.value import ValueBackendPassword
from weboob.tools.value import Value, ValueBackendPassword
from .browser import SocieteGenerale
from .sgpe.browser import SGEnterpriseBrowser, SGProfessionalBrowser
__all__ = ['SocieteGeneraleBackend']
@ -38,11 +39,15 @@ class SocieteGeneraleBackend(BaseBackend, ICapBank):
VERSION = '0.g'
LICENSE = 'AGPLv3+'
DESCRIPTION = u'Société Générale French bank website'
CONFIG = BackendConfig(ValueBackendPassword('login', label='Account ID', masked=False),
ValueBackendPassword('password', label='Password'))
BROWSER = SocieteGenerale
CONFIG = BackendConfig(
ValueBackendPassword('login', label='Account ID', masked=False),
ValueBackendPassword('password', label='Password'),
Value('website', label='Website to use', default='par',
choices={'par': 'Particuliers', 'pro': 'Professionnels', 'ent': 'Entreprises'}))
def create_default_browser(self):
b = {'par': SocieteGenerale, 'pro': SGProfessionalBrowser, 'ent': SGEnterpriseBrowser}
self.BROWSER = b[self.config['website'].get()]
return self.create_browser(self.config['login'].get(),
self.config['password'].get())