本文整理汇总了Python中weboob.capabilities.bank.Account._inv方法的典型用法代码示例。如果您正苦于以下问题:Python Account._inv方法的具体用法?Python Account._inv怎么用?Python Account._inv使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类weboob.capabilities.bank.Account
的用法示例。
在下文中一共展示了Account._inv方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: get_list
# 需要导入模块: from weboob.capabilities.bank import Account [as 别名]
# 或者: from weboob.capabilities.bank.Account import _inv [as 别名]
def get_list(self):
accounts = []
previous_account = None
noaccounts = self.get_from_js('_js_noMvts =', ';')
if noaccounts is not None:
assert 'avez aucun compte' in noaccounts
return []
txt = self.get_from_js('_data = new Array(', ');', is_list=True)
if txt is None:
raise BrowserUnavailable('Unable to find accounts list in scripts')
data = json.loads('[%s]' % txt.replace("'", '"'))
for line in data:
a = Account()
a.id = line[self.COL_ID].replace(' ', '')
if re.match(r'Classement=(.*?):::Banque=(.*?):::Agence=(.*?):::SScompte=(.*?):::Serie=(.*)', a.id):
a.id = str(CleanDecimal().filter(a.id))
a._acc_nb = a.id.split('_')[0] if len(a.id.split('_')) > 1 else None
a.label = MyStrip(line[self.COL_LABEL], xpath='.//div[@class="libelleCompteTDB"]')
# This account can be multiple life insurance accounts
if a.label == 'ASSURANCE VIE-BON CAPI-SCPI-DIVERS *':
continue
a.balance = Decimal(FrenchTransaction.clean_amount(line[self.COL_BALANCE]))
a.currency = a.get_currency(line[self.COL_BALANCE])
a.type = self.get_account_type(a.label)
# The parent account must be created right before
if a.type == Account.TYPE_CARD:
# duplicate
if find_object(accounts, id=a.id):
self.logger.warning('Ignoring duplicate card %r', a.id)
continue
a.parent = previous_account
if line[self.COL_HISTORY] == 'true':
a._inv = False
a._link = self.get_history_link()
a._args = self.make__args_dict(line)
else:
a._inv = True
a._args = {'_ipc_eventValue': line[self.COL_ID],
'_ipc_fireEvent': line[self.COL_FIRE_EVENT],
}
a._link = self.doc.xpath('//form[@name="changePageForm"]')[0].attrib['action']
if a.type is Account.TYPE_CARD:
a.coming = a.balance
a.balance = Decimal('0.0')
accounts.append(a)
previous_account = a
return accounts
示例2: get_list
# 需要导入模块: from weboob.capabilities.bank import Account [as 别名]
# 或者: from weboob.capabilities.bank.Account import _inv [as 别名]
def get_list(self):
accounts = []
txt = self.get_from_js('_data = new Array(', ');', is_list=True)
if txt is None:
raise BrokenPageError('Unable to find accounts list in scripts')
data = json.loads('[%s]' % txt.replace("'", '"'))
for line in data:
a = Account()
a.id = line[self.COL_ID].replace(' ', '')
a._acc_nb = a.id.split('_')[0] if len(a.id.split('_')) > 1 else None
fp = StringIO(unicode(line[self.COL_LABEL]).encode(self.browser.ENCODING))
a.label = self.parser.tocleanstring(self.parser.parse(fp, self.browser.ENCODING).xpath('//div[@class="libelleCompteTDB"]')[0])
# This account can be multiple life insurance accounts
if a.label == 'ASSURANCE VIE-BON CAPI-SCPI-DIVERS *':
continue
a.balance = Decimal(FrenchTransaction.clean_amount(line[self.COL_BALANCE]))
a.currency = a.get_currency(line[self.COL_BALANCE])
a.type = self.get_account_type(a.label)
if line[self.COL_HISTORY] == 'true':
a._inv = False
a._link = self.get_history_link()
a._args = {'_eventId': 'clicDetailCompte',
'_ipc_eventValue': '',
'_ipc_fireEvent': '',
'deviseAffichee': 'DEVISE',
'execution': self.get_execution(),
'idCompteClique': line[self.COL_ID],
}
else:
a._inv = True
a._args = {'_ipc_eventValue': line[self.COL_ID],
'_ipc_fireEvent': line[self.COL_FIRE_EVENT],
}
a._link = self.document.xpath('//form[@name="changePageForm"]')[0].attrib['action']
if a.id.find('_CarteVisa') >= 0:
accounts[-1]._card_ids.append(a._args)
if not accounts[-1].coming:
accounts[-1].coming = Decimal('0.0')
accounts[-1].coming += a.balance
continue
a._card_ids = []
accounts.append(a)
return accounts
示例3: get_av_accounts
# 需要导入模块: from weboob.capabilities.bank import Account [as 别名]
# 或者: from weboob.capabilities.bank.Account import _inv [as 别名]
def get_av_accounts(self):
for tr in self.document.xpath('//table[@class="datas"]/tr[not(@class)]'):
cols = tr.findall('td')
if len(cols) != 4:
continue
a = Account()
a.label = self.parser.tocleanstring(cols[self.COL_LABEL])
a.type = Account.TYPE_LIFE_INSURANCE
a.balance = Decimal(FrenchTransaction.clean_amount(self.parser.tocleanstring(cols[self.COL_BALANCE])))
a._link, a._args = self.get_params(cols[self.COL_LABEL].find('span/a').attrib['href'])
a.id = '%s%s' % (a._args['IndiceSupport'], a._args['NumPolice'])
a._acc_nb = None
a._card_ids = []
a._inv = True
yield a
示例4: get_av_accounts
# 需要导入模块: from weboob.capabilities.bank import Account [as 别名]
# 或者: from weboob.capabilities.bank.Account import _inv [as 别名]
def get_av_accounts(self):
for table in self.doc.xpath('//table[@class="datas"]'):
head_cols = table.xpath('./tr[@class="entete"]/td')
for tr in table.xpath('./tr[not(@class)]'):
cols = tr.findall('td')
if len(cols) != 4:
continue
a = Account()
a.label = CleanText('.')(cols[self.COL_LABEL])
a.type = Account.TYPE_LIFE_INSURANCE
a.balance = MyDecimal('.')(cols[self.COL_BALANCE])
a.currency = a.get_currency(CleanText('.')(head_cols[self.COL_BALANCE]))
a._link, a._args = self.get_params(cols[self.COL_LABEL].find('span/a').attrib['href'])
a.id = a._args['IndiceSupport'] + a._args['NumPolice']
a._acc_nb = None
a._inv = True
yield a
示例5: get_av_accounts
# 需要导入模块: from weboob.capabilities.bank import Account [as 别名]
# 或者: from weboob.capabilities.bank.Account import _inv [as 别名]
def get_av_accounts(self):
for table in self.doc.xpath('//table[@class="datas"]'):
head_cols = table.xpath('./tr[@class="entete"]/td')
for tr in table.xpath('./tr[not(@class)]'):
cols = tr.findall('td')
if len(cols) != 4:
continue
a = Account()
# get acc_nb like on accounts page
a._acc_nb = Regexp(
CleanText('//div[@id="v1-cadre"]//b[contains(text(), "Compte N")]', replace=[(' ', '')]),
r'(\d+)'
)(self.doc)[5:]
a.label = CleanText('.')(cols[self.COL_LABEL])
a.type = Account.TYPE_LIFE_INSURANCE
a.balance = MyDecimal('.')(cols[self.COL_BALANCE])
a.currency = a.get_currency(CleanText('.')(head_cols[self.COL_BALANCE]))
a._link, a._args = self.get_params(cols[self.COL_LABEL].find('span/a').attrib['href'])
a.id = '%s%s%s' % (a._acc_nb, a._args['IndiceSupport'], a._args['NumPolice'])
a._inv = True
yield a
示例6: get_list
# 需要导入模块: from weboob.capabilities.bank import Account [as 别名]
# 或者: from weboob.capabilities.bank.Account import _inv [as 别名]
def get_list(self):
no_accounts_message = self.doc.xpath(u'//span/b[contains(text(),"Votre abonnement est clôturé. Veuillez contacter votre conseiller.")]/text()')
if no_accounts_message:
raise ActionNeeded(no_accounts_message[0])
previous_checking_account = None
# Several deposit accounts ('Compte à terme') have the same id and the same label
# So a number is added to distinguish them
previous_deposit_account = None
deposit_count = 1
for tr in self.doc.xpath('//table[has-class("datas")]//tr'):
if tr.attrib.get('class', '') == 'entete':
continue
cols = tr.findall('td')
a = Account()
a.label = unicode(cols[self.COL_ID].xpath('.//span[@class="left-underline"] | .//span[@class="left"]/a')[0].text.strip())
a.type = self.get_account_type(a.label)
balance = CleanText('.')(cols[self.COL_BALANCE])
if balance == '':
continue
a.balance = CleanDecimal(replace_dots=True).filter(balance)
a.currency = a.get_currency(balance)
if cols[self.COL_ID].find('a'):
a._link, a._args = self.params_from_js(cols[self.COL_ID].find('a').attrib['href'])
# There may be a href with 'javascript:NoDetail();'
# The _link and _args should be None
else:
a._link, a._args = None, None
a._acc_nb = cols[self.COL_ID].xpath('.//span[@class="right-underline"] | .//span[@class="right"]')[0].text.replace(' ', '').strip()
if hasattr(a, '_args') and a._args:
a.id = '%s%s%s' % (a._acc_nb, a._args['IndiceCompte'], a._args['Indiceclassement'])
else:
a.id = a._acc_nb
# This account can be multiple life insurance accounts
if (any(a.label.startswith(lab) for lab in ['ASS.VIE-BONS CAPI-SCPI-DIVERS', 'BONS CAPI-SCPI-DIVERS'])
or (u'Aucun d\\351tail correspondant pour ce compte' in tr.xpath('.//a/@href')[0])
and 'COMPTE A TERME' not in tr.xpath('.//span[contains(@class, "left")]/text()')[0]):
continue
if a.type is Account.TYPE_CARD:
a.coming = a.balance
a.balance = Decimal('0.0')
# Take the predecessiong checking account as parent
if previous_checking_account:
a.parent = previous_checking_account
else:
self.logger.warning('The card account %s has no parent account' % a.id)
a._inv = False
if a.type == Account.TYPE_CHECKING:
previous_checking_account = a
if previous_deposit_account and previous_deposit_account.id == a.id:
a.id = a.id + '_%s' % deposit_count
deposit_count += 1
previous_deposit_account = a
if a.type == Account.TYPE_DEPOSIT:
previous_deposit_account = a
yield a