add transaction patterns
This commit is contained in:
parent
dd33dbc418
commit
09444f5f43
2 changed files with 42 additions and 4 deletions
|
|
@ -34,7 +34,23 @@ __all__ = ['LoginPage', 'AccountsPage', 'UnknownPage']
|
||||||
|
|
||||||
|
|
||||||
class Transaction(FrenchTransaction):
|
class Transaction(FrenchTransaction):
|
||||||
pass
|
PATTERNS = [(re.compile(u'^(?P<category>CHEQUE)(?P<text>.*)'), FrenchTransaction.TYPE_CHECK),
|
||||||
|
(re.compile('^(?P<category>FACTURE CARTE) DU (?P<dd>\d{2})(?P<mm>\d{2})(?P<yy>\d{2}) (?P<text>.*?)( CA?R?T?E? ?\d*X*\d*)?$'),
|
||||||
|
FrenchTransaction.TYPE_CARD),
|
||||||
|
(re.compile('^(?P<category>(PRELEVEMENT|TELEREGLEMENT|TIP)) (?P<text>.*)'),
|
||||||
|
FrenchTransaction.TYPE_ORDER),
|
||||||
|
(re.compile('^(?P<category>ECHEANCEPRET)(?P<text>.*)'), FrenchTransaction.TYPE_LOAN_PAYMENT),
|
||||||
|
(re.compile('^(?P<category>RETRAIT DAB) (?P<dd>\d{2})/(?P<mm>\d{2})/(?P<yy>\d{2})( (?P<HH>\d+)H(?P<MM>\d+))? (?P<text>.*)'),
|
||||||
|
FrenchTransaction.TYPE_WITHDRAWAL),
|
||||||
|
(re.compile('^(?P<category>VIR(EMEN)?T? ((RECU|FAVEUR) TIERS|SEPA RECU)?)( /FRM)?(?P<text>.*)'),
|
||||||
|
FrenchTransaction.TYPE_TRANSFER),
|
||||||
|
(re.compile('^(?P<category>REMBOURST) CB DU (?P<dd>\d{2})(?P<mm>\d{2})(?P<yy>\d{2}) (?P<text>.*)'),
|
||||||
|
FrenchTransaction.TYPE_PAYBACK),
|
||||||
|
(re.compile('^(?P<category>REMBOURST)(?P<text>.*)'), FrenchTransaction.TYPE_PAYBACK),
|
||||||
|
(re.compile('^(?P<category>COMMISSIONS)(?P<text>.*)'), FrenchTransaction.TYPE_BANK),
|
||||||
|
(re.compile('^(?P<text>(?P<category>REMUNERATION).*)'), FrenchTransaction.TYPE_BANK),
|
||||||
|
(re.compile('^(?P<category>REMISE CHEQUES)(?P<text>.*)'), FrenchTransaction.TYPE_DEPOSIT),
|
||||||
|
]
|
||||||
|
|
||||||
|
|
||||||
class BEPage(BasePage):
|
class BEPage(BasePage):
|
||||||
|
|
@ -94,7 +110,6 @@ class BNPVirtKeyboard(MappedVirtKeyboard):
|
||||||
s += "O"
|
s += "O"
|
||||||
s += "\n"
|
s += "\n"
|
||||||
s = '\n'.join([l for l in s.splitlines() if l.strip()])
|
s = '\n'.join([l for l in s.splitlines() if l.strip()])
|
||||||
#print s
|
|
||||||
return hashlib.md5(s).hexdigest()
|
return hashlib.md5(s).hexdigest()
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -171,7 +186,6 @@ class HistoryPage(BEPage):
|
||||||
radio = self.parser.select(self.document, '//input[@name="br_tout_date"]', 1, 'xpath')
|
radio = self.parser.select(self.document, '//input[@name="br_tout_date"]', 1, 'xpath')
|
||||||
except BrokenPageError:
|
except BrokenPageError:
|
||||||
input = self.document.xpath('//input[@name="chB"]')[0]
|
input = self.document.xpath('//input[@name="chB"]')[0]
|
||||||
print '%r' % input.tail
|
|
||||||
d1, d2 = re.findall('(\d+/\d+/\d+)', input.tail)
|
d1, d2 = re.findall('(\d+/\d+/\d+)', input.tail)
|
||||||
else:
|
else:
|
||||||
d1 = radio.attrib['value'][0:10]
|
d1 = radio.attrib['value'][0:10]
|
||||||
|
|
|
||||||
|
|
@ -38,7 +38,31 @@ __all__ = ['LoginPage', 'AccountsPage', 'CardsPage', 'HistoryPage', 'CardHistory
|
||||||
|
|
||||||
|
|
||||||
class Transaction(FrenchTransaction):
|
class Transaction(FrenchTransaction):
|
||||||
_coming = False
|
PATTERNS = [(re.compile(r'^CARTE \w+ RETRAIT DAB.* (?P<dd>\d{2})/(?P<mm>\d{2})( (?P<HH>\d+)H(?P<MM>\d+))? (?P<text>.*)'),
|
||||||
|
FrenchTransaction.TYPE_WITHDRAWAL),
|
||||||
|
(re.compile(r'^CARTE \w+ (?P<dd>\d{2})/(?P<mm>\d{2})( A (?P<HH>\d+)H(?P<MM>\d+))? RETRAIT DAB (?P<text>.*)'),
|
||||||
|
FrenchTransaction.TYPE_WITHDRAWAL),
|
||||||
|
(re.compile(r'^CARTE \w+ REMBT (?P<dd>\d{2})/(?P<mm>\d{2})( A (?P<HH>\d+)H(?P<MM>\d+))? (?P<text>.*)'),
|
||||||
|
FrenchTransaction.TYPE_PAYBACK),
|
||||||
|
(re.compile(r'^(?P<category>CARTE) \w+ (?P<dd>\d{2})/(?P<mm>\d{2}) (?P<text>.*)'),
|
||||||
|
FrenchTransaction.TYPE_CARD),
|
||||||
|
(re.compile(r'^(?P<dd>\d{2})(?P<mm>\d{2})/(?P<text>.*?)/?(-[\d,]+)?$'),
|
||||||
|
FrenchTransaction.TYPE_CARD),
|
||||||
|
(re.compile(r'^(?P<category>(COTISATION|PRELEVEMENT|TELEREGLEMENT|TIP)) (?P<text>.*)'),
|
||||||
|
FrenchTransaction.TYPE_ORDER),
|
||||||
|
(re.compile(r'^(\d+ )?VIR (PERM )?POUR: (.*?) (REF: \d+ )?MOTIF: (?P<text>.*)'),
|
||||||
|
FrenchTransaction.TYPE_TRANSFER),
|
||||||
|
(re.compile(r'^(?P<category>VIR(EMEN)?T? \w+) (?P<text>.*)'),
|
||||||
|
FrenchTransaction.TYPE_TRANSFER),
|
||||||
|
(re.compile(r'^(CHEQUE) (?P<text>.*)'), FrenchTransaction.TYPE_CHECK),
|
||||||
|
(re.compile(r'^(FRAIS) (?P<text>.*)'), FrenchTransaction.TYPE_BANK),
|
||||||
|
(re.compile(r'^(?P<category>ECHEANCEPRET)(?P<text>.*)'),
|
||||||
|
FrenchTransaction.TYPE_LOAN_PAYMENT),
|
||||||
|
(re.compile(r'^(?P<category>REMISE CHEQUES)(?P<text>.*)'),
|
||||||
|
FrenchTransaction.TYPE_DEPOSIT),
|
||||||
|
(re.compile(r'^CARTE RETRAIT (?P<text>.*)'),
|
||||||
|
FrenchTransaction.TYPE_WITHDRAWAL),
|
||||||
|
]
|
||||||
|
|
||||||
|
|
||||||
class SGPEPage(BasePage):
|
class SGPEPage(BasePage):
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue