/modules/btpbanque/module.py

https://github.com/laurentb/weboob · Python · 52 lines · 26 code · 9 blank · 17 comment · 0 complexity · 65d1cc7f09c780ce2f29a2f34507b947 MD5 · raw file

  1. # -*- coding: utf-8 -*-
  2. # Copyright(C) 2016 Edouard Lambert
  3. #
  4. # This file is part of a weboob module.
  5. #
  6. # This weboob module is free software: you can redistribute it and/or modify
  7. # it under the terms of the GNU Lesser General Public License as published by
  8. # the Free Software Foundation, either version 3 of the License, or
  9. # (at your option) any later version.
  10. #
  11. # This weboob module is distributed in the hope that it will be useful,
  12. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. # GNU Lesser General Public License for more details.
  15. #
  16. # You should have received a copy of the GNU Lesser General Public License
  17. # along with this weboob module. If not, see <http://www.gnu.org/licenses/>.
  18. from weboob.capabilities.bank import CapBank
  19. from weboob.tools.backend import AbstractModule, BackendConfig
  20. from weboob.tools.value import ValueBackendPassword, Value
  21. from .proxy_browser import ProxyBrowser
  22. __all__ = ['BtpbanqueModule']
  23. class BtpbanqueModule(AbstractModule, CapBank):
  24. NAME = 'btpbanque'
  25. DESCRIPTION = u'BTP Banque'
  26. MAINTAINER = u'Edouard Lambert'
  27. EMAIL = 'elambert@budget-insight.com'
  28. VERSION = '2.1'
  29. LICENSE = 'LGPLv3+'
  30. auth_type = {'weak' : "Code confidentiel (pro)",
  31. 'strong': "Sesame (pro)"}
  32. CONFIG = BackendConfig(Value('auth_type', label='Type de compte', choices=auth_type, default="weak"),
  33. ValueBackendPassword('login', label='Code utilisateur', masked=False),
  34. ValueBackendPassword('password', label='Code confidentiel ou code PIN', regexp='\d+'),
  35. Value('nuser', label="Numéro d'utilisateur (optionnel)", regexp='\d{0,8}', default=''))
  36. PARENT = 'caissedepargne'
  37. BROWSER = ProxyBrowser
  38. def create_default_browser(self):
  39. return self.create_browser(nuser=self.config['nuser'].get(),
  40. username=self.config['login'].get(),
  41. password=self.config['password'].get(),
  42. domain='www.btp-banque.fr',
  43. weboob=self.weboob)