# Author: Jean-Philippe Argaud, jean-philippe.argaud@edf.fr, EDF R&D
name = "ADAO"
-version = "V8_1_0" # Version pour catalogue, avec des "_" entre les numeros
+version = "V8_2_0" # Version pour catalogue, avec des "_" entre les numeros
date = ""
year = "2016" # Annee de copyright
<parameter name="icon" value="ADAO.png"/>
<parameter name="library" value="SalomePyQtGUI"/>
<parameter name="documentation" value="adao_help"/>
- <parameter name="version" value="8.1.0"/>
+ <parameter name="version" value="8.2.0"/>
</section>
<section name="resources">
<!-- Module resources -->
logging.info( "- Scipy "+p.getScipyVersion() )
logging.info( "" )
-# def setLogfileLevel(self, level=logging.NOTSET ):
-# """
-# Permet de changer globalement le niveau des messages disponibles.
-# """
-# logging.getLogger().setLevel(level)
-#
def setLogfile(self, filename=LOGFILE, filemode="w", level=logging.NOTSET):
"""
Permet de disposer des messages dans un fichier EN PLUS de la console.
--- /dev/null
+#-*-coding:iso-8859-1-*-
+#
+# Copyright (C) 2008-2016 EDF R&D
+#
+# This file is part of SALOME ADAO module
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License.
+#
+# This library 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
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+#
+# Author: Jean-Philippe Argaud, jean-philippe.argaud@edf.fr, EDF R&D
+
+import optparse
+import sys
+import re
+
+import Traducteur.log as log
+from Traducteur.load import getJDC, getJDCFromTexte
+from Traducteur.mocles import parseKeywords
+from Traducteur.dictErreurs import GenereErreurPourCommande
+from Traducteur.inseremocle import *
+from Traducteur.movemocle import *
+from Traducteur.renamemocle import *
+
+version_out = "V8_2_0"
+
+usage="""Usage: python %prog [options]
+
+Typical use is:
+ python %prog --infile=xxxx.comm --outfile=yyyy.comm"""
+
+atraiter = (
+ )
+
+dict_erreurs = {
+ }
+
+sys.dict_erreurs=dict_erreurs
+
+def traduc(infile=None,outfile=None,texte=None,flog=None):
+ hdlr = log.initialise(flog)
+ if infile is not None:
+ jdc = getJDC(infile,atraiter)
+ elif texte is not None:
+ jdc = getJDCFromTexte(texte,atraiter)
+ else:
+ raise ValueError("Traduction du JDC impossible")
+ # ==========================================================================
+
+
+ # ==========================================================================
+ fsrc = jdc.getSource()
+ fsrc = re.sub( "#VERSION_CATALOGUE:.*:FIN VERSION_CATALOGUE", "#VERSION_CATALOGUE:%s:FIN VERSION_CATALOGUE"%version_out, fsrc)
+ fsrc = re.sub( "#CHECKSUM.*FIN CHECKSUM", "", fsrc )
+ #
+ log.ferme(hdlr)
+ if outfile is not None:
+ f=open(outfile,'w')
+ f.write( fsrc )
+ f.close()
+ else:
+ return fsrc
+
+class MonTraducteur:
+ def __init__(self,texte):
+ self.__texte = str(texte)
+ def traduit(self):
+ return traduc(infile=None,outfile=None,texte=self.__texte,flog=None)
+
+def main():
+ parser = optparse.OptionParser(usage=usage)
+
+ parser.add_option('-i','--infile', dest="infile",
+ help="Le fichier COMM en entree, a traduire")
+ parser.add_option('-o','--outfile', dest="outfile", default='out.comm',
+ help="Le fichier COMM en sortie, traduit")
+
+ options, args = parser.parse_args()
+ if len(options.infile) == 0:
+ print
+ parser.print_help()
+ print
+ sys.exit(1)
+
+ traduc(options.infile,options.outfile)
+
+if __name__ == '__main__':
+ main()
+++ /dev/null
-#-*-coding:iso-8859-1-*-
-#
-# Copyright (C) 2008-2016 EDF R&D
-#
-# This file is part of SALOME ADAO module
-#
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 2.1 of the License.
-#
-# This library 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
-# Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-#
-# Author: Jean-Philippe Argaud, jean-philippe.argaud@edf.fr, EDF R&D
-
-import optparse
-import sys
-import re
-
-import Traducteur.log as log
-from Traducteur.load import getJDC, getJDCFromTexte
-from Traducteur.mocles import parseKeywords
-from Traducteur.dictErreurs import GenereErreurPourCommande
-from Traducteur.inseremocle import *
-from Traducteur.movemocle import *
-from Traducteur.renamemocle import *
-
-version_out = "V8_1_0"
-
-usage="""Usage: python %prog [options]
-
-Typical use is:
- python %prog --infile=xxxx.comm --outfile=yyyy.comm"""
-
-atraiter = (
- "ASSIMILATION_STUDY",
- "CHECKING_STUDY",
- )
-
-dict_erreurs = {
- "ASSIMILATION_STUDY":"Changements dans l'arbre et dans les noms",
- "CHECKING_STUDY":"Changements dans l'arbre et dans les noms",
- }
-
-sys.dict_erreurs=dict_erreurs
-
-def traduc(infile=None,outfile=None,texte=None,flog=None):
- hdlr = log.initialise(flog)
- if infile is not None:
- jdc = getJDC(infile,atraiter)
- elif texte is not None:
- jdc = getJDCFromTexte(texte,atraiter)
- else:
- raise ValueError("Traduction du JDC impossible")
-
- #Parse les mocles des commandes
- parseKeywords(jdc.root)
- GenereErreurPourCommande(jdc,('Algorithm','AlgorithmParameters','FunctionDict'))
- # ==========================================================================
-
- for command in atraiter:
- # Insere le MC s'il n'existe pas
- chercheOperInsereFacteurSiRegle(jdc, command, "AlgorithmParameters",((("AlgorithmParameters",),"nexistepasMCFParmi"),))
- # Deplace le MC
- moveMotClefInOperToFact(jdc, command, "Algorithm", "AlgorithmParameters", plusieursFois=False)
- # Renomme le MC
- renameMotCleInFact(jdc, command, "AlgorithmParameters", "INPUT_TYPE", "Parameters")
- # Renomme le MC
- renameMotCle(jdc, command, "Study_name", "StudyName")
- renameMotCle(jdc, command, "Study_repertory", "StudyRepertory")
-
- # ==========================================================================
- fsrc = jdc.getSource()
- fsrc = re.sub( "FunctionDict", "ScriptWithSwitch", fsrc )
- fsrc = re.sub( "FUNCTIONDICT_FILE", "SCRIPTWITHSWITCH_FILE", fsrc )
- fsrc = re.sub( "#VERSION_CATALOGUE:.*:FIN VERSION_CATALOGUE", "#VERSION_CATALOGUE:%s:FIN VERSION_CATALOGUE"%version_out, fsrc)
- fsrc = re.sub( "#CHECKSUM.*FIN CHECKSUM", "", fsrc )
- #
- log.ferme(hdlr)
- if outfile is not None:
- f=open(outfile,'w')
- f.write( fsrc )
- f.close()
- else:
- return fsrc
-
-class MonTraducteur:
- def __init__(self,texte):
- self.__texte = str(texte)
- def traduit(self):
- return traduc(infile=None,outfile=None,texte=self.__texte,flog=None)
-
-def main():
- parser = optparse.OptionParser(usage=usage)
-
- parser.add_option('-i','--infile', dest="infile",
- help="Le fichier COMM en entree, a traduire")
- parser.add_option('-o','--outfile', dest="outfile", default='out.comm',
- help="Le fichier COMM en sortie, traduit")
-
- options, args = parser.parse_args()
- if len(options.infile) == 0:
- print
- parser.print_help()
- print
- sys.exit(1)
-
- traduc(options.infile,options.outfile)
-
-if __name__ == '__main__':
- main()
--- /dev/null
+#-*-coding:iso-8859-1-*-
+#
+# Copyright (C) 2008-2016 EDF R&D
+#
+# This file is part of SALOME ADAO module
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License.
+#
+# This library 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
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+#
+# Author: Jean-Philippe Argaud, jean-philippe.argaud@edf.fr, EDF R&D
+
+import optparse
+import sys
+import re
+
+import Traducteur.log as log
+from Traducteur.load import getJDC, getJDCFromTexte
+from Traducteur.mocles import parseKeywords
+from Traducteur.dictErreurs import GenereErreurPourCommande
+from Traducteur.inseremocle import *
+from Traducteur.movemocle import *
+from Traducteur.renamemocle import *
+
+version_out = "V8_2_0"
+
+usage="""Usage: python %prog [options]
+
+Typical use is:
+ python %prog --infile=xxxx.comm --outfile=yyyy.comm"""
+
+atraiter = (
+ "ASSIMILATION_STUDY",
+ "CHECKING_STUDY",
+ )
+
+dict_erreurs = {
+ "ASSIMILATION_STUDY":"Changements dans l'arbre et dans les noms",
+ "CHECKING_STUDY":"Changements dans l'arbre et dans les noms",
+ }
+
+sys.dict_erreurs=dict_erreurs
+
+def traduc(infile=None,outfile=None,texte=None,flog=None):
+ hdlr = log.initialise(flog)
+ if infile is not None:
+ jdc = getJDC(infile,atraiter)
+ elif texte is not None:
+ jdc = getJDCFromTexte(texte,atraiter)
+ else:
+ raise ValueError("Traduction du JDC impossible")
+
+ #Parse les mocles des commandes
+ parseKeywords(jdc.root)
+ GenereErreurPourCommande(jdc,('Algorithm','AlgorithmParameters','FunctionDict'))
+ # ==========================================================================
+
+ for command in atraiter:
+ # Insere le MC s'il n'existe pas
+ chercheOperInsereFacteurSiRegle(jdc, command, "AlgorithmParameters",((("AlgorithmParameters",),"nexistepasMCFParmi"),))
+ # Deplace le MC
+ moveMotClefInOperToFact(jdc, command, "Algorithm", "AlgorithmParameters", plusieursFois=False)
+ # Renomme le MC
+ renameMotCleInFact(jdc, command, "AlgorithmParameters", "INPUT_TYPE", "Parameters")
+ # Renomme le MC
+ renameMotCle(jdc, command, "Study_name", "StudyName")
+ renameMotCle(jdc, command, "Study_repertory", "StudyRepertory")
+
+ # ==========================================================================
+ fsrc = jdc.getSource()
+ fsrc = re.sub( "FunctionDict", "ScriptWithSwitch", fsrc )
+ fsrc = re.sub( "FUNCTIONDICT_FILE", "SCRIPTWITHSWITCH_FILE", fsrc )
+ fsrc = re.sub( "#VERSION_CATALOGUE:.*:FIN VERSION_CATALOGUE", "#VERSION_CATALOGUE:%s:FIN VERSION_CATALOGUE"%version_out, fsrc)
+ fsrc = re.sub( "#CHECKSUM.*FIN CHECKSUM", "", fsrc )
+ #
+ log.ferme(hdlr)
+ if outfile is not None:
+ f=open(outfile,'w')
+ f.write( fsrc )
+ f.close()
+ else:
+ return fsrc
+
+class MonTraducteur:
+ def __init__(self,texte):
+ self.__texte = str(texte)
+ def traduit(self):
+ return traduc(infile=None,outfile=None,texte=self.__texte,flog=None)
+
+def main():
+ parser = optparse.OptionParser(usage=usage)
+
+ parser.add_option('-i','--infile', dest="infile",
+ help="Le fichier COMM en entree, a traduire")
+ parser.add_option('-o','--outfile', dest="outfile", default='out.comm',
+ help="Le fichier COMM en sortie, traduit")
+
+ options, args = parser.parse_args()
+ if len(options.infile) == 0:
+ print
+ parser.print_help()
+ print
+ sys.exit(1)
+
+ traduc(options.infile,options.outfile)
+
+if __name__ == '__main__':
+ main()
+++ /dev/null
-#-*-coding:iso-8859-1-*-
-#
-# Copyright (C) 2008-2016 EDF R&D
-#
-# This file is part of SALOME ADAO module
-#
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 2.1 of the License.
-#
-# This library 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
-# Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-#
-# Author: Jean-Philippe Argaud, jean-philippe.argaud@edf.fr, EDF R&D
-
-import optparse
-import sys
-import re
-
-import Traducteur.log as log
-from Traducteur.load import getJDC, getJDCFromTexte
-from Traducteur.mocles import parseKeywords
-from Traducteur.dictErreurs import GenereErreurPourCommande
-from Traducteur.inseremocle import *
-from Traducteur.movemocle import *
-from Traducteur.renamemocle import *
-
-version_out = "V8_1_0"
-
-usage="""Usage: python %prog [options]
-
-Typical use is:
- python %prog --infile=xxxx.comm --outfile=yyyy.comm"""
-
-atraiter = (
- "ASSIMILATION_STUDY",
- "CHECKING_STUDY",
- )
-
-dict_erreurs = {
- "ASSIMILATION_STUDY":"Changements dans l'arbre et dans les noms",
- "CHECKING_STUDY":"Changements dans l'arbre et dans les noms",
- }
-
-sys.dict_erreurs=dict_erreurs
-
-def traduc(infile=None,outfile=None,texte=None,flog=None):
- hdlr = log.initialise(flog)
- if infile is not None:
- jdc = getJDC(infile,atraiter)
- elif texte is not None:
- jdc = getJDCFromTexte(texte,atraiter)
- else:
- raise ValueError("Traduction du JDC impossible")
-
- #Parse les mocles des commandes
- parseKeywords(jdc.root)
- GenereErreurPourCommande(jdc,('Algorithm','AlgorithmParameters','FunctionDict'))
- # ==========================================================================
-
- for command in atraiter:
- # Insere le MC s'il n'existe pas
- chercheOperInsereFacteurSiRegle(jdc, command, "AlgorithmParameters",((("AlgorithmParameters",),"nexistepasMCFParmi"),))
- # Deplace le MC
- moveMotClefInOperToFact(jdc, command, "Algorithm", "AlgorithmParameters", plusieursFois=False)
- # Renomme le MC
- renameMotCleInFact(jdc, command, "AlgorithmParameters", "INPUT_TYPE", "Parameters")
- # Renomme le MC
- renameMotCle(jdc, command, "Study_name", "StudyName")
- renameMotCle(jdc, command, "Study_repertory", "StudyRepertory")
-
- # ==========================================================================
- fsrc = jdc.getSource()
- fsrc = re.sub( "FunctionDict", "ScriptWithSwitch", fsrc )
- fsrc = re.sub( "FUNCTIONDICT_FILE", "SCRIPTWITHSWITCH_FILE", fsrc )
- fsrc = re.sub( "#VERSION_CATALOGUE:.*:FIN VERSION_CATALOGUE", "#VERSION_CATALOGUE:%s:FIN VERSION_CATALOGUE"%version_out, fsrc)
- fsrc = re.sub( "#CHECKSUM.*FIN CHECKSUM", "", fsrc )
- #
- log.ferme(hdlr)
- if outfile is not None:
- f=open(outfile,'w')
- f.write( fsrc )
- f.close()
- else:
- return fsrc
-
-class MonTraducteur:
- def __init__(self,texte):
- self.__texte = str(texte)
- def traduit(self):
- return traduc(infile=None,outfile=None,texte=self.__texte,flog=None)
-
-def main():
- parser = optparse.OptionParser(usage=usage)
-
- parser.add_option('-i','--infile', dest="infile",
- help="Le fichier COMM en entree, a traduire")
- parser.add_option('-o','--outfile', dest="outfile", default='out.comm',
- help="Le fichier COMM en sortie, traduit")
-
- options, args = parser.parse_args()
- if len(options.infile) == 0:
- print
- parser.print_help()
- print
- sys.exit(1)
-
- traduc(options.infile,options.outfile)
-
-if __name__ == '__main__':
- main()
--- /dev/null
+#-*-coding:iso-8859-1-*-
+#
+# Copyright (C) 2008-2016 EDF R&D
+#
+# This file is part of SALOME ADAO module
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License.
+#
+# This library 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
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+#
+# Author: Jean-Philippe Argaud, jean-philippe.argaud@edf.fr, EDF R&D
+
+import optparse
+import sys
+import re
+
+import Traducteur.log as log
+from Traducteur.load import getJDC, getJDCFromTexte
+from Traducteur.mocles import parseKeywords
+from Traducteur.dictErreurs import GenereErreurPourCommande
+from Traducteur.inseremocle import *
+from Traducteur.movemocle import *
+from Traducteur.renamemocle import *
+
+version_out = "V8_2_0"
+
+usage="""Usage: python %prog [options]
+
+Typical use is:
+ python %prog --infile=xxxx.comm --outfile=yyyy.comm"""
+
+atraiter = (
+ "ASSIMILATION_STUDY",
+ "CHECKING_STUDY",
+ )
+
+dict_erreurs = {
+ "ASSIMILATION_STUDY":"Changements dans l'arbre et dans les noms",
+ "CHECKING_STUDY":"Changements dans l'arbre et dans les noms",
+ }
+
+sys.dict_erreurs=dict_erreurs
+
+def traduc(infile=None,outfile=None,texte=None,flog=None):
+ hdlr = log.initialise(flog)
+ if infile is not None:
+ jdc = getJDC(infile,atraiter)
+ elif texte is not None:
+ jdc = getJDCFromTexte(texte,atraiter)
+ else:
+ raise ValueError("Traduction du JDC impossible")
+
+ #Parse les mocles des commandes
+ parseKeywords(jdc.root)
+ GenereErreurPourCommande(jdc,('Algorithm','AlgorithmParameters','FunctionDict'))
+ # ==========================================================================
+
+ for command in atraiter:
+ # Insere le MC s'il n'existe pas
+ chercheOperInsereFacteurSiRegle(jdc, command, "AlgorithmParameters",((("AlgorithmParameters",),"nexistepasMCFParmi"),))
+ # Deplace le MC
+ moveMotClefInOperToFact(jdc, command, "Algorithm", "AlgorithmParameters", plusieursFois=False)
+ # Renomme le MC
+ renameMotCleInFact(jdc, command, "AlgorithmParameters", "INPUT_TYPE", "Parameters")
+ # Renomme le MC
+ renameMotCle(jdc, command, "Study_name", "StudyName")
+ renameMotCle(jdc, command, "Study_repertory", "StudyRepertory")
+
+ # ==========================================================================
+ fsrc = jdc.getSource()
+ fsrc = re.sub( "FunctionDict", "ScriptWithSwitch", fsrc )
+ fsrc = re.sub( "FUNCTIONDICT_FILE", "SCRIPTWITHSWITCH_FILE", fsrc )
+ fsrc = re.sub( "#VERSION_CATALOGUE:.*:FIN VERSION_CATALOGUE", "#VERSION_CATALOGUE:%s:FIN VERSION_CATALOGUE"%version_out, fsrc)
+ fsrc = re.sub( "#CHECKSUM.*FIN CHECKSUM", "", fsrc )
+ #
+ log.ferme(hdlr)
+ if outfile is not None:
+ f=open(outfile,'w')
+ f.write( fsrc )
+ f.close()
+ else:
+ return fsrc
+
+class MonTraducteur:
+ def __init__(self,texte):
+ self.__texte = str(texte)
+ def traduit(self):
+ return traduc(infile=None,outfile=None,texte=self.__texte,flog=None)
+
+def main():
+ parser = optparse.OptionParser(usage=usage)
+
+ parser.add_option('-i','--infile', dest="infile",
+ help="Le fichier COMM en entree, a traduire")
+ parser.add_option('-o','--outfile', dest="outfile", default='out.comm',
+ help="Le fichier COMM en sortie, traduit")
+
+ options, args = parser.parse_args()
+ if len(options.infile) == 0:
+ print
+ parser.print_help()
+ print
+ sys.exit(1)
+
+ traduc(options.infile,options.outfile)
+
+if __name__ == '__main__':
+ main()
+++ /dev/null
-#-*-coding:iso-8859-1-*-
-#
-# Copyright (C) 2008-2016 EDF R&D
-#
-# This file is part of SALOME ADAO module
-#
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 2.1 of the License.
-#
-# This library 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
-# Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-#
-# Author: Jean-Philippe Argaud, jean-philippe.argaud@edf.fr, EDF R&D
-
-import optparse
-import sys
-import re
-
-import Traducteur.log as log
-from Traducteur.load import getJDC, getJDCFromTexte
-from Traducteur.mocles import parseKeywords
-from Traducteur.dictErreurs import GenereErreurPourCommande
-from Traducteur.inseremocle import *
-from Traducteur.movemocle import *
-from Traducteur.renamemocle import *
-
-version_out = "V8_1_0"
-
-usage="""Usage: python %prog [options]
-
-Typical use is:
- python %prog --infile=xxxx.comm --outfile=yyyy.comm"""
-
-atraiter = (
- "ASSIMILATION_STUDY",
- "CHECKING_STUDY",
- )
-
-dict_erreurs = {
- "ASSIMILATION_STUDY":"Changements dans l'arbre et dans les noms",
- "CHECKING_STUDY":"Changements dans l'arbre et dans les noms",
- }
-
-sys.dict_erreurs=dict_erreurs
-
-def traduc(infile=None,outfile=None,texte=None,flog=None):
- hdlr = log.initialise(flog)
- if infile is not None:
- jdc = getJDC(infile,atraiter)
- elif texte is not None:
- jdc = getJDCFromTexte(texte,atraiter)
- else:
- raise ValueError("Traduction du JDC impossible")
-
- #Parse les mocles des commandes
- parseKeywords(jdc.root)
- GenereErreurPourCommande(jdc,('Algorithm','AlgorithmParameters','FunctionDict'))
- # ==========================================================================
-
- for command in atraiter:
- # Insere le MC s'il n'existe pas
- chercheOperInsereFacteurSiRegle(jdc, command, "AlgorithmParameters",((("AlgorithmParameters",),"nexistepasMCFParmi"),))
- # Deplace le MC
- moveMotClefInOperToFact(jdc, command, "Algorithm", "AlgorithmParameters", plusieursFois=False)
- # Renomme le MC
- renameMotCleInFact(jdc, command, "AlgorithmParameters", "INPUT_TYPE", "Parameters")
- # Renomme le MC
- renameMotCle(jdc, command, "Study_name", "StudyName")
- renameMotCle(jdc, command, "Study_repertory", "StudyRepertory")
-
- # ==========================================================================
- fsrc = jdc.getSource()
- fsrc = re.sub( "FunctionDict", "ScriptWithSwitch", fsrc )
- fsrc = re.sub( "FUNCTIONDICT_FILE", "SCRIPTWITHSWITCH_FILE", fsrc )
- fsrc = re.sub( "#VERSION_CATALOGUE:.*:FIN VERSION_CATALOGUE", "#VERSION_CATALOGUE:%s:FIN VERSION_CATALOGUE"%version_out, fsrc)
- fsrc = re.sub( "#CHECKSUM.*FIN CHECKSUM", "", fsrc )
- #
- log.ferme(hdlr)
- if outfile is not None:
- f=open(outfile,'w')
- f.write( fsrc )
- f.close()
- else:
- return fsrc
-
-class MonTraducteur:
- def __init__(self,texte):
- self.__texte = str(texte)
- def traduit(self):
- return traduc(infile=None,outfile=None,texte=self.__texte,flog=None)
-
-def main():
- parser = optparse.OptionParser(usage=usage)
-
- parser.add_option('-i','--infile', dest="infile",
- help="Le fichier COMM en entree, a traduire")
- parser.add_option('-o','--outfile', dest="outfile", default='out.comm',
- help="Le fichier COMM en sortie, traduit")
-
- options, args = parser.parse_args()
- if len(options.infile) == 0:
- print
- parser.print_help()
- print
- sys.exit(1)
-
- traduc(options.infile,options.outfile)
-
-if __name__ == '__main__':
- main()
--- /dev/null
+#-*-coding:iso-8859-1-*-
+#
+# Copyright (C) 2008-2016 EDF R&D
+#
+# This file is part of SALOME ADAO module
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License.
+#
+# This library 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
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+#
+# Author: Jean-Philippe Argaud, jean-philippe.argaud@edf.fr, EDF R&D
+
+import optparse
+import sys
+import re
+
+import Traducteur.log as log
+from Traducteur.load import getJDC, getJDCFromTexte
+from Traducteur.mocles import parseKeywords
+from Traducteur.dictErreurs import GenereErreurPourCommande
+from Traducteur.inseremocle import *
+from Traducteur.movemocle import *
+from Traducteur.renamemocle import *
+
+version_out = "V8_2_0"
+
+usage="""Usage: python %prog [options]
+
+Typical use is:
+ python %prog --infile=xxxx.comm --outfile=yyyy.comm"""
+
+atraiter = (
+ "ASSIMILATION_STUDY",
+ "CHECKING_STUDY",
+ )
+
+dict_erreurs = {
+ "ASSIMILATION_STUDY":"Changements dans l'arbre et dans les noms",
+ "CHECKING_STUDY":"Changements dans l'arbre et dans les noms",
+ }
+
+sys.dict_erreurs=dict_erreurs
+
+def traduc(infile=None,outfile=None,texte=None,flog=None):
+ hdlr = log.initialise(flog)
+ if infile is not None:
+ jdc = getJDC(infile,atraiter)
+ elif texte is not None:
+ jdc = getJDCFromTexte(texte,atraiter)
+ else:
+ raise ValueError("Traduction du JDC impossible")
+
+ #Parse les mocles des commandes
+ parseKeywords(jdc.root)
+ GenereErreurPourCommande(jdc,('Algorithm','AlgorithmParameters','FunctionDict'))
+ # ==========================================================================
+
+ for command in atraiter:
+ # Insere le MC s'il n'existe pas
+ chercheOperInsereFacteurSiRegle(jdc, command, "AlgorithmParameters",((("AlgorithmParameters",),"nexistepasMCFParmi"),))
+ # Deplace le MC
+ moveMotClefInOperToFact(jdc, command, "Algorithm", "AlgorithmParameters", plusieursFois=False)
+ # Renomme le MC
+ renameMotCleInFact(jdc, command, "AlgorithmParameters", "INPUT_TYPE", "Parameters")
+ # Renomme le MC
+ renameMotCle(jdc, command, "Study_name", "StudyName")
+ renameMotCle(jdc, command, "Study_repertory", "StudyRepertory")
+
+ # ==========================================================================
+ fsrc = jdc.getSource()
+ fsrc = re.sub( "FunctionDict", "ScriptWithSwitch", fsrc )
+ fsrc = re.sub( "FUNCTIONDICT_FILE", "SCRIPTWITHSWITCH_FILE", fsrc )
+ fsrc = re.sub( "#VERSION_CATALOGUE:.*:FIN VERSION_CATALOGUE", "#VERSION_CATALOGUE:%s:FIN VERSION_CATALOGUE"%version_out, fsrc)
+ fsrc = re.sub( "#CHECKSUM.*FIN CHECKSUM", "", fsrc )
+ #
+ log.ferme(hdlr)
+ if outfile is not None:
+ f=open(outfile,'w')
+ f.write( fsrc )
+ f.close()
+ else:
+ return fsrc
+
+class MonTraducteur:
+ def __init__(self,texte):
+ self.__texte = str(texte)
+ def traduit(self):
+ return traduc(infile=None,outfile=None,texte=self.__texte,flog=None)
+
+def main():
+ parser = optparse.OptionParser(usage=usage)
+
+ parser.add_option('-i','--infile', dest="infile",
+ help="Le fichier COMM en entree, a traduire")
+ parser.add_option('-o','--outfile', dest="outfile", default='out.comm',
+ help="Le fichier COMM en sortie, traduit")
+
+ options, args = parser.parse_args()
+ if len(options.infile) == 0:
+ print
+ parser.print_help()
+ print
+ sys.exit(1)
+
+ traduc(options.infile,options.outfile)
+
+if __name__ == '__main__':
+ main()
+++ /dev/null
-#-*-coding:iso-8859-1-*-
-#
-# Copyright (C) 2008-2016 EDF R&D
-#
-# This file is part of SALOME ADAO module
-#
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 2.1 of the License.
-#
-# This library 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
-# Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-#
-# Author: Jean-Philippe Argaud, jean-philippe.argaud@edf.fr, EDF R&D
-
-import optparse
-import sys
-import re
-
-import Traducteur.log as log
-from Traducteur.load import getJDC, getJDCFromTexte
-from Traducteur.mocles import parseKeywords
-from Traducteur.dictErreurs import GenereErreurPourCommande
-from Traducteur.inseremocle import *
-from Traducteur.movemocle import *
-from Traducteur.renamemocle import *
-
-version_out = "V8_1_0"
-
-usage="""Usage: python %prog [options]
-
-Typical use is:
- python %prog --infile=xxxx.comm --outfile=yyyy.comm"""
-
-atraiter = (
- )
-
-dict_erreurs = {
- }
-
-sys.dict_erreurs=dict_erreurs
-
-def traduc(infile=None,outfile=None,texte=None,flog=None):
- hdlr = log.initialise(flog)
- if infile is not None:
- jdc = getJDC(infile,atraiter)
- elif texte is not None:
- jdc = getJDCFromTexte(texte,atraiter)
- else:
- raise ValueError("Traduction du JDC impossible")
- # ==========================================================================
-
-
- # ==========================================================================
- fsrc = jdc.getSource()
- fsrc = re.sub( "#VERSION_CATALOGUE:.*:FIN VERSION_CATALOGUE", "#VERSION_CATALOGUE:%s:FIN VERSION_CATALOGUE"%version_out, fsrc)
- fsrc = re.sub( "#CHECKSUM.*FIN CHECKSUM", "", fsrc )
- #
- log.ferme(hdlr)
- if outfile is not None:
- f=open(outfile,'w')
- f.write( fsrc )
- f.close()
- else:
- return fsrc
-
-class MonTraducteur:
- def __init__(self,texte):
- self.__texte = str(texte)
- def traduit(self):
- return traduc(infile=None,outfile=None,texte=self.__texte,flog=None)
-
-def main():
- parser = optparse.OptionParser(usage=usage)
-
- parser.add_option('-i','--infile', dest="infile",
- help="Le fichier COMM en entree, a traduire")
- parser.add_option('-o','--outfile', dest="outfile", default='out.comm',
- help="Le fichier COMM en sortie, traduit")
-
- options, args = parser.parse_args()
- if len(options.infile) == 0:
- print
- parser.print_help()
- print
- sys.exit(1)
-
- traduc(options.infile,options.outfile)
-
-if __name__ == '__main__':
- main()
--- /dev/null
+#-*-coding:iso-8859-1-*-
+#
+# Copyright (C) 2008-2016 EDF R&D
+#
+# This file is part of SALOME ADAO module
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License.
+#
+# This library 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
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+#
+# Author: Jean-Philippe Argaud, jean-philippe.argaud@edf.fr, EDF R&D
+
+import optparse
+import sys
+import re
+
+import Traducteur.log as log
+from Traducteur.load import getJDC, getJDCFromTexte
+from Traducteur.mocles import parseKeywords
+from Traducteur.dictErreurs import GenereErreurPourCommande
+from Traducteur.inseremocle import *
+from Traducteur.movemocle import *
+from Traducteur.renamemocle import *
+
+version_out = "V8_2_0"
+
+usage="""Usage: python %prog [options]
+
+Typical use is:
+ python %prog --infile=xxxx.comm --outfile=yyyy.comm"""
+
+atraiter = (
+ )
+
+dict_erreurs = {
+ }
+
+sys.dict_erreurs=dict_erreurs
+
+def traduc(infile=None,outfile=None,texte=None,flog=None):
+ hdlr = log.initialise(flog)
+ if infile is not None:
+ jdc = getJDC(infile,atraiter)
+ elif texte is not None:
+ jdc = getJDCFromTexte(texte,atraiter)
+ else:
+ raise ValueError("Traduction du JDC impossible")
+ # ==========================================================================
+
+
+ # ==========================================================================
+ fsrc = jdc.getSource()
+ fsrc = re.sub( "#VERSION_CATALOGUE:.*:FIN VERSION_CATALOGUE", "#VERSION_CATALOGUE:%s:FIN VERSION_CATALOGUE"%version_out, fsrc)
+ fsrc = re.sub( "#CHECKSUM.*FIN CHECKSUM", "", fsrc )
+ #
+ log.ferme(hdlr)
+ if outfile is not None:
+ f=open(outfile,'w')
+ f.write( fsrc )
+ f.close()
+ else:
+ return fsrc
+
+class MonTraducteur:
+ def __init__(self,texte):
+ self.__texte = str(texte)
+ def traduit(self):
+ return traduc(infile=None,outfile=None,texte=self.__texte,flog=None)
+
+def main():
+ parser = optparse.OptionParser(usage=usage)
+
+ parser.add_option('-i','--infile', dest="infile",
+ help="Le fichier COMM en entree, a traduire")
+ parser.add_option('-o','--outfile', dest="outfile", default='out.comm',
+ help="Le fichier COMM en sortie, traduit")
+
+ options, args = parser.parse_args()
+ if len(options.infile) == 0:
+ print
+ parser.print_help()
+ print
+ sys.exit(1)
+
+ traduc(options.infile,options.outfile)
+
+if __name__ == '__main__':
+ main()
+++ /dev/null
-#-*-coding:iso-8859-1-*-
-#
-# Copyright (C) 2008-2016 EDF R&D
-#
-# This file is part of SALOME ADAO module
-#
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 2.1 of the License.
-#
-# This library 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
-# Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-#
-# Author: Jean-Philippe Argaud, jean-philippe.argaud@edf.fr, EDF R&D
-
-import optparse
-import sys
-import re
-
-import Traducteur.log as log
-from Traducteur.load import getJDC, getJDCFromTexte
-from Traducteur.mocles import parseKeywords
-from Traducteur.dictErreurs import GenereErreurPourCommande
-from Traducteur.inseremocle import *
-from Traducteur.movemocle import *
-from Traducteur.renamemocle import *
-
-version_out = "V8_1_0"
-
-usage="""Usage: python %prog [options]
-
-Typical use is:
- python %prog --infile=xxxx.comm --outfile=yyyy.comm"""
-
-atraiter = (
- )
-
-dict_erreurs = {
- }
-
-sys.dict_erreurs=dict_erreurs
-
-def traduc(infile=None,outfile=None,texte=None,flog=None):
- hdlr = log.initialise(flog)
- if infile is not None:
- jdc = getJDC(infile,atraiter)
- elif texte is not None:
- jdc = getJDCFromTexte(texte,atraiter)
- else:
- raise ValueError("Traduction du JDC impossible")
- # ==========================================================================
-
-
- # ==========================================================================
- fsrc = jdc.getSource()
- fsrc = re.sub( "#VERSION_CATALOGUE:.*:FIN VERSION_CATALOGUE", "#VERSION_CATALOGUE:%s:FIN VERSION_CATALOGUE"%version_out, fsrc)
- fsrc = re.sub( "#CHECKSUM.*FIN CHECKSUM", "", fsrc )
- #
- log.ferme(hdlr)
- if outfile is not None:
- f=open(outfile,'w')
- f.write( fsrc )
- f.close()
- else:
- return fsrc
-
-class MonTraducteur:
- def __init__(self,texte):
- self.__texte = str(texte)
- def traduit(self):
- return traduc(infile=None,outfile=None,texte=self.__texte,flog=None)
-
-def main():
- parser = optparse.OptionParser(usage=usage)
-
- parser.add_option('-i','--infile', dest="infile",
- help="Le fichier COMM en entree, a traduire")
- parser.add_option('-o','--outfile', dest="outfile", default='out.comm',
- help="Le fichier COMM en sortie, traduit")
-
- options, args = parser.parse_args()
- if len(options.infile) == 0:
- print
- parser.print_help()
- print
- sys.exit(1)
-
- traduc(options.infile,options.outfile)
-
-if __name__ == '__main__':
- main()
--- /dev/null
+#-*-coding:iso-8859-1-*-
+#
+# Copyright (C) 2008-2016 EDF R&D
+#
+# This file is part of SALOME ADAO module
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License.
+#
+# This library 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
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+#
+# Author: Jean-Philippe Argaud, jean-philippe.argaud@edf.fr, EDF R&D
+
+import optparse
+import sys
+import re
+
+import Traducteur.log as log
+from Traducteur.load import getJDC, getJDCFromTexte
+from Traducteur.mocles import parseKeywords
+from Traducteur.dictErreurs import GenereErreurPourCommande
+from Traducteur.inseremocle import *
+from Traducteur.movemocle import *
+from Traducteur.renamemocle import *
+
+version_out = "V8_2_0"
+
+usage="""Usage: python %prog [options]
+
+Typical use is:
+ python %prog --infile=xxxx.comm --outfile=yyyy.comm"""
+
+atraiter = (
+ )
+
+dict_erreurs = {
+ }
+
+sys.dict_erreurs=dict_erreurs
+
+def traduc(infile=None,outfile=None,texte=None,flog=None):
+ hdlr = log.initialise(flog)
+ if infile is not None:
+ jdc = getJDC(infile,atraiter)
+ elif texte is not None:
+ jdc = getJDCFromTexte(texte,atraiter)
+ else:
+ raise ValueError("Traduction du JDC impossible")
+ # ==========================================================================
+
+
+ # ==========================================================================
+ fsrc = jdc.getSource()
+ fsrc = re.sub( "#VERSION_CATALOGUE:.*:FIN VERSION_CATALOGUE", "#VERSION_CATALOGUE:%s:FIN VERSION_CATALOGUE"%version_out, fsrc)
+ fsrc = re.sub( "#CHECKSUM.*FIN CHECKSUM", "", fsrc )
+ #
+ log.ferme(hdlr)
+ if outfile is not None:
+ f=open(outfile,'w')
+ f.write( fsrc )
+ f.close()
+ else:
+ return fsrc
+
+class MonTraducteur:
+ def __init__(self,texte):
+ self.__texte = str(texte)
+ def traduit(self):
+ return traduc(infile=None,outfile=None,texte=self.__texte,flog=None)
+
+def main():
+ parser = optparse.OptionParser(usage=usage)
+
+ parser.add_option('-i','--infile', dest="infile",
+ help="Le fichier COMM en entree, a traduire")
+ parser.add_option('-o','--outfile', dest="outfile", default='out.comm',
+ help="Le fichier COMM en sortie, traduit")
+
+ options, args = parser.parse_args()
+ if len(options.infile) == 0:
+ print
+ parser.print_help()
+ print
+ sys.exit(1)
+
+ traduc(options.infile,options.outfile)
+
+if __name__ == '__main__':
+ main()
+++ /dev/null
-#-*-coding:iso-8859-1-*-
-#
-# Copyright (C) 2008-2016 EDF R&D
-#
-# This file is part of SALOME ADAO module
-#
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 2.1 of the License.
-#
-# This library 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
-# Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-#
-# Author: Jean-Philippe Argaud, jean-philippe.argaud@edf.fr, EDF R&D
-
-import optparse
-import sys
-import re
-
-import Traducteur.log as log
-from Traducteur.load import getJDC, getJDCFromTexte
-from Traducteur.mocles import parseKeywords
-from Traducteur.dictErreurs import GenereErreurPourCommande
-from Traducteur.inseremocle import *
-from Traducteur.movemocle import *
-from Traducteur.renamemocle import *
-
-version_out = "V8_1_0"
-
-usage="""Usage: python %prog [options]
-
-Typical use is:
- python %prog --infile=xxxx.comm --outfile=yyyy.comm"""
-
-atraiter = (
- )
-
-dict_erreurs = {
- }
-
-sys.dict_erreurs=dict_erreurs
-
-def traduc(infile=None,outfile=None,texte=None,flog=None):
- hdlr = log.initialise(flog)
- if infile is not None:
- jdc = getJDC(infile,atraiter)
- elif texte is not None:
- jdc = getJDCFromTexte(texte,atraiter)
- else:
- raise ValueError("Traduction du JDC impossible")
- # ==========================================================================
-
-
- # ==========================================================================
- fsrc = jdc.getSource()
- fsrc = re.sub( "#VERSION_CATALOGUE:.*:FIN VERSION_CATALOGUE", "#VERSION_CATALOGUE:%s:FIN VERSION_CATALOGUE"%version_out, fsrc)
- fsrc = re.sub( "#CHECKSUM.*FIN CHECKSUM", "", fsrc )
- #
- log.ferme(hdlr)
- if outfile is not None:
- f=open(outfile,'w')
- f.write( fsrc )
- f.close()
- else:
- return fsrc
-
-class MonTraducteur:
- def __init__(self,texte):
- self.__texte = str(texte)
- def traduit(self):
- return traduc(infile=None,outfile=None,texte=self.__texte,flog=None)
-
-def main():
- parser = optparse.OptionParser(usage=usage)
-
- parser.add_option('-i','--infile', dest="infile",
- help="Le fichier COMM en entree, a traduire")
- parser.add_option('-o','--outfile', dest="outfile", default='out.comm',
- help="Le fichier COMM en sortie, traduit")
-
- options, args = parser.parse_args()
- if len(options.infile) == 0:
- print
- parser.print_help()
- print
- sys.exit(1)
-
- traduc(options.infile,options.outfile)
-
-if __name__ == '__main__':
- main()
--- /dev/null
+#-*-coding:iso-8859-1-*-
+#
+# Copyright (C) 2008-2016 EDF R&D
+#
+# This file is part of SALOME ADAO module
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License.
+#
+# This library 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
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+#
+# Author: Jean-Philippe Argaud, jean-philippe.argaud@edf.fr, EDF R&D
+
+import optparse
+import sys
+import re
+
+import Traducteur.log as log
+from Traducteur.load import getJDC, getJDCFromTexte
+from Traducteur.mocles import parseKeywords
+from Traducteur.dictErreurs import GenereErreurPourCommande
+from Traducteur.inseremocle import *
+from Traducteur.movemocle import *
+from Traducteur.renamemocle import *
+
+version_out = "V8_2_0"
+
+usage="""Usage: python %prog [options]
+
+Typical use is:
+ python %prog --infile=xxxx.comm --outfile=yyyy.comm"""
+
+atraiter = (
+ )
+
+dict_erreurs = {
+ }
+
+sys.dict_erreurs=dict_erreurs
+
+def traduc(infile=None,outfile=None,texte=None,flog=None):
+ hdlr = log.initialise(flog)
+ if infile is not None:
+ jdc = getJDC(infile,atraiter)
+ elif texte is not None:
+ jdc = getJDCFromTexte(texte,atraiter)
+ else:
+ raise ValueError("Traduction du JDC impossible")
+ # ==========================================================================
+
+
+ # ==========================================================================
+ fsrc = jdc.getSource()
+ fsrc = re.sub( "#VERSION_CATALOGUE:.*:FIN VERSION_CATALOGUE", "#VERSION_CATALOGUE:%s:FIN VERSION_CATALOGUE"%version_out, fsrc)
+ fsrc = re.sub( "#CHECKSUM.*FIN CHECKSUM", "", fsrc )
+ #
+ log.ferme(hdlr)
+ if outfile is not None:
+ f=open(outfile,'w')
+ f.write( fsrc )
+ f.close()
+ else:
+ return fsrc
+
+class MonTraducteur:
+ def __init__(self,texte):
+ self.__texte = str(texte)
+ def traduit(self):
+ return traduc(infile=None,outfile=None,texte=self.__texte,flog=None)
+
+def main():
+ parser = optparse.OptionParser(usage=usage)
+
+ parser.add_option('-i','--infile', dest="infile",
+ help="Le fichier COMM en entree, a traduire")
+ parser.add_option('-o','--outfile', dest="outfile", default='out.comm',
+ help="Le fichier COMM en sortie, traduit")
+
+ options, args = parser.parse_args()
+ if len(options.infile) == 0:
+ print
+ parser.print_help()
+ print
+ sys.exit(1)
+
+ traduc(options.infile,options.outfile)
+
+if __name__ == '__main__':
+ main()
+++ /dev/null
-#-*-coding:iso-8859-1-*-
-#
-# Copyright (C) 2008-2016 EDF R&D
-#
-# This file is part of SALOME ADAO module
-#
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 2.1 of the License.
-#
-# This library 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
-# Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-#
-# Author: Jean-Philippe Argaud, jean-philippe.argaud@edf.fr, EDF R&D
-
-import optparse
-import sys
-import re
-
-import Traducteur.log as log
-from Traducteur.load import getJDC, getJDCFromTexte
-from Traducteur.mocles import parseKeywords
-from Traducteur.dictErreurs import GenereErreurPourCommande
-from Traducteur.inseremocle import *
-from Traducteur.movemocle import *
-from Traducteur.renamemocle import *
-
-version_out = "V8_1_0"
-
-usage="""Usage: python %prog [options]
-
-Typical use is:
- python %prog --infile=xxxx.comm --outfile=yyyy.comm"""
-
-atraiter = (
- "ASSIMILATION_STUDY",
- "CHECKING_STUDY",
- )
-
-dict_erreurs = {
- "ASSIMILATION_STUDY":"Changements dans l'arbre et dans les noms",
- "CHECKING_STUDY":"Changements dans l'arbre et dans les noms",
- }
-
-sys.dict_erreurs=dict_erreurs
-
-def traduc(infile=None,outfile=None,texte=None,flog=None):
- hdlr = log.initialise(flog)
- if infile is not None:
- jdc = getJDC(infile,atraiter)
- elif texte is not None:
- jdc = getJDCFromTexte(texte,atraiter)
- else:
- raise ValueError("Traduction du JDC impossible")
-
- #Parse les mocles des commandes
- parseKeywords(jdc.root)
- GenereErreurPourCommande(jdc,('Algorithm','AlgorithmParameters','FunctionDict'))
- # ==========================================================================
-
- for command in atraiter:
- # Insere le MC s'il n'existe pas
- chercheOperInsereFacteurSiRegle(jdc, command, "AlgorithmParameters",((("AlgorithmParameters",),"nexistepasMCFParmi"),))
- # Deplace le MC
- moveMotClefInOperToFact(jdc, command, "Algorithm", "AlgorithmParameters", plusieursFois=False)
- # Renomme le MC
- renameMotCleInFact(jdc, command, "AlgorithmParameters", "INPUT_TYPE", "Parameters")
- # Renomme le MC
- renameMotCle(jdc, command, "Study_name", "StudyName")
- renameMotCle(jdc, command, "Study_repertory", "StudyRepertory")
-
- # ==========================================================================
- fsrc = jdc.getSource()
- fsrc = re.sub( "FunctionDict", "ScriptWithSwitch", fsrc )
- fsrc = re.sub( "FUNCTIONDICT_FILE", "SCRIPTWITHSWITCH_FILE", fsrc )
- fsrc = re.sub( "#VERSION_CATALOGUE:.*:FIN VERSION_CATALOGUE", "#VERSION_CATALOGUE:%s:FIN VERSION_CATALOGUE"%version_out, fsrc)
- fsrc = re.sub( "#CHECKSUM.*FIN CHECKSUM", "", fsrc )
- #
- log.ferme(hdlr)
- if outfile is not None:
- f=open(outfile,'w')
- f.write( fsrc )
- f.close()
- else:
- return fsrc
-
-class MonTraducteur:
- def __init__(self,texte):
- self.__texte = str(texte)
- def traduit(self):
- return traduc(infile=None,outfile=None,texte=self.__texte,flog=None)
-
-def main():
- parser = optparse.OptionParser(usage=usage)
-
- parser.add_option('-i','--infile', dest="infile",
- help="Le fichier COMM en entree, a traduire")
- parser.add_option('-o','--outfile', dest="outfile", default='out.comm',
- help="Le fichier COMM en sortie, traduit")
-
- options, args = parser.parse_args()
- if len(options.infile) == 0:
- print
- parser.print_help()
- print
- sys.exit(1)
-
- traduc(options.infile,options.outfile)
-
-if __name__ == '__main__':
- main()
--- /dev/null
+#-*-coding:iso-8859-1-*-
+#
+# Copyright (C) 2008-2016 EDF R&D
+#
+# This file is part of SALOME ADAO module
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License.
+#
+# This library 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
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+#
+# Author: Jean-Philippe Argaud, jean-philippe.argaud@edf.fr, EDF R&D
+
+import optparse
+import sys
+import re
+
+import Traducteur.log as log
+from Traducteur.load import getJDC, getJDCFromTexte
+from Traducteur.mocles import parseKeywords
+from Traducteur.dictErreurs import GenereErreurPourCommande
+from Traducteur.inseremocle import *
+from Traducteur.movemocle import *
+from Traducteur.renamemocle import *
+
+version_out = "V8_2_0"
+
+usage="""Usage: python %prog [options]
+
+Typical use is:
+ python %prog --infile=xxxx.comm --outfile=yyyy.comm"""
+
+atraiter = (
+ "ASSIMILATION_STUDY",
+ "CHECKING_STUDY",
+ )
+
+dict_erreurs = {
+ "ASSIMILATION_STUDY":"Changements dans l'arbre et dans les noms",
+ "CHECKING_STUDY":"Changements dans l'arbre et dans les noms",
+ }
+
+sys.dict_erreurs=dict_erreurs
+
+def traduc(infile=None,outfile=None,texte=None,flog=None):
+ hdlr = log.initialise(flog)
+ if infile is not None:
+ jdc = getJDC(infile,atraiter)
+ elif texte is not None:
+ jdc = getJDCFromTexte(texte,atraiter)
+ else:
+ raise ValueError("Traduction du JDC impossible")
+
+ #Parse les mocles des commandes
+ parseKeywords(jdc.root)
+ GenereErreurPourCommande(jdc,('Algorithm','AlgorithmParameters','FunctionDict'))
+ # ==========================================================================
+
+ for command in atraiter:
+ # Insere le MC s'il n'existe pas
+ chercheOperInsereFacteurSiRegle(jdc, command, "AlgorithmParameters",((("AlgorithmParameters",),"nexistepasMCFParmi"),))
+ # Deplace le MC
+ moveMotClefInOperToFact(jdc, command, "Algorithm", "AlgorithmParameters", plusieursFois=False)
+ # Renomme le MC
+ renameMotCleInFact(jdc, command, "AlgorithmParameters", "INPUT_TYPE", "Parameters")
+ # Renomme le MC
+ renameMotCle(jdc, command, "Study_name", "StudyName")
+ renameMotCle(jdc, command, "Study_repertory", "StudyRepertory")
+
+ # ==========================================================================
+ fsrc = jdc.getSource()
+ fsrc = re.sub( "FunctionDict", "ScriptWithSwitch", fsrc )
+ fsrc = re.sub( "FUNCTIONDICT_FILE", "SCRIPTWITHSWITCH_FILE", fsrc )
+ fsrc = re.sub( "#VERSION_CATALOGUE:.*:FIN VERSION_CATALOGUE", "#VERSION_CATALOGUE:%s:FIN VERSION_CATALOGUE"%version_out, fsrc)
+ fsrc = re.sub( "#CHECKSUM.*FIN CHECKSUM", "", fsrc )
+ #
+ log.ferme(hdlr)
+ if outfile is not None:
+ f=open(outfile,'w')
+ f.write( fsrc )
+ f.close()
+ else:
+ return fsrc
+
+class MonTraducteur:
+ def __init__(self,texte):
+ self.__texte = str(texte)
+ def traduit(self):
+ return traduc(infile=None,outfile=None,texte=self.__texte,flog=None)
+
+def main():
+ parser = optparse.OptionParser(usage=usage)
+
+ parser.add_option('-i','--infile', dest="infile",
+ help="Le fichier COMM en entree, a traduire")
+ parser.add_option('-o','--outfile', dest="outfile", default='out.comm',
+ help="Le fichier COMM en sortie, traduit")
+
+ options, args = parser.parse_args()
+ if len(options.infile) == 0:
+ print
+ parser.print_help()
+ print
+ sys.exit(1)
+
+ traduc(options.infile,options.outfile)
+
+if __name__ == '__main__':
+ main()
#
SET(TEST_NAMES
- HelloWorld
+ Performances
)
FOREACH(tfile ${TEST_NAMES})
+++ /dev/null
-#!/usr/bin/env python
-
-print "Hello world 2!"
--- /dev/null
+#-*-coding:iso-8859-1-*-
+#
+# Copyright (C) 2008-2016 EDF R&D
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License.
+#
+# This library 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
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+#
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
+# Author: Jean-Philippe Argaud, jean-philippe.argaud@edf.fr, EDF R&D
+"Test de fonctionnement et de performances de Numpy et Scipy"
+
+# ==============================================================================
+import numpy, time
+numpy.set_printoptions(precision=5)
+
+def testSysteme():
+ print " Les caracteristiques des applications et outils systeme :"
+ import sys ; v=sys.version.split() ; print " - Python systeme....: %s"%v[0]
+ import numpy ; print " - Numpy.............: %s"%numpy.version.version
+ try:
+ import scipy ; print " - Scipy.............: %s"%scipy.version.version
+ except:
+ print " - Scipy.............: %s"%("absent",)
+ try:
+ import numpy.distutils.system_info as sysinfo ; la = sysinfo.get_info('lapack') ; print " - Lapack............: %s/lib%s.so"%(la['library_dirs'][0],la['libraries'][0])
+ except:
+ print " - Lapack............: %s"%("absent",)
+ print
+ return True
+
+def testNumpy01(dimension = 3, precision = 1.e-17, repetitions = 10):
+ "Test Numpy"
+ __d = int(dimension)
+ print " Taille du test..................................: %.0e"%__d
+ t_init = time.time()
+ A = numpy.array([numpy.arange(dimension)+1.,]*__d)
+ x = numpy.arange(__d)+1.
+ print " La duree elapsed moyenne de l'initialisation est: %4.1f s"%(time.time()-t_init)
+ #
+ t_init = time.time()
+ for i in range(repetitions):
+ b = numpy.dot(A,x)
+ print " La duree elapsed pour %3i produits est de.......: %4.1f s"%(repetitions, time.time()-t_init)
+ r = [__d*(__d+1.)*(2.*__d+1.)/6.,]*__d
+ if max(abs(b-r)) > precision:
+ raise ValueError("Resultat du test errone (1)")
+ else:
+ print " Test correct, erreur maximale inferieure a %s"%precision
+ print
+ del A, x, b
+
+def testNumpy02(dimension = 3, precision = 1.e-17, repetitions = 100):
+ "Test Numpy"
+ __d = int(dimension)
+ print " Taille du test..................................: %.0e"%__d
+ t_init = time.time()
+ A = numpy.random.normal(0.,1.,size=(__d,__d))
+ x = numpy.random.normal(0.,1.,size=(__d,))
+ print " La duree elapsed moyenne de l'initialisation est: %4.1f s"%(time.time()-t_init)
+ #
+ t_init = time.time()
+ for i in range(repetitions):
+ b = numpy.dot(A,x)
+ print " La duree elapsed pour %3i produits est de.......: %4.1f s"%(repetitions, time.time()-t_init)
+ print
+ del A, x, b
+
+# ==============================================================================
+if __name__ == "__main__":
+ print '\n AUTODIAGNOSTIC \n'
+ testSysteme()
+ numpy.random.seed(1000)
+ testNumpy01(dimension = 1.e4)
+ testNumpy02(dimension = 3.e3)
+ print