1 #=============================================================================
2 # File : EficasEtude.py
3 # Created : mar fév 25 09:48:34 CET 2003
4 # Author : Pascale NOYRET, EDF
7 # $Header: /home/salome/PlateFormePAL/Bases_CVS_EDF/Modules_EDF/EFICAS_SRC/src/EFICASGUI/eficasEtude.py,v 1.3 2005/06/03 07:25:24 salome Exp $
8 #=============================================================================
12 from tkFileDialog import asksaveasfilename
15 aGuiDS=salomedsgui.guiDS()
17 #--------------------------------------------------------------------------
19 class Eficas_In_Study:
21 def __init__(self,code,studyId=None):
22 print "#######################################################"
23 print "#######################################################"
24 print "#######################################################"
25 print "_CS_GBO_ : Eficas_In_Study:init: studyId = ", studyId
26 print "#######################################################"
27 print "#######################################################"
29 self.aGuiDS=salomedsgui.guiDS(studyId=studyId)
35 self.fatherId=self.aGuiDS.enregistre("Eficas")
36 salome.sg.updateObjBrowser(0)
38 def rangeInStudy(self,fichier, suf=""):
39 if fichier not in self.liste_deja_la :
40 self.liste_deja_la.append(fichier)
41 Nom=re.split("/",fichier)[-1]
43 self.commId=self.aGuiDS.createItemInStudy(self.fatherId,Nom)
44 if self.commId != None:
45 self.aGuiDS.setExternalFileAttribute(self.commId,"FICHIER_EFICAS_"+self.code+suf,fichier)
46 salome.sg.updateObjBrowser(0)
48 def creeConfigTxt(self,fichier,dico):
49 sauvegarde = asksaveasfilename(title="fichier config.txt",
50 defaultextension='.txt',
52 f=open(sauvegarde,'w+')
53 for unite in dico.keys():
57 ligne="fort."+str(unite)+" "+type+" "+fic
60 self.rangeInStudy(sauvegarde)