pax_global_header 0000666 0000000 0000000 00000000064 13400741301 0014503 g ustar 00root root 0000000 0000000 52 comment=309ae667efa3c8f7192ef6b744c295fbb8a2d101
woob-309ae667efa3c8f7192ef6b744c295fbb8a2d101-modules-oney/ 0000775 0000000 0000000 00000000000 13400741301 0022160 5 ustar 00root root 0000000 0000000 woob-309ae667efa3c8f7192ef6b744c295fbb8a2d101-modules-oney/modules/ 0000775 0000000 0000000 00000000000 13400741301 0023630 5 ustar 00root root 0000000 0000000 woob-309ae667efa3c8f7192ef6b744c295fbb8a2d101-modules-oney/modules/oney/ 0000775 0000000 0000000 00000000000 13400741301 0024602 5 ustar 00root root 0000000 0000000 woob-309ae667efa3c8f7192ef6b744c295fbb8a2d101-modules-oney/modules/oney/__init__.py 0000664 0000000 0000000 00000001424 13400741301 0026714 0 ustar 00root root 0000000 0000000 # -*- coding: utf-8 -*-
# Copyright(C) 2014 Budget Insight
#
# This file is part of weboob.
#
# weboob is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# weboob is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with weboob. If not, see .
from .module import OneyModule
__all__ = ['OneyModule']
woob-309ae667efa3c8f7192ef6b744c295fbb8a2d101-modules-oney/modules/oney/browser.py 0000664 0000000 0000000 00000013062 13400741301 0026641 0 ustar 00root root 0000000 0000000 # -*- coding: utf-8 -*-
# Copyright(C) 2014 Budget Insight
#
# This file is part of weboob.
#
# weboob is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# weboob is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with weboob. If not, see .
from datetime import date
from weboob.exceptions import BrowserIncorrectPassword
from weboob.browser import LoginBrowser, URL, need_login
from weboob.tools.date import new_date
from .pages import (
LoginPage, ClientPage, OperationsPage, ChoicePage,
CreditHome, CreditAccountPage, CreditHistory, LastHistoryPage,
)
__all__ = ['OneyBrowser']
class OneyBrowser(LoginBrowser):
BASEURL = 'https://www.oney.fr'
login = URL(r'/site/s/login/login.html', LoginPage)
choice = URL(r'/site/s/multimarque/choixsite.html', ChoicePage)
choice_portal = URL(r'/site/s/login/loginidentifiant.html')
client = URL(r'/oney/client', ClientPage)
operations = URL(r'/oney/client', OperationsPage)
card_page = URL(r'/oney/client\?task=Synthese&process=SyntheseMultiCompte&indexSelectionne=(?P\d+)')
credit_home = URL(r'/site/s/detailcompte/detailcompte.html', CreditHome)
credit_info = URL(r'/site/s/detailcompte/ongletdetailcompte.html', CreditAccountPage)
credit_hist = URL(r'/site/s/detailcompte/exportoperations.html', CreditHistory)
last_hist = URL(r'/site/s/detailcompte/ongletdernieresoperations.html', LastHistoryPage)
has_oney = False
has_other = False
card_name = None
def do_login(self):
self.session.cookies.clear()
self.login.go()
self.page.login(self.username, self.password)
if self.choice.is_here():
self.has_other = self.has_oney = True
elif self.credit_home.is_here():
self.has_other = True
elif self.client.is_here():
self.has_oney = True
else:
raise BrowserIncorrectPassword()
@need_login
def go_site(self, site):
if site == 'oney':
if (
self.credit_home.is_here() or self.credit_info.is_here()
or self.credit_hist.is_here()
or self.last_hist.is_here()
):
self.choice.go()
assert self.choice.is_here()
if self.choice.is_here():
self.choice_portal.go(data={'selectedSite': 'ONEY_HISTO'})
elif site == 'other':
if self.client.is_here() or self.operations.is_here():
self.do_login()
assert self.choice.is_here()
if self.choice.is_here():
self.choice_portal.go(data={'selectedSite': 'ONEY'})
@need_login
def get_accounts_list(self):
accounts = []
if self.has_other:
self.go_site('other')
self.credit_home.stay_or_go()
self.card_name = self.page.get_name()
self.credit_info.go()
accounts.append(self.page.get_account())
if self.has_oney:
self.go_site('oney')
self.client.stay_or_go()
accounts.extend(self.page.iter_accounts())
return accounts
def _build_hist_form(self):
form = {}
d = date.today()
form['jourDebut'] = '1'
form['moisDebut'] = '1'
form['anneeDebut'] = '2016'
form['jourFin'] = str(d.day)
form['moisFin'] = str(d.month)
form['anneeFin'] = str(d.year)
form['typeOpe'] = 'deux'
form['formatFichier'] = 'xls' # or pdf... great choice
return form
@need_login
def iter_history(self, account):
self.go_site(account._site)
if account._site == 'oney':
if account._num:
self.card_page.go(acc_num=account._num)
post = {'task': 'Synthese', 'process': 'SyntheseCompte', 'taskid': 'Releve'}
self.operations.go(data=post)
for tr in self.page.iter_transactions(seen=set()):
yield tr
elif account._site == 'other':
if self.last_hist.go().has_transactions():
self.credit_hist.go(params=self._build_hist_form())
d = date.today().replace(day=1) # TODO is it the right date?
for tr in self.page.iter_history():
if new_date(tr.date) < d:
yield tr
@need_login
def iter_coming(self, account):
self.go_site(account._site)
if account._site == 'oney':
if account._num:
self.card_page.go(acc_num=account._num)
post = {'task': 'OperationRecente', 'process': 'OperationRecente', 'taskid': 'OperationRecente'}
self.operations.go(data=post)
for tr in self.page.iter_transactions(seen=set()):
yield tr
elif account._site == 'other':
if self.last_hist.go().has_transactions():
self.credit_hist.go(params=self._build_hist_form())
d = date.today().replace(day=1) # TODO is it the right date?
for tr in self.page.iter_history():
if new_date(tr.date) >= d:
yield tr
woob-309ae667efa3c8f7192ef6b744c295fbb8a2d101-modules-oney/modules/oney/favicon.png 0000664 0000000 0000000 00000005377 13400741301 0026751 0 ustar 00root root 0000000 0000000 PNG
IHDR @ @ iq bKGD N cQ pHYs tIME
%[} tEXtComment Created with GIMPW
gIDATx[klf絳k.8!*PDe*$i+5i"
E+G(Qd`(HچWU(
jR+1k{mcfgfyɮ]xSZ;9{MiF]B8 K 4`Z ! B6@@@' N8FQ^rBՄC3VB 8A#uBHT><{2go%7ZoOo'&=,!Nd۶=n" n{!K($N)ϏxDXE+X T1`w]m0 IdY~qΰ'Sh$ض
M I%
)]OEQt3BcTz(
4Meم'OlSKS7',R)(QD.^B
xg!Ey|>x
t{0`,>rb\;ƿq? 5D@zR~.K'C|ۃ(`h^)(U Myy~e!(4x .à|E^&3h9m~Fqaَ;{mSjG{|j=XMӠiNc<̃/tJBTpb^p1;톅C
7#` X?w⿲./VL5C̵p֣)t?>|t_~<7kxGAX`w&wf;;17oyp6 i :7^k{Gx7{ @-7
3/_ 5 `{Ww@ԣToGy/ͮ
|4[Er6"$
j˖O_
. މ~2
2,beg# {ê-ItURNhwgO܌'fnvpp{o$Ճ2vnHpAmrY[j (]_>Ւ K?
s@ bz{b0uY7EE`<_%WVpUtԕ]cMe(c+I])Mr ?) 1P> ~jJPdM<#ds3b|=R,18V݆R"dzf|
472LƞMYy=QknoŬɋٕlUİ~ُhZ5;ЗяOăͺi"* i(
s0|R\rp9ݗ_ȺbFg4 K懃 TqXU;>F>IDiB
!Vnx?S<q5a