[bouygues] rewrite backend using browser2 (fix #1970 and #1978)

This commit is contained in:
Bezleputh 2015-06-17 17:49:21 +02:00
commit e8e7e60a50
7 changed files with 93 additions and 126 deletions

View file

@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
# Copyright(C) 2010-2011 Christophe Benz
# Copyright(C) 2010-2015 Bezleputh
#
# This file is part of weboob.
#
@ -30,15 +30,14 @@ __all__ = ['BouyguesModule']
class BouyguesModule(Module, CapMessages, CapMessagesPost):
NAME = 'bouygues'
MAINTAINER = u'Christophe Benz'
EMAIL = 'christophe.benz@gmail.com'
MAINTAINER = u'Bezleputh'
EMAIL = 'carton_ben@yahoo.fr'
VERSION = '1.1'
DESCRIPTION = u'Bouygues Télécom French mobile phone provider'
LICENSE = 'AGPLv3+'
CONFIG = BackendConfig(Value('login', label='Login'),
CONFIG = BackendConfig(Value('login', label='Login/Phone number'),
ValueBackendPassword('password', label='Password'))
BROWSER = BouyguesBrowser
ACCOUNT_REGISTER_PROPERTIES = None
def create_default_browser(self):
return self.create_browser(self.config['login'].get(), self.config['password'].get())
@ -46,5 +45,4 @@ class BouyguesModule(Module, CapMessages, CapMessagesPost):
def post_message(self, message):
if not message.content.strip():
raise CantSendMessage(u'Message content is empty.')
with self.browser:
self.browser.post_message(message)
self.browser.post_message(message)