1 # -*- coding: utf-8 -*-
2 # CONFIGURATION MANAGEMENT OF EDF VERSION
3 # ======================================================================
4 # COPYRIGHT (C) 1991 - 2002 EDF R&D WWW.CODE-ASTER.ORG
5 # THIS PROGRAM IS FREE SOFTWARE; YOU CAN REDISTRIBUTE IT AND/OR MODIFY
6 # IT UNDER THE TERMS OF THE GNU GENERAL PUBLIC LICENSE AS PUBLISHED BY
7 # THE FREE SOFTWARE FOUNDATION; EITHER VERSION 2 OF THE LICENSE, OR
8 # (AT YOUR OPTION) ANY LATER VERSION.
10 # THIS PROGRAM IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL, BUT
11 # WITHOUT ANY WARRANTY; WITHOUT EVEN THE IMPLIED WARRANTY OF
12 # MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. SEE THE GNU
13 # GENERAL PUBLIC LICENSE FOR MORE DETAILS.
15 # YOU SHOULD HAVE RECEIVED A COPY OF THE GNU GENERAL PUBLIC LICENSE
16 # ALONG WITH THIS PROGRAM; IF NOT, WRITE TO EDF R&D CODE_ASTER,
17 # 1 AVENUE DU GENERAL DE GAULLE, 92141 CLAMART CEDEX, FRANCE.
20 # ======================================================================
22 Ce module permet de lancer l'application EFICAS en affichant
23 un ecran Splash pour faire patentier l'utilisateur
33 def lance_eficas(code,fichier=None):
37 options=session.parse(sys.argv)
41 a=eficas.EFICAS(root,code=code,fichier = fichier,test=1)
44 eficas.EFICAS(root,code=code)
46 print bureau.JDC.report()
49 def duplique_fichier(code,fichier=None,root=None):
60 from Editeur import session
62 options=session.parse(sys.argv+[fichier])
64 options=session.parse(sys.argv)
66 appli=eficas.EFICAS(root,code=code,fichier = fichier,test=1)
68 if convert.plugins.has_key(format):
69 p=convert.plugins[format]()
71 text=p.convert('exec',appli)
75 cata=appli.readercata.cata
76 J=cata[0].JdC(procedure=text2,cata=cata)
78 fileName=fichier+"_init"
79 if generator.plugins.has_key(format):
80 g=generator.plugins[format]()
81 jdc_formate=g.gener(J,format='beautifie')
82 print "hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh"
84 jdc_fini = string.replace(jdc_formate,'\r\n','\n')
86 utils.save_in_file(fileName+".comm",jdc_fini,None)
90 dict_change={"FICHIER_MED_MAILLAGE_N=":"FICHIER_MED_MAILLAGE_NP1","NOM_MED_MAILLAGE_N=":"NOM_MED_MAILLAGE_NP1"}
91 for mot in dict_change.keys():
92 if( re.search(mot,texte)):
93 indicenouveau=re.search(mot,texte).end()
94 indicefinnouveau= texte.find(",",indicenouveau)
95 avant=dict_change[mot]
96 if( re.search(avant,texte)):
97 indiceancien=re.search(avant,texte).end()+1
98 indicefinancien= texte.find(",",indiceancien)
99 valeur=texte[indiceancien:indicefinancien]
100 texte=texte[0:indicenouveau]+valeur+texte[indicefinnouveau:]
101 liste_mot_clef_None=['CRIT_RAFF_ABS','CRIT_RAFF_REL','CRIT_RAFF_PE','CRIT_DERA_ABS','CRIT_DERA_REL','CRIT_DERA_PE','NITER','NOM_MED_MAILLAGE_NP1','FICHIER_MED_MAILLAGE_NP1']
103 for mot in liste_mot_clef_None:
104 if( re.search(mot,texte)):
105 indice=re.search(mot,texte).end()+1
106 indicefin= texte.find(",",indice)
107 texte=texte[0:indice]+"None"+texte[indicefin:]