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
31 def lance_eficas(code,fichier=None):
39 a=eficas.EFICAS(root,code=code,fichier = fichier,test=1)
42 eficas.EFICAS(root,code=code)
44 print bureau.JDC.report()
47 def duplique_fichier(code,fichier=None,root=None):
58 appli=eficas.EFICAS(root,code=code,fichier = fichier,test=1)
60 if convert.plugins.has_key(format):
61 p=convert.plugins[format]()
63 text=p.convert('exec',appli)
65 cata=appli.readercata.cata
66 J=cata[0].JdC(procedure=text2,cata=cata)
68 fileName=fichier+"_init"
69 if generator.plugins.has_key(format):
70 g=generator.plugins[format]()
71 jdc_formate=g.gener(J,format='beautifie')
73 jdc_fini = string.replace(jdc_formate,'\r\n','\n')
75 utils.save_in_file(fileName+".comm",jdc_fini)
79 dict_change={"FICHIER_MED_MAILLAGE_N=":"FICHIER_MED_MAILLAGE_NP1","NOM_MED_MAILLAGE_N=":"NOM_MED_MAILLAGE_NP1"}
80 for mot in dict_change.keys():
81 if( re.search(mot,texte)):
82 indicenouveau=re.search(mot,texte).end()
83 indicefinnouveau= texte.find(",",indicenouveau)
84 avant=dict_change[mot]
85 if( re.search(avant,texte)):
86 indiceancien=re.search(avant,texte).end()+1
87 indicefinancien= texte.find(",",indiceancien)
88 valeur=texte[indiceancien:indicefinancien]
89 texte=texte[0:indicenouveau]+valeur+texte[indicefinnouveau:]
90 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']
92 for mot in liste_mot_clef_None:
93 if( re.search(mot,texte)):
94 indice=re.search(mot,texte).end()+1
95 indicefin= texte.find(",",indice)
96 texte=texte[0:indice]+"None"+texte[indicefin:]