当前位置: 首页>>代码示例>>Python>>正文


Python Account._is_card方法代码示例

本文整理汇总了Python中weboob.capabilities.bank.Account._is_card方法的典型用法代码示例。如果您正苦于以下问题:Python Account._is_card方法的具体用法?Python Account._is_card怎么用?Python Account._is_card使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在weboob.capabilities.bank.Account的用法示例。


在下文中一共展示了Account._is_card方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: get_list

# 需要导入模块: from weboob.capabilities.bank import Account [as 别名]
# 或者: from weboob.capabilities.bank.Account import _is_card [as 别名]
 def get_list(self):
     table = self.parser.select(self.document.getroot(), "#tab-corps", 1)
     for tr in self.parser.select(table, "tr", "many"):
         tdname, tdid, tdagency, tdbalance = [td.text_content().strip() for td in self.parser.select(tr, "td", 4)]
         # it has empty rows - ignore those without the necessary info
         if all((tdname, tdid, tdbalance)):
             account = Account()
             account.label = to_unicode(tdname)
             account.id = to_unicode(tdid.replace(u"\xa0", "").replace(" ", ""))
             account._agency = to_unicode(tdagency)
             account._is_card = False
             account.balance = Decimal(Transaction.clean_amount(tdbalance))
             account.currency = account.get_currency(tdbalance)
             yield account
开发者ID:nojhan,项目名称:weboob-devel,代码行数:16,代码来源:pages.py

示例2: get_list

# 需要导入模块: from weboob.capabilities.bank import Account [as 别名]
# 或者: from weboob.capabilities.bank.Account import _is_card [as 别名]
    def get_list(self):
        rib = None
        currency = None
        for script in self.document.xpath('//script'):
            if script.text is None:
                continue

            m = re.search('var rib = "(\d+)"', script.text)
            if m:
                rib = m.group(1)
            m = re.search("var devise='(\w+)'", script.text)
            if m:
                currency = m.group(1)

            if all((rib, currency)):
                break

        if not all((rib, currency)):
            self.logger.error('Unable to find rib or currency')

        for tr in self.document.xpath('//table[@id="tab-corps"]//tr'):
            tds = tr.findall('td')

            if len(tds) != 3:
                continue

            account = Account()
            account.type = Account.TYPE_CARD
            account.label = self.parser.tocleanstring(tds[self.COL_LABEL])
            if len(account.label) == 0:
                continue

            link = tds[self.COL_ID].xpath('.//a')[0]
            m = re.match(r"changeCarte\('(\d+)','(\d+)','([^']+)'\);.*", link.attrib['onclick'])
            if not m:
                self.logger.error('Unable to parse link %r' % link.attrib['onclick'])
                continue
            account._link_num = m.group(1) #useless
            account._link = m.group(2)
            account.id = m.group(2) + account._link_num
            account._link_date = urllib.quote(m.group(3))
            account._link_rib = rib
            account._link_currency = currency
            account._is_card = True
            tdbalance = self.parser.tocleanstring(tds[self.COL_BALANCE])
            account.balance = - Decimal(Transaction.clean_amount(tdbalance))
            account.currency = account.get_currency(tdbalance)
            yield account
开发者ID:h4wkmoon,项目名称:weboob,代码行数:50,代码来源:pages.py

示例3: get_list

# 需要导入模块: from weboob.capabilities.bank import Account [as 别名]
# 或者: from weboob.capabilities.bank.Account import _is_card [as 别名]
 def get_list(self):
     table = self.parser.select(self.document.getroot(), '#tab-corps', 1)
     for tr in self.parser.select(table, 'tr', 'many'):
         tdname, tdid, tdagency, tdbalance = [td.text_content().strip()
                                              for td
                                              in self.parser.select(tr, 'td', 4)]
         # it has empty rows - ignore those without the necessary info
         if all((tdname, tdid, tdbalance)):
             account = Account()
             account.label = to_unicode(tdname)
             account.type = self.TYPES.get(account.label, Account.TYPE_UNKNOWN)
             account.id = to_unicode(tdid.replace(u'\xa0', '').replace(' ', ''))
             account._agency = to_unicode(tdagency)
             account._is_card = False
             account.balance = Decimal(Transaction.clean_amount(tdbalance))
             account.currency = account.get_currency(tdbalance)
             yield account
开发者ID:ffourcot,项目名称:weboob,代码行数:19,代码来源:pages.py


注:本文中的weboob.capabilities.bank.Account._is_card方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。