Commit 1f0c2841 authored by Romain Bignon's avatar Romain Bignon

added some pages classes

parent ebe8e8d1
# -*- coding: utf-8 -*-
"""
Copyright(C) 2009 Romain Bignon
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, version 3 of the License.
This program 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 General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
"""
from .comptes_list import ComptesList
class CompteHistory(ComptesList): pass
class CompteCurrent(ComptesList): pass
# -*- coding: utf-8 -*-
"""
Copyright(C) 2009 Romain Bignon
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, version 3 of the License.
This program 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 General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
"""
class PageBase:
def __init__(self, bnporc, document):
self.bnporc = bnporc
self.document = document
def loaded(self):
raise NotImplementedError()
# -*- coding: utf-8 -*-
"""
Copyright(C) 2009 Romain Bignon
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, version 3 of the License.
This program 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 General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
"""
from .base import PageBase
class ComptesList(PageBase):
def loaded(self):
pass
def get_list(self):
l = []
trs = self.document.getElementsByTagName('tr')
for tr in trs:
if tr.getAttribute('class') == 'comptes':
fields = tr.getElementsByTagName('td')
label = ''
solde = ''
avenir = ''
for td in fields:
if td.getAttribute('headers').startswith('Libelle_'):
a = td.getElementsByTagName('a')
label = a[0].firstChild.data
elif td.getAttribute('headers').startswith('Solde'):
a = td.getElementsByTagName('a')
solde = a[0].firstChild.data
solde = solde.replace('.','').replace(',','.')
elif td.getAttribute('headers').startswith('Avenir'):
a = td.getElementsByTagName('a')
avenir = a[0].firstChild.data
avenir = avenir.replace('.','').replace(',','.')
l.append({'label': label,
'solde': float(solde),
'avenir': float(avenir)})
return l
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment