pax_global_header 0000666 0000000 0000000 00000000064 13435444765 0014531 g ustar 00root root 0000000 0000000 52 comment=139760e841ad4875b59fe11e052af1bb56dc06ea
woob-139760e841ad4875b59fe11e052af1bb56dc06ea-modules-lampiris/ 0000775 0000000 0000000 00000000000 13435444765 0022760 5 ustar 00root root 0000000 0000000 woob-139760e841ad4875b59fe11e052af1bb56dc06ea-modules-lampiris/modules/ 0000775 0000000 0000000 00000000000 13435444765 0024430 5 ustar 00root root 0000000 0000000 woob-139760e841ad4875b59fe11e052af1bb56dc06ea-modules-lampiris/modules/lampiris/ 0000775 0000000 0000000 00000000000 13435444765 0026250 5 ustar 00root root 0000000 0000000 woob-139760e841ad4875b59fe11e052af1bb56dc06ea-modules-lampiris/modules/lampiris/__init__.py 0000664 0000000 0000000 00000001577 13435444765 0030373 0 ustar 00root root 0000000 0000000 # -*- coding: utf-8 -*-
# Copyright(C) 2017 Phyks (Lucas Verney)
#
# This file is part of a weboob module.
#
# This weboob module 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.
#
# This weboob module 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 this weboob module. If not, see .
from __future__ import unicode_literals
from .module import LampirisModule
__all__ = ['LampirisModule']
woob-139760e841ad4875b59fe11e052af1bb56dc06ea-modules-lampiris/modules/lampiris/browser.py 0000664 0000000 0000000 00000004112 13435444765 0030303 0 ustar 00root root 0000000 0000000 # -*- coding: utf-8 -*-
# Copyright(C) 2017 Phyks (Lucas Verney)
#
# This file is part of a weboob module.
#
# This weboob module 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.
#
# This weboob module 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 this weboob module. If not, see .
from __future__ import unicode_literals
from weboob.browser import LoginBrowser, URL, need_login
from weboob.browser.exceptions import ClientError
from weboob.exceptions import BrowserIncorrectPassword
from .pages import LoginPage, BillsPage
class LampirisBrowser(LoginBrowser):
BASEURL = 'https://espaceclient.total-spring.fr/'
loginpage = URL('/user/login', LoginPage)
billspage = URL('/factures-et-paiements', BillsPage)
selectcus = URL('/set_selected_cus')
def __init__(self, *args, **kwargs):
self.logged = False
super(LampirisBrowser, self).__init__(*args, **kwargs)
def do_login(self):
if self.logged:
return
self.loginpage.stay_or_go().do_login(self.username, self.password)
try:
self.billspage.go()
self.logged = True
except ClientError:
raise BrowserIncorrectPassword()
@need_login
def get_subscriptions(self):
return self.billspage.go().get_subscriptions()
@need_login
def get_documents(self, subscription):
# Select subscription
self.selectcus.go(params={'cus': subscription.id})
# Then, fetch documents
for doc in self.billspage.go().get_documents():
doc.id = "{}#{}".format(subscription.id, doc.id)
yield doc
woob-139760e841ad4875b59fe11e052af1bb56dc06ea-modules-lampiris/modules/lampiris/favicon.png 0000664 0000000 0000000 00000002046 13435444765 0030405 0 ustar 00root root 0000000 0000000 PNG
IHDR >a pHYs .# .#x?v tIME&` tEXtComment Created with GIMPW IDATxq0Em[2Ӗ"_qzLz>> @ @ Ra%
!Ȝj3@0 ={li 5̜V#̜sL#0Y'GsVϥT]0
QbPjlƒT J
T q~IX9{Zz-3V;`fU W7DU h͑ĺV|CPMõ
~{߆jǩśg;wTj+n
I43Kve@3Z~kw_gyvZxtfe~Wck1,