implement StatusField in sfr backend
This commit is contained in:
parent
27e337d520
commit
b24b40ac98
4 changed files with 34 additions and 3 deletions
|
|
@ -20,6 +20,7 @@ import re
|
|||
|
||||
from weboob.capabilities.messages import CantSendMessage
|
||||
from weboob.tools.browser import BasePage
|
||||
from weboob.tools.parsers.lxmlparser import select, SelectElementException
|
||||
|
||||
|
||||
__all__ = ['ClosePage', 'ComposePage', 'ConfirmPage', 'SentPage']
|
||||
|
|
@ -32,6 +33,11 @@ class ClosePage(BasePage):
|
|||
class ComposePage(BasePage):
|
||||
phone_regex = re.compile('^(\+33|0033|0)(6|7)(\d{8})$')
|
||||
|
||||
def get_nb_remaining_free_sms(self):
|
||||
remaining_regex = re.compile(u'Il vous reste (?P<nb>.+) Texto gratuits vers les numéros SFR à envoyer aujourd\'hui')
|
||||
text = select(self.document.getroot(), '#smsReminder', 1).text.strip()
|
||||
return remaining_regex.match(text).groupdict().get('nb')
|
||||
|
||||
def post_message(self, message):
|
||||
receiver_list = [receiver.strip() for receiver in message.receiver.split(',')]
|
||||
for receiver in receiver_list:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue