doc/en/Makefile
doc/fr/Makefile
test/Makefile
+ i18n/Makefile
])
AC_OUTPUT
is to read the old ADAO case file with the new SALOME/ADAO module, and save it
with a new name.
+To make future developments easier, it is strongly recommended to ensure that
+your user scripts files use a Python 2 and a Python 3 compatible syntax. In
+particular, it is recommended to use the functional syntax for "*print*" and not
+the "*command*" syntax, for example:
+
+ # Python 2 & 3
+ x, unit = 1., "cm"
+ print( "x = %s %s"%(str(x),str(unit)) )
+
+or::
+
+ # Python 2 & 3
+ x, unit = 1., "cm"
+ print( "x = {0} {1}".format(str(x),str(unit)) )
+
+rather than::
+
+ # Python 2 only
+ x, unit = 1., "cm"
+ print "x =", x, unit
+
Switching from 7.8 to 8.1
+++++++++++++++++++++++++
procédure de montée en version consiste à lire l'ancien fichier de cas ADAO
avec le nouveau module SALOME/ADAO, et à l'enregistrer avec un nouveau nom.
+Pour faciliter les futures évolutions, il est fortement recommandé de veiller à
+ce que vos fichiers scripts utilisateurs utilisent une syntaxe compatibible avec
+Python 2 et avec Python 3. En particulier, on recommande d'utiliser la syntaxe
+fonctionnelle pour les "*print*" et non pas la syntaxe "*commande*", comme par
+exemple::
+
+ # Python 2 & 3
+ x, unit = 1., "cm"
+ print( "x = %s %s"%(str(x),str(unit)) )
+
+ou::
+
+ # Python 2 & 3
+ x, unit = 1., "cm"
+ print( "x = {0} {1}".format(str(x),str(unit)) )
+
+plutôt que::
+
+ # Python 2 uniquement
+ x, unit = 1., "cm"
+ print "x =", x, unit
+
Passer de la version 7.8 à la 8.1
+++++++++++++++++++++++++++++++++
--- /dev/null
+# Copyright (C) 2008-2017 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
+#
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
+# Author: Jean-Philippe Argaud, jean-philippe.argaud@edf.fr, EDF R&D
+
+include $(top_srcdir)/adm_local/make_common_starter.am
+
+DATA_INST = adao_en.qm adao_fr.qm
+
+salomeres_DATA = ${DATA_INST}
+EXTRA_DIST = ${DATA_INST}
def _pre_run(self, Parameters ):
"Pré-calcul"
logging.debug("%s Lancement", self._name)
- logging.debug("%s Taille mémoire utilisée de %.1f Mio", self._name, self._m.getUsedMemory("Mio"))
+ logging.debug("%s Taille mémoire utilisée de %.0f Mio", self._name, self._m.getUsedMemory("Mio"))
#
# Mise a jour de self._parameters avec Parameters
self.__setParameters(Parameters)
if _oH is not None:
logging.debug("%s Nombre d'évaluation(s) de l'opérateur d'observation direct/tangent/adjoint.: %i/%i/%i", self._name, _oH["Direct"].nbcalls(0),_oH["Tangent"].nbcalls(0),_oH["Adjoint"].nbcalls(0))
logging.debug("%s Nombre d'appels au cache d'opérateur d'observation direct/tangent/adjoint..: %i/%i/%i", self._name, _oH["Direct"].nbcalls(3),_oH["Tangent"].nbcalls(3),_oH["Adjoint"].nbcalls(3))
- logging.debug("%s Taille mémoire utilisée de %.1f Mio", self._name, self._m.getUsedMemory("Mio"))
+ logging.debug("%s Taille mémoire utilisée de %.0f Mio", self._name, self._m.getUsedMemory("Mio"))
logging.debug("%s Terminé", self._name)
return 0
__init__.py \
prefs_ADAO.py \
prefs.py \
- traduitADAOsansToV8_2_0.py \
- traduitADAOV7_4_0ToV8_2_0.py \
- traduitADAOV7_5_0ToV8_2_0.py \
- traduitADAOV7_5_1ToV8_2_0.py \
- traduitADAOV7_6_0ToV8_2_0.py \
- traduitADAOV7_7_0ToV8_2_0.py \
- traduitADAOV7_8_0ToV8_2_0.py \
- traduitADAOV8_1_0ToV8_2_0.py
+ traduitADAOsansToV8_3_0.py \
+ traduitADAOV7_4_0ToV8_3_0.py \
+ traduitADAOV7_5_0ToV8_3_0.py \
+ traduitADAOV7_5_1ToV8_3_0.py \
+ traduitADAOV7_6_0ToV8_3_0.py \
+ traduitADAOV7_7_0ToV8_3_0.py \
+ traduitADAOV7_8_0ToV8_3_0.py \
+ traduitADAOV8_1_0ToV8_3_0.py \
+ traduitADAOV8_2_0ToV8_3_0.py
EXTRA_DIST = prefs_ADAO.py.in
# Configuration de Eficas
# =======================
#
-# INSTALLDIR, REPINI est obligatoire
+# INSTALLDIR, repIni est obligatoire
INSTALLDIR = "@EFICAS_DIR@"
sys.path.insert(0,INSTALLDIR)
-# positionnee a repin au debut mise a jour dans configuration
+#
+# Positionnee a repin au debut, mise a jour dans configuration
repIni=os.path.dirname(os.path.abspath(__file__))
#
# Sert comme directory initial des QFileDialog
initialdir=os.environ["PWD"]
#
# Traductions et codages
+#
# Codage des strings qui accepte les accents (en remplacement de 'ascii')
-encoding='iso-8859-1'
+# encoding='iso-8859-1'
+# ===== Specifique : pour la 8_3_0 et suivantes 8_x ! Enlever pour les 9_x !
+import sys
+reload(sys)
+sys.setdefaultencoding('latin1')
+# ===== Fin specifique =====================================================
+#
# Indique la langue du catalogue utilisee pour les chaines d'aide : fr ou ang
# lang='fr'
# Traduction des labels de boutons ou autres
+++ /dev/null
-#-*-coding:iso-8859-1-*-
-#
-# Copyright (C) 2008-2017 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-2017 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_3_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-2017 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-2017 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_3_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-2017 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-2017 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_3_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-2017 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-2017 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_3_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-2017 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-2017 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_3_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-2017 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-2017 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_3_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-2017 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-2017 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_3_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-2017 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_3_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-2017 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-2017 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_3_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()