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


Python FrenchTransaction._currency方法代码示例

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


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

示例1: parse_transaction

# 需要导入模块: from weboob.tools.capabilities.bank.transactions import FrenchTransaction [as 别名]
# 或者: from weboob.tools.capabilities.bank.transactions.FrenchTransaction import _currency [as 别名]
    def parse_transaction(self, transaction, account):
        t = FrenchTransaction(transaction['activityId'])
        date = parse_french_date(transaction['date'])
        raw = transaction.get('counterparty', transaction['displayType'])
        t.parse(date=date, raw=raw)

        try:
            if transaction['currencyCode'] != account.currency:
                transaction = self.browser.convert_amount(account, transaction)
                t.original_amount = self.format_amount(transaction['originalAmount'], transaction["isCredit"])
                t.original_currency = u'' + transaction["currencyCode"]
            t.amount = self.format_amount(transaction['netAmount'], transaction["isCredit"])
        except KeyError:
            return

        t._currency = transaction['currencyCode']

        return t
开发者ID:nojhan,项目名称:weboob-devel,代码行数:20,代码来源:pages.py

示例2: parse_transaction

# 需要导入模块: from weboob.tools.capabilities.bank.transactions import FrenchTransaction [as 别名]
# 或者: from weboob.tools.capabilities.bank.transactions.FrenchTransaction import _currency [as 别名]
    def parse_transaction(self, transaction):
        t = FrenchTransaction(transaction['activityId'])
        date = parse_french_date(transaction['date'])
        try:
            raw = transaction['counterparty']
        except KeyError:
            raw = transaction['displayType']
        t.parse(date=date, raw=raw)
        try:
            amount = transaction['netAmount']
        except KeyError:
            return
        if transaction['isCredit']:
            t.set_amount(credit=amount)
        else:
            t.set_amount(debit=amount)
        t._currency = transaction['currencyCode']

        return t
开发者ID:frankrousseau,项目名称:weboob-modules,代码行数:21,代码来源:newpages.py

示例3: parse

# 需要导入模块: from weboob.tools.capabilities.bank.transactions import FrenchTransaction [as 别名]
# 或者: from weboob.tools.capabilities.bank.transactions.FrenchTransaction import _currency [as 别名]
    def parse(self):
        for tr in self.document.xpath('//tbody/tr'):
            tlink = tr.xpath('./td[@class="desc"]/a[@class="rowClick"]')[0].attrib['href'].strip()
            t = FrenchTransaction(tlink[tlink.find('&id=')+4:])
            date = parse_french_date(tr.xpath('./td[@class="date"]')[0].text.strip())
            raw = tr.xpath('./td[@class="desc"]/a[@class="rowClick"]')[0].tail.strip()
            # Filter lines that do not actually modify the balance
            if raw.startswith('Autorisation ') or raw.endswith(' en attente  par PayPal'):
                continue
            t.parse(date=date, raw=raw)

            amount = tr.xpath('./td[@class="price-value net"]')[0].text.strip()
            t.set_amount(amount)
            commission = tr.xpath('./td[@class="price-value fee"]')[0].text.strip()
            t.commission = Decimal(t.clean_amount(commission))
            t.label = t.raw
            if t.commission:
                t.label += " (%s)" % tr.xpath('./td[@class="price-value gross"]')[0].text.strip()

            t._currency = Account.get_currency(amount)
            yield t
开发者ID:nojhan,项目名称:weboob-devel,代码行数:23,代码来源:pages.py


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