Trees | Indices | Help |
|
---|
|
1 # -*- coding: iso-8859-1 -*- 2 # Copyright 20003 - 2008: Julien Bourdaillet (julien.bourdaillet@lip6.fr), Jean-Gabriel Ganascia (jean-gabriel.ganascia@lip6.fr) 3 # This file is part of MEDITE. 4 # 5 # MEDITE is free software; you can redistribute it and/or modify 6 # it under the terms of the GNU General Public License as published by 7 # the Free Software Foundation; either version 2 of the License, or 8 # (at your option) any later version. 9 # 10 # MEDITE is distributed in the hope that it will be useful, 11 # but WITHOUT ANY WARRANTY; without even the implied warranty of 12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 # GNU General Public License for more details. 14 # 15 # You should have received a copy of the GNU General Public License 16 # along with Foobar; if not, write to the Free Software 17 # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 18 #---------------------------------------------------------------------------- 19 # Nom: transformations.py 20 # Objet: Classe qui regoupe les donnees d'une comparaison d'un couple 21 # d'état ( utilisee pour construire le fichier xml ) 22 #---------------------------------------------------------------------------- 23 24 import sys,Utile.decodage 2527 28 # Constructeur de la classe8829 - def __init__(self, pInsertions, pSuppressions, pDeplacements, pRemplacements, pTexteSource, pTexteCible):30 ## les attributs ci-dessous sont des listes de sequence de caracteres 31 self.__insertions =pInsertions 32 self.__suppressions =pSuppressions 33 self.__deplacements = pDeplacements 34 self.__remplacements = pRemplacements 35 ## les attributs ci-dessous sont des noeuds xml 36 self.__texteSource = pTexteSource 37 self.__texteCible = pTexteCible38 39 # Methodes d'acces aux attributs privees 42 45 48 51 54 5759 s = u"Type TRANSFORMATION\nInsertions : " 60 for i in self.__insertions: 61 s += i+u" / " 62 s += u"\nSuppressions : " 63 for i in self.__suppressions: 64 s += i+u" / " 65 s += u"\nDéplacements : " 66 for i in self.__deplacements: 67 s += i+u" / " 68 s += "\nRemplacements : " 69 if self.__remplacements: 70 for i in self.__remplacements: 71 s += unicode(i).encode("iso-8859-2", "replace")+" / " 72 s += "\nTexteSource : " 73 #s += unicode(self.__texteSource.toxml()).encode("iso-8859-2", "replace") 74 s2,x,y = Utile.decodage.decode_string_heuristically(self.__texteSource.toxml()) 75 s += s2 76 # if self.__texteSource != []: 77 # for i in self.__texteSource: 78 # s += unicode(i).encode("iso-8859-2", "replace")+" / " 79 s += "\nTexteCible : " 80 s2,x,y = Utile.decodage.decode_string_heuristically(self.__texteCible.toxml()) 81 s += s2 82 # s += unicode(self.__texteCible).encode("iso-8859-2", "replace") 83 # if self.__texteCible != []: 84 # for i in self.__texteCible: 85 # s += unicode(i).encode("iso-8859-2", "replace")+" / " 86 sys.stderr.write(unicode(s).encode("iso-8859-2", "replace")) 87 sys.stderr.flush()
Trees | Indices | Help |
|
---|
Generated by Epydoc 3.0beta1 on Wed Aug 13 15:25:36 2008 | http://epydoc.sourceforge.net |