本文整理汇总了Python中weboob.capabilities.bank.Account._file_number方法的典型用法代码示例。如果您正苦于以下问题:Python Account._file_number方法的具体用法?Python Account._file_number怎么用?Python Account._file_number使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类weboob.capabilities.bank.Account
的用法示例。
在下文中一共展示了Account._file_number方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: get_accounts_list
# 需要导入模块: from weboob.capabilities.bank import Account [as 别名]
# 或者: from weboob.capabilities.bank.Account import _file_number [as 别名]
def get_accounts_list(self):
r = self.api_open("/transactionnel/services/rest/Account/accounts")
for content in r.json()["content"]:
if self.accnum != "00000000000" and content["numero"] != self.accnum:
continue
for poste in content["postes"]:
a = Account()
a._number = content["numeroLong"]
a._nature = poste["codeNature"]
a._consultable = poste["consultable"]
a.id = "%s.%s" % (a._number, a._nature)
a.type = self.ACCOUNT_TYPES.get(poste["codeNature"], Account.TYPE_UNKNOWN)
if "numeroDossier" in poste and poste["numeroDossier"]:
a._file_number = poste["numeroDossier"]
a.id += ".%s" % a._file_number
if poste["postePortefeuille"]:
a.label = u"Portefeuille Titres"
a.balance = Decimal(str(poste["montantTitres"]["valeur"]))
a.currency = poste["montantTitres"]["monnaie"]["code"].strip()
yield a
if "libelle" not in poste:
continue
a.label = " ".join([content["intitule"].strip(), poste["libelle"].strip()])
a.balance = Decimal(str(poste["solde"]["valeur"]))
a.currency = poste["solde"]["monnaie"]["code"].strip()
yield a
示例2: get_list
# 需要导入模块: from weboob.capabilities.bank import Account [as 别名]
# 或者: from weboob.capabilities.bank.Account import _file_number [as 别名]
def get_list(self):
r = self.api_open('/transactionnel/services/rest/Account/accounts')
for content in r.json()['content']:
if self.accnum != '00000000000' and content['numero'] != self.accnum:
continue
for poste in content['postes']:
a = Account()
a._number = content['numeroLong']
iban_response = self.api_open('/transactionnel/services/rest/Account/account/%s/iban' % a._number).json()
a.iban = iban_response['content']['iban'] if 'content' in iban_response else NotAvailable
a._nature = poste['codeNature']
a._consultable = poste['consultable']
a._univers = self.current_univers
a.id = '%s.%s' % (a._number, a._nature)
a.type = self.ACCOUNT_TYPES.get(poste['codeNature'], Account.TYPE_UNKNOWN)
if 'numeroDossier' in poste and poste['numeroDossier']:
a._file_number = poste['numeroDossier']
a.id += '.%s' % a._file_number
if poste['postePortefeuille']:
a.label = u'Portefeuille Titres'
a.balance = Decimal(str(poste['montantTitres']['valeur']))
a.currency = poste['montantTitres']['monnaie']['code'].strip()
yield a
if 'libelle' not in poste:
continue
a.label = ' '.join([content['intitule'].strip(), poste['libelle'].strip()])
a.balance = Decimal(str(poste['solde']['valeur']))
a.currency = poste['solde']['monnaie']['code'].strip()
yield a
示例3: iter_accounts
# 需要导入模块: from weboob.capabilities.bank import Account [as 别名]
# 或者: from weboob.capabilities.bank.Account import _file_number [as 别名]
def iter_accounts(self, accnum, current_univers):
seen = set()
accounts_list = []
for content in self.get_content():
if accnum != '00000000000' and content['numero'] != accnum:
continue
for poste in content['postes']:
a = Account()
a._number = content['numeroLong']
a._nature = poste['codeNature']
a._codeSousPoste = poste['codeSousPoste'] if 'codeSousPoste' in poste else None
a._consultable = poste['consultable']
a._univers = current_univers
a.id = '%s.%s' % (a._number, a._nature)
if a.id in seen:
# some accounts like "compte à terme fidélis" have the same _number and _nature
# but in fact are kind of closed, so worthless...
self.logger.warning('ignored account id %r (%r) because it is already used', a.id, poste.get('numeroDossier'))
continue
seen.add(a.id)
a.type = self.ACCOUNT_TYPES.get(poste['codeNature'], Account.TYPE_UNKNOWN)
if a.type == Account.TYPE_UNKNOWN:
self.logger.warning("unknown type %s" % poste['codeNature'])
if a.type == Account.TYPE_CARD:
a.parent = find_object(accounts_list, _number=a._number, type=Account.TYPE_CHECKING)
if 'numeroDossier' in poste and poste['numeroDossier']:
a._file_number = poste['numeroDossier']
a.id += '.%s' % a._file_number
if poste['postePortefeuille']:
a.label = u'Portefeuille Titres'
a.balance = Decimal(str(poste['montantTitres']['valeur']))
a.currency = poste['montantTitres']['monnaie']['code'].strip()
if not a.balance and not a.currency and 'dateTitres' not in poste:
continue
accounts_list.append(a)
if 'libelle' not in poste:
continue
a.label = ' '.join([content['intitule'].strip(), poste['libelle'].strip()])
a.balance = Decimal(str(poste['solde']['valeur']))
a.currency = poste['solde']['monnaie']['code'].strip()
# Some accounts may have balance currency
if 'Solde en devises' in a.label and a.currency != u'EUR':
a.id += str(poste['monnaie']['codeSwift'])
accounts_list.append(a)
return accounts_list