7 this file is part of the project scolasync
9 Copyright (C) 2012 Georges Khaznadar <georgesk@ofset.org>
11 This program is free software: you can redistribute it and/or modify
12 it under the terms of the GNU General Public License as published by
13 the Free Software Foundation, either version3 of the License, or
14 (at your option) any later version.
16 This program is distributed in the hope that it will be useful,
17 but WITHOUT ANY WARRANTY; without even the implied warranty of
18 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 GNU General Public License for more details.
21 You should have received a copy of the GNU General Public License
22 along with this program. If not, see <http://www.gnu.org/licenses/>.
27 import xml.dom.minidom
41 if type(file)==type(
""):
44 file=open(file,
"r", encoding="iso-8859-1")
58 for el
in self.nullTexts.keys():
64 for e
in el.childNodes:
65 if e.nodeType==e.TEXT_NODE
and e.data.strip()==
"":
82 if el.nodeName.lower()==
"structure":
83 if el.getElementsByTagName(
"TYPE_STRUCTURE")[0].firstChild.data==
"D":
84 self.classes.add(el.getElementsByTagName(
"CODE_STRUCTURE")[0].firstChild.data)
97 for e
in el.childNodes:
101 return self.donnees.toprettyxml(indent=
" ",encoding=
"utf-8")
104 if __name__==
"__main__":
106 print (s.collectClasses())
def __init__
Le constructeur.
def makeCompact
removes useless thext nodes containing only spaces.
def elementsWalk
implemente un parcour des éléments d'un arbre, pour y appliquer une procédure
Une classe pour travailler avec des données Sconet.