14 this file is part of the project scolasync
16 Copyright (C) 2012 Georges Khaznadar <georgesk@ofset.org>
18 This program is free software: you can redistribute it and/or modify
19 it under the terms of the GNU General Public License as published by
20 the Free Software Foundation, either version3 of the License, or
21 (at your option) any later version.
23 This program is distributed in the hope that it will be useful,
24 but WITHOUT ANY WARRANTY; without even the implied warranty of
25 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
26 GNU General Public License for more details.
28 You should have received a copy of the GNU General Public License
29 along with this program. If not, see <http://www.gnu.org/licenses/>.
34 import xml.dom.minidom, copy
68 return "Cette fonction est abstraite, ne l'appelez pas ainsi."
76 return "Cette fonction est abstraite, ne l'appelez pas ainsi."
90 AbstractGestClasse.__init__(self,f)
94 file=open(f,
"r", encoding="iso-8859-1")
108 for el
in self.nullTexts.keys():
114 for e
in el.childNodes:
115 if e.nodeType==e.TEXT_NODE
and e.data.strip()==
"":
150 if el.nodeName.lower()==
"eleve" and el.getAttribute(
"ELEVE_ID")==self.
currentID:
151 self.currentResult.append(el)
160 if el.nodeName.lower()==
"structures_eleve":
161 structures=el.getElementsByTagName(
"STRUCTURE")
162 if len (structures) > 0:
163 if structures[0].getElementsByTagName(
"TYPE_STRUCTURE")[0].firstChild.data==
"D":
164 if structures[0].getElementsByTagName(
"CODE_STRUCTURE")[0].firstChild.data==self.
currentClassName:
165 idEleve=el.getAttribute(
"ELEVE_ID")
166 self.currentResult.append(idEleve)
174 if el.nodeName.lower()==
"structure":
175 if el.getElementsByTagName(
"TYPE_STRUCTURE")[0].firstChild.data==
"D":
176 self.classes.add(el.getElementsByTagName(
"CODE_STRUCTURE")[0].firstChild.data)
189 items.append(el.getElementsByTagName(f)[0].firstChild.data)
190 items.append(el.getAttribute(
"ELEVE_ID"))
191 return "_".join(items)
202 items.append(el.getElementsByTagName(f)[0].firstChild.data)
203 return " ".join(items)
215 for e
in el.childNodes:
219 return self.donnees.toprettyxml(indent=
" ",encoding=
"utf-8")