Exemple #1
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
Exemple #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
Exemple #3
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]
Exemple #4
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]