Пример #1
0
 def get_subscription_list(self):
     me = self.request('user')['user']
     sub = Subscription()
     sub.subscriber = '%s %s' % (me['first_name'], me['last_name'])
     sub.id = me['id']
     sub.label = me['email']
     yield sub
Пример #2
0
    def get_list(self):
        l = []
        divabo = self.document.xpath('//div[@id="accountSummary"]')[0]
        owner = divabo.xpath('a/h3')[0].text
        phone = divabo.xpath('dl/dd')[0].text
        credit = divabo.xpath('dl/dd')[1].text
        expiredate = divabo.xpath('dl/dd')[2].text
        phoneplan = divabo.xpath('dl/dd')[3].text
        self.browser.logger.debug('Found ' + owner + ' as subscriber')
        self.browser.logger.debug('Found ' + phone + ' as phone number')
        self.browser.logger.debug('Found ' + credit + ' as available credit')
        self.browser.logger.debug('Found ' + expiredate + ' as expire date ')
        self.browser.logger.debug('Found %s as subscription type', phoneplan)

        subscription = Subscription(phone)
        subscription.label = unicode(u'%s - %s - %s - %s' %
                (phone, credit, phoneplan, expiredate))
        subscription.subscriber = unicode(owner)
        expiredate = date(*reversed([int(x) for x in expiredate.split(".")]))
        subscription.validity = expiredate
        subscription._balance = Decimal(FrenchTransaction.clean_amount(credit))

        l.append(subscription)

        return l
Пример #3
0
 def get_subscription_list(self):
     me = self.request('user')['user']
     sub = Subscription()
     sub.subscriber = '%s %s' % (me['first_name'], me['last_name'])
     sub.id = me['id']
     sub.label = me['email']
     yield sub
Пример #4
0
    def iter_subscription_list(self):
        fullname = CleanText('//div[@id="bloc_contenu_masituation"]/h3',
                             replace=[('Titulaire du compte : ', '')
                                      ])(self.doc)
        number = re.sub(
            '[^\d]+', '',
            self.doc.xpath('//div[@id="bloc_contenu_masituation"]/ul/li')
            [2].text)
        sub = Subscription(number)
        sub._id = number
        sub.label = unicode(fullname)
        firstname = Regexp(RawText('//div[@id="bloc_contenu_masituation"]/h3'),
                           '\t([^\xa0\t]+)\xa0[^:]')(self.doc)
        sub.subscriber = unicode(firstname)
        yield sub

        nb_childs = 0
        childs = self.doc.xpath('//div[@class="bloc_infos"]')
        for child in childs:
            fullname = CleanText('.//h3[1]')(child)
            nb_childs = nb_childs + 1
            number = "AFFILIE" + str(nb_childs)
            sub = Subscription(number)
            sub._id = number
            sub.label = unicode(fullname)
            firstname = Regexp(RawText('./h3'),
                               '\t([^\xa0\t]+)\xa0[^:]')(child)
            sub.subscriber = unicode(firstname)
            yield sub
Пример #5
0
    def get_list(self):
        for divglobal in self.document.xpath('//div[@class="abonne"]'):
            for link in divglobal.xpath('.//div[@class="acceuil_btn"]/a'):
                login = link.attrib['href'].split('=').pop()
                if login.isdigit():
                    break
            divabo = divglobal.xpath('div[@class="idAbonne pointer"]')[0]
            owner = unicode(divabo.xpath('p')[0].text.replace(' - ', ''))
            phone = unicode(divabo.xpath('p/span')[0].text)
            self.browser.logger.debug('Found ' + login +
                                      ' as subscription identifier')
            self.browser.logger.debug('Found ' + owner + ' as subscriber')
            self.browser.logger.debug('Found ' + phone + ' as phone number')
            phoneplan = unicode(
                self.document.xpath('//div[@class="forfaitChoisi"]')
                [0].text.lstrip().rstrip())
            self.browser.logger.debug('Found ' + phoneplan +
                                      ' as subscription type')

            subscription = Subscription(phone)
            subscription.label = phone + ' - ' + phoneplan
            subscription.subscriber = owner
            subscription._login = login

            yield subscription
Пример #6
0
    def iter_subscription(self):
        for account in self.doc.xpath(
                '//select[@name="compteSelected"]/option'):
            s = Subscription()
            s.id = CleanText('.', replace=[(' ', '')])(account)

            yield s
Пример #7
0
    def get_subscription(self):
        user = self.doc['user']
        sub = Subscription()
        sub.subscriber = '%s %s' % (user['first_name'], user['last_name'])
        sub.id = user['id']
        sub.label = user['email']

        return sub
Пример #8
0
    def get_list(self):
        sub = Subscription()

        sub.subscriber = self.browser.username
        sub.id = sub.subscriber
        sub.label = sub.subscriber

        yield sub
Пример #9
0
    def get_list(self):
        spanabo = self.document.xpath('//span[@class="welcome-text"]/b')[0]
        owner = spanabo.text_content()
        credit = self.document.xpath('//span[@class="balance"]')[0].text_content()

        subscription = Subscription(owner)
        subscription.label = u"Poivy - %s - %s" % (owner, credit)
        subscription._balance = Decimal(re.sub(u'[^\d\-\.]', '', credit))

        return [subscription]
Пример #10
0
 def iter_subscription_list(self):
     names_list = self.doc.xpath('//span[@class="NomEtPrenomLabel"]')
     fullname = CleanText(newlines=True).filter(names_list[0])
     number = re.sub('[^\d]+', '', CleanText('//span[@class="blocNumSecu"]', replace=[(' ','')])(self.doc))
     sub = Subscription(number)
     sub._id = number
     sub.label = fullname
     firstname = CleanText('//span[@class="prenom-titulaire"]')(self.doc)
     sub.subscriber = firstname
     yield sub
Пример #11
0
    def iter_subscription(self):
        self.employees.go()

        s = Subscription()
        s.label = "Attestations fiscales"
        s.id = "taxcertificates"
        s._type = s.id
        yield s

        for sub in self.page.iter_subscriptions(subscriber=None):
            yield sub
Пример #12
0
 def get_subscription_list(self):
     ident = self.document.xpath('//div[@id="identification"]')[0]
     prof = self.document.xpath('//div[@id="profession"]')[0]
     name = ident.xpath('//p/b')[0].text.replace(' ', ' ').strip()
     number = ident.xpath('//p')[1].text.replace('Cabinet', '').strip()
     label = prof.xpath('//div[@class="zoneTexte"]')[0].text.strip()
     sub = Subscription(number)
     sub._id = number
     sub.label = unicode(name) + ' ' + unicode(label)
     sub.subscriber = unicode(name)
     return sub
Пример #13
0
    def iter_account(self):
        ul = self.document.xpath('//ul[@id="accountsel_form:accountsel"]')
        #subscriber = unicode(self.document.find('//h5').text)
        for li in ul[0].xpath('li/a'):
            label = li.text
            id = label.split(' ')[-1]
            subscription = Subscription(id)
            subscription.label = label
#            subscription.subscriber = subscriber
            subscription._localid = li.attrib['id']
            yield subscription
Пример #14
0
 def iter_account(self):
     ul = self.document.xpath('//ul[@id="accountsel_form:accountsel"]')
     #subscriber = unicode(self.document.find('//h5').text)
     for li in ul[0].xpath('li/a'):
         label = li.text
         id = label.split(' ')[-1]
         subscription = Subscription(id)
         subscription.label = label
         #            subscription.subscriber = subscriber
         subscription._localid = li.attrib['id']
         yield subscription
Пример #15
0
    def get_list(self):
        spanabo = self.document.xpath('//span[@class="welcome-text"]/b')[0]
        owner = spanabo.text_content()
        credit = self.document.xpath(
            '//span[@class="balance"]')[0].text_content()

        subscription = Subscription(owner)
        subscription.label = u"Poivy - %s - %s" % (owner, credit)
        subscription._balance = Decimal(re.sub(u'[^\d\-\.]', '', credit))

        return [subscription]
Пример #16
0
 def iter_subscription_list(self):
     ident = self.doc.xpath('//div[@id="identification"]')[0]
     prof = self.doc.xpath('//div[@id="profession"]')[0]
     name = ident.xpath('//p/b')[0].text.replace(' ', ' ').strip()
     number = ident.xpath('//p')[1].text.replace('Cabinet', '').strip()
     label = prof.xpath('//div[@class="zoneTexte"]')[0].text.strip()
     sub = Subscription(number)
     sub._id = number
     sub.label = unicode(name) + ' ' + unicode(label)
     sub.subscriber = unicode(name)
     return sub
Пример #17
0
    def get_subscription(self):
        sub = Subscription()
        # DON'T TAKE social security number for id because it's a very confidential data, take birth date instead
        sub.id = CleanText(
            '//button[@id="idAssure"]//td[@class="dateNaissance"]')(
                self.doc).replace('/', '')
        sub.label = sub.subscriber = CleanText(
            '//div[@id="pageAssure"]//span[@class="NomEtPrenomLabel"]')(
                self.doc)

        return sub
Пример #18
0
 def iter_subscription_list(self):
     boxHeader = self.document.xpath('//div[@class="boxHeader"]')[0]
     subscriber = self.parser.tocleanstring(boxHeader.xpath('.//p')[0])
     contract = self.parser.tocleanstring(boxHeader.xpath('.//p[@class="folderNumber"]')[0])
     if not re.search('^Contrat n\xb0\s*', contract):
         return
     contract = re.sub('Contrat n\xb0\s*', '', contract)
     number = re.sub('[^\d]', '', contract)
     sub = Subscription(number)
     sub._id = number
     sub.label = subscriber
     sub.subscriber = subscriber
     yield sub
Пример #19
0
    def get_list(self):
        l = []
        phone = unicode(self.document.xpath('//span[@id="ctl00_ctl00_cMain_cEspCli_lblMsIsdn"]')[0].text.replace(' ', ''))
        self.browser.logger.debug('Found ' + phone + ' has phone number')
        phoneplan = unicode(self.document.xpath('//span[@id="ctl00_ctl00_cMain_cEspCli_aoaOffreActuelle_aooOffreEtOptions"]/dl/dd/span')[0].text)
        self.browser.logger.debug('Found ' + phoneplan + ' has subscription type')

        subscription = Subscription(phone)
        subscription.label = phone + ' - ' + phoneplan

        l.append(subscription)

        return l
Пример #20
0
 def iter_subscription_list(self):
     names_list = self.doc.xpath('//span[@class="NomEtPrenomLabel"]')
     fullname = CleanText(newlines=True).filter(names_list[0])
     number = re.sub(
         '[^\d]+', '',
         CleanText('//span[@class="blocNumSecu"]',
                   replace=[(' ', '')])(self.doc))
     sub = Subscription(number)
     sub._id = number
     sub.label = unicode(fullname)
     firstname = CleanText('//span[@class="prenom-titulaire"]')(self.doc)
     sub.subscriber = unicode(firstname)
     yield sub
Пример #21
0
 def iter_subscription_list(self):
     boxHeader = self.document.xpath('//div[@class="boxHeader"]')[0]
     subscriber = self.parser.tocleanstring(boxHeader.xpath('.//p')[0])
     contract = self.parser.tocleanstring(boxHeader.xpath('.//p[@class="folderNumber"]')[0])
     if not re.search('^Contrat n\xb0\s*', contract):
         return
     contract = re.sub('Contrat n\xb0\s*', '', contract)
     number = re.sub('[^\d]', '', contract)
     sub = Subscription(number)
     sub._id = number
     sub.label = subscriber
     sub.subscriber = subscriber
     yield sub
Пример #22
0
    def iter_subscription(self):
        self.employees.go(employer=self.employer)

        for sub in self.page.iter_subscriptions(subscriber=None):
            yield sub

        s = Subscription()
        s.label = "Prélèvements"
        s.id = "prelevements"
        s._type = s.id
        yield s

        s = Subscription()
        s.label = "Attestations fiscales"
        s.id = "taxcertificates"
        s._type = s.id
        yield s
Пример #23
0
 def iter_account(self):
     ul = self.document.xpath('//ul[@class="unstyled striped"]')
     javax = self.document.xpath("//form[@id='accountsel_form']/input[@name='javax.faces.ViewState']")
     javax = javax[0].attrib['value']
     #subscriber = unicode(self.document.find('//h5').text)
     for li in ul[0].xpath('li'):
         inputs = li.xpath('input')[0]
         label = li.xpath('label')[0]
         label = unicode(label.text)
         formid = inputs.attrib['onclick']
         formid = formid.split("parameters")[1]
         formid = formid.split("'")[2]
         id = inputs.attrib['value']
         subscription = Subscription(id)
         subscription.label = label
         subscription._formid = formid
         subscription._javax = javax
         yield subscription
Пример #24
0
    def iter_subscription_list(self):
        idents = self.document.xpath('//div[contains(@class, "blocfond")]')
        enfants = 0
        for ident in idents:
            if len(ident.xpath('.//h4')) == 0:
                continue

            name = self.parser.tocleanstring(ident.xpath('.//h4')[0])
            lis = ident.xpath('.//li')
            if len(lis) > 3:
                number = re.sub('[^\d]+', '', ident.xpath('.//li')[3].text)
            else:
                enfants = enfants + 1
                number = "AFFILIE" + str(enfants)
            sub = Subscription(number)
            sub._id = number
            sub.label = unicode(name)
            sub.subscriber = unicode(name)
            yield sub
Пример #25
0
    def iter_subscription_list(self):
        idents = self.document.xpath('//div[contains(@class, "blocfond")]')
        enfants = 0
        for ident in idents:
            if len(ident.xpath('.//h3')) == 0:
                continue

            name = self.parser.tocleanstring(ident.xpath('.//h3')[0])
            lis = ident.xpath('.//li')
            if len(lis) > 3:
                number = re.sub('[^\d]+', '', ident.xpath('.//li')[3].text)
            else:
                enfants = enfants + 1
                number = "AFFILIE" + str(enfants)
            sub = Subscription(number)
            sub._id = number
            sub.label = unicode(name)
            sub.subscriber = unicode(name)
            yield sub
Пример #26
0
 def iter_account(self):
     ul = self.document.xpath('//ul[@class="unstyled striped"]')
     javax = self.document.xpath(
         "//form[@id='accountsel_form']/input[@name='javax.faces.ViewState']"
     )
     javax = javax[0].attrib['value']
     #subscriber = unicode(self.document.find('//h5').text)
     for li in ul[0].xpath('li'):
         inputs = li.xpath('input')[0]
         label = li.xpath('label')[0]
         label = unicode(label.text)
         formid = inputs.attrib['onclick']
         formid = formid.split("parameters")[1]
         formid = formid.split("'")[2]
         id = inputs.attrib['value']
         subscription = Subscription(id)
         subscription.label = label
         subscription._formid = formid
         subscription._javax = javax
         yield subscription
Пример #27
0
 def get_subscription_list(self):
     table = self.document.xpath('//table[@id="ensemble_contrat_N0"]')[0]
     if len(table) > 0:
         # some clients may have subscriptions to gas and electricity,
         # but they receive a single bill
         # to avoid "boobill details" and "boobill bills" returning the same
         # table twice, we could return only one subscription for both.
         # We do not, and "boobill details" will take care of parsing only the
         # relevant section in the bill files.
         for line in table[0].xpath('//tbody/tr'):
             cells = line.xpath('td')
             snumber = cells[2].attrib['id'].replace('Contrat_', '')
             slabel = cells[0].xpath('a')[0].text.replace('offre', '').strip()
             d = unicode(cells[3].xpath('strong')[0].text.strip())
             sdate = date(*reversed([int(x) for x in d.split("/")]))
             sub = Subscription(snumber)
             sub._id = snumber
             sub.label = slabel
             sub.subscriber = unicode(cells[1])
             sub.renewdate = sdate
             yield sub
Пример #28
0
    def get_list(self):
        l = []
        divabo = self.document.xpath('//div[@id="accountSummary"]')[0]
        owner = divabo.xpath('a/h3')[0].text
        phone = divabo.xpath('dl/dd')[0].text
        credit = divabo.xpath('dl/dd')[1].text
        expiredate = divabo.xpath('dl/dd')[2].text
        phoneplan = divabo.xpath('dl/dd')[3].text
        self.browser.logger.debug('Found ' + owner + ' has subscriber')
        self.browser.logger.debug('Found ' + phone + ' has phone number')
        self.browser.logger.debug('Found ' + credit + ' has available credit')
        self.browser.logger.debug('Found ' + expiredate + 'has expire date ')
        self.browser.logger.debug('Found ' + phoneplan + ' has subscription type')

        subscription = Subscription(phone)
        subscription.label = unicode(phone + u' - ' + credit + u' - ' + expiredate + u' - ' + phoneplan)
        subscription.subscriber = owner

        l.append(subscription)

        return l
Пример #29
0
    def get_list(self):
        for divglobal in self.document.xpath('//div[@class="abonne"]'):
            for link in divglobal.xpath('//div[@class="acceuil_btn"]/a'):
                login = link.attrib['href'].split('=').pop()
                if login.isdigit():
                    break
            divabo = divglobal.xpath('div[@class="idAbonne pointer"]')[0]
            owner = unicode(divabo.xpath('p')[0].text.replace(' - ', ''))
            phone = unicode(divabo.xpath('p/span')[0].text)
            self.browser.logger.debug('Found ' + login + ' as subscription identifier')
            self.browser.logger.debug('Found ' + owner + ' as subscriber')
            self.browser.logger.debug('Found ' + phone + ' as phone number')
            phoneplan = unicode(self.document.xpath('//div[@class="forfaitChoisi"]')[0].text.lstrip().rstrip())
            self.browser.logger.debug('Found ' + phoneplan + ' as subscription type')

            subscription = Subscription(phone)
            subscription.label = phone + ' - ' + phoneplan
            subscription.subscriber = owner
            subscription._login = login

            yield subscription
Пример #30
0
    def get_list(self):
        l = []
        divabo = self.document.xpath('//div[@id="accountSummary"]')[0]
        owner = divabo.xpath('a/h3')[0].text
        phone = divabo.xpath('dl/dd')[0].text
        credit = divabo.xpath('dl/dd')[1].text
        expiredate = divabo.xpath('dl/dd')[2].text
        phoneplan = divabo.xpath('dl/dd')[3].text
        self.browser.logger.debug('Found ' + owner + ' as subscriber')
        self.browser.logger.debug('Found ' + phone + ' as phone number')
        self.browser.logger.debug('Found ' + credit + ' as available credit')
        self.browser.logger.debug('Found ' + expiredate + ' as expire date ')
        self.browser.logger.debug('Found %s as subscription type', phoneplan)

        subscription = Subscription(phone)
        subscription.label = unicode(u'%s - %s - %s - %s' %
                                     (phone, credit, phoneplan, expiredate))
        subscription.subscriber = unicode(owner)
        expiredate = date(*reversed([int(x) for x in expiredate.split(".")]))
        subscription.validity = expiredate
        subscription._balance = Decimal(FrenchTransaction.clean_amount(credit))

        l.append(subscription)

        return l
Пример #31
0
    def iter_subscription(self):
        acc_list = self.iter_accounts()

        for acc in acc_list:
            sub = Subscription()
            sub.label = acc.label
            sub.subscriber = acc._subscriber
            sub.id = acc.id
            # number is the hidden number of an account like "****1234"
            # and it's used in the parsing of the docs in iter_documents
            sub._number = acc.number
            # iduser is the ikpi affiliate to the account,
            # usefull for multi titulaires connexions
            sub._iduser = acc._iduser
            yield sub
Пример #32
0
    def iter_subscription_list(self):
        name = CleanText('//div[@id="bloc_contenu_masituation"]/h3', replace=[('Titulaire du compte : ', '')])(self.doc)
        number = re.sub('[^\d]+', '', self.doc.xpath('//div[@id="bloc_contenu_masituation"]/ul/li')[2].text)
        sub = Subscription(number)
        sub._id = number
        sub.label = unicode(name)
        sub.subscriber = unicode(name)
        yield sub

        nb_childs = 0
        childs = self.doc.xpath('//div[@class="bloc_infos"]')
        for child in childs:
            name = CleanText('.//h3[1]')(child)
            nb_childs = nb_childs + 1
            number = "AFFILIE" + str(nb_childs)
            sub = Subscription(number)
            sub._id = number
            sub.label = unicode(name)
            sub.subscriber = unicode(name)
            yield sub
Пример #33
0
 def get_subscription_list(self):
     table = self.document.xpath('//table[@id="ensemble_contrat_N0"]')[0]
     if len(table) > 0:
         # some clients may have subscriptions to gas and electricity,
         # but they receive a single bill
         # to avoid "boobill details" and "boobill bills" returning the same
         # table twice, we could return only one subscription for both.
         # We do not, and "boobill details" will take care of parsing only the
         # relevant section in the bill files.
         for line in table[0].xpath('//tbody/tr'):
             cells = line.xpath('td')
             snumber = cells[2].attrib['id'].replace('Contrat_', '')
             slabel = cells[0].xpath('a')[0].text.replace('offre',
                                                          '').strip()
             d = unicode(cells[3].xpath('strong')[0].text.strip())
             sdate = date(*reversed([int(x) for x in d.split("/")]))
             sub = Subscription(snumber)
             sub._id = snumber
             sub.label = slabel
             sub.subscriber = unicode(cells[1])
             sub.renewdate = sdate
             yield sub
Пример #34
0
 def get_subscription(self):
     sub = Subscription()
     sub.id = str(self.doc['data']['id'])
     sub.subscriber = sub.label = self.doc['header']['principal']
     return sub
Пример #35
0
 def get_subscription_list(self):
     sub = Subscription()
     sub.label = u'amazon'
     sub.id = u'amazon'
     yield sub
Пример #36
0
 def iter_subscription(self):
     obj = Subscription()
     obj.subscriber = self.get("donnee.identification.identite")
     obj.label = "Account of %s" % obj.subscriber
     obj.id = CleanText(replace=[(' ', '.')]).filter(obj.subscriber)
     return [obj]
Пример #37
0
 def iter_subscription(self):
     sub = Subscription()
     sub.id = '_bolden_'
     sub.subscriber = self.get_profile().name
     sub.label = 'Bolden %s' % sub.subscriber
     return [sub]
Пример #38
0
 def get_subscription_list(self):
     sub = Subscription()
     sub.label = u'amazon'
     sub.id = u'amazon'
     yield sub
Пример #39
0
 def get_subscription_list(self):
     sub = Subscription()
     sub.label = sub.id = self.username
     yield sub
Пример #40
0
 def get_subscription(self):
     sub = Subscription()
     sub.id = str(self.doc['data']['id'])
     sub.subscriber = sub.label = self.doc['header']['principal']
     return sub
Пример #41
0
 def iter_subscription(self):
     obj = Subscription()
     obj.subscriber = self.get("donnee.identification.identite")
     obj.label = "Account of %s" % obj.subscriber
     obj.id = CleanText(replace=[(' ', '.')]).filter(obj.subscriber)
     return [obj]