2 # -*- coding: utf-8 -*-
5 usage="""usage: %prog [options]
7 python traduitV7V8.py --infile=xxxx --outfile=yyyy
13 from load import getJDC
14 from mocles import parseKeywords
15 from removemocle import *
16 from renamemocle import *
17 from renamemocle import *
18 from inseremocle import *
19 from changeValeur import *
20 from movemocle import *
21 from dictErreurs import GenereErreurPourCommande
26 atraiter=( "DEFI_MAILLAGE",)
28 def traduc(infile,outfile,flog=None):
30 hdlr=log.initialise(flog)
31 jdc=getJDC(infile,atraiter)
34 #Parse les mocles des commandes
37 ####################### traitement erreurs ########################
38 #GenereErreurPourCommande(jdc,("POST_RCCM","DIST_LIGN_3D","IMPR_OAR","COMB_CHAM_NO","COMB_CHAM_ELEM"))
39 GenereErreurPourCommande(jdc,())
41 ####################### traitement CALC_META #######################
42 renameMotCleInFact(jdc,"DEFI_MAILLAGE","DEFI_SUPER_MAILLE","MACR_ELEM_STAT","MACR_ELEM")
44 #########################################################################
48 f.write(jdc.getSource())
54 parser = optparse.OptionParser(usage=usage)
56 parser.add_option('-i','--infile', dest="infile", default='toto.comm',
57 help="Le fichier à traduire")
58 parser.add_option('-o','--outfile', dest="outfile", default='tutu.comm',
59 help="Le fichier traduit")
61 options, args = parser.parse_args()
62 traduc(options.infile,options.outfile)
64 if __name__ == '__main__':