The new woob repository is here: https://gitlab.com/woob/woob. This gitlab will be removed soon.

The new woob repository is here: https://gitlab.com/woob/woob. This gitlab will be removed soon.

Commit 8c512c7f authored by Nicolas Gattolin's avatar Nicolas Gattolin Committed by Romain Bignon

[bouygues] py3 compat (already compatible)

parent 8a961d56
......@@ -37,21 +37,21 @@ class BouyguesBrowser(LoginBrowser):
BASEURL = 'https://api.bouyguestelecom.fr'
TIMEOUT = 20
login = URL('https://www.mon-compte.bouyguestelecom.fr/cas/login', LoginPage)
home = URL('https://www.bouyguestelecom.fr/mon-compte', HomePage)
subscriber = URL('/personnes/(?P<idUser>\d+)$', SubscriberPage)
subscriptions = URL('/personnes/(?P<idUser>\d+)/comptes-facturation', SubscriptionPage)
subscriptions_details = URL('/comptes-facturation/(?P<idSub>\d+)/contrats-payes', SubscriptionDetailPage)
document_file = URL('/comptes-facturation/(?P<idSub>\d+)/factures/\d+/documents', DocumentFilePage)
documents = URL('/comptes-facturation/(?P<idSub>\d+)/factures', DocumentsPage)
sms_page = URL('http://www.mobile.service.bbox.bouyguestelecom.fr/services/SMSIHD/sendSMS.phtml',
'http://www.mobile.service.bbox.bouyguestelecom.fr/services/SMSIHD/confirmSendSMS.phtml',
login = URL(r'https://www.mon-compte.bouyguestelecom.fr/cas/login', LoginPage)
home = URL(r'https://www.bouyguestelecom.fr/mon-compte', HomePage)
subscriber = URL(r'/personnes/(?P<idUser>\d+)$', SubscriberPage)
subscriptions = URL(r'/personnes/(?P<idUser>\d+)/comptes-facturation', SubscriptionPage)
subscriptions_details = URL(r'/comptes-facturation/(?P<idSub>\d+)/contrats-payes', SubscriptionDetailPage)
document_file = URL(r'/comptes-facturation/(?P<idSub>\d+)/factures/\d+/documents', DocumentFilePage)
documents = URL(r'/comptes-facturation/(?P<idSub>\d+)/factures', DocumentsPage)
sms_page = URL(r'http://www.mobile.service.bbox.bouyguestelecom.fr/services/SMSIHD/sendSMS.phtml',
r'http://www.mobile.service.bbox.bouyguestelecom.fr/services/SMSIHD/confirmSendSMS.phtml',
SendSMSPage)
confirm = URL('http://www.mobile.service.bbox.bouyguestelecom.fr/services/SMSIHD/resultSendSMS.phtml', UselessPage)
sms_error_page = URL('http://www.mobile.service.bbox.bouyguestelecom.fr/services/SMSIHD/SMS_erreur.phtml',
confirm = URL(r'http://www.mobile.service.bbox.bouyguestelecom.fr/services/SMSIHD/resultSendSMS.phtml', UselessPage)
sms_error_page = URL(r'http://www.mobile.service.bbox.bouyguestelecom.fr/services/SMSIHD/SMS_erreur.phtml',
SendSMSErrorPage)
profile = URL('/personnes/(?P<idUser>\d+)/coordonnees', ProfilePage)
profile = URL(r'/personnes/(?P<idUser>\d+)/coordonnees', ProfilePage)
def __init__(self, username, password, lastname, *args, **kwargs):
super(BouyguesBrowser, self).__init__(username, password, *args, **kwargs)
......
......@@ -34,7 +34,7 @@
class BouyguesModule(Module, CapMessages, CapMessagesPost, CapDocument, CapProfile):
NAME = 'bouygues'
MAINTAINER = u'Bezleputh'
MAINTAINER = 'Bezleputh'
EMAIL = 'carton_ben@yahoo.fr'
VERSION = '1.4'
DESCRIPTION = u'Bouygues Télécom French mobile phone provider'
......@@ -49,7 +49,7 @@ def create_default_browser(self):
def post_message(self, message):
if not message.content.strip():
raise CantSendMessage(u'Message content is empty.')
raise CantSendMessage('Message content is empty.')
self.browser.post_message(message)
def iter_subscription(self):
......
......@@ -16,6 +16,8 @@
# You should have received a copy of the GNU Affero General Public License
# along with weboob. If not, see <http://www.gnu.org/licenses/>.
from __future__ import unicode_literals
import re
from datetime import datetime, timedelta
......@@ -88,7 +90,7 @@ def get_label(self):
class SendSMSPage(HTMLPage):
def send_sms(self, message, receivers):
sms_number = CleanDecimal(Regexp(CleanText('//span[@class="txt12-o"][1]/strong'), '(\d*) SMS.*'))(self.doc)
sms_number = CleanDecimal(Regexp(CleanText('//span[@class="txt12-o"][1]/strong'), r'(\d*) SMS.*'))(self.doc)
if sms_number == 0:
msg = CleanText('//span[@class="txt12-o"][1]')(self.doc)
......@@ -133,11 +135,11 @@ class item(ItemElement):
obj_url = Format('https://api.bouyguestelecom.fr%s', Dict('_links/facturePDF/href'))
obj_date = Env('date')
obj_duedate = Env('duedate')
obj_format = u"pdf"
obj_format = "pdf"
obj_label = Env('label')
obj_type = u"bill"
obj_type = "bill"
obj_price = CleanDecimal(Dict('mntTotFacture'))
obj_currency = u'EUR'
obj_currency = 'EUR'
def parse(self, el):
bill_date = datetime.strptime(Dict('dateFacturation')(self), "%Y-%m-%dT%H:%M:%SZ").date()
......
......@@ -30,6 +30,7 @@ bnporc
bnppere
bolden
boursorama
bouygues
bp
bred
btmon
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment