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 contient la classe BUREAU qui gere les JDC ouverts
28 from widgets import askopenfilename,asksaveasfilename
29 from widgets import showinfo,askyesno,showerror
37 from jdcdisplay import JDCDISPLAY
38 from utils import extension_fichier,stripPath,save_in_file
39 from widgets import Fenetre,Ask_Format_Fichier
40 from fenetre_mc_inconnus import fenetre_mc_inconnus
41 from Ihm import CONNECTOR
48 ('Nouveau','newJDC','<Control-n>'),
49 ('Ouvrir','openJDC','<Control-o>'),
50 ('Enregistrer','saveJDC','<Control-e>'),
51 ('Enregistrer sous','saveasJDC','<Control-s>'),
53 ('Fermer','closeJDC','<Control-f>'),
54 ('Quitter','exitEFICAS','<Control-q>'),
58 ('Copier','copy','<Control-c>'),
59 ('Couper','cut','<Control-x>'),
60 ('Coller','paste','<Control-v>'),
64 ('Rapport de validation','visuCRJDC','<Control-r>'),
65 ('Fichier à plat','visu_a_plat','<Control-p>'),
66 ('Fichier .py','visuJDC_py'),
67 ('Fichier source','visu_txt_brut_JDC','<Control-b>'),
68 ('Paramètres Eficas','affichage_fichier_ini'),
69 ('Mots-clés inconnus','mc_inconnus'),
73 ('Aide EFICAS','aideEFICAS'),
78 button_defs = (('New24',"newJDC","Création d'un nouveau fichier",'always'),
79 ('Open24',"openJDC","Ouverture d'un fichier existant",'always'),
80 ('Save24',"saveJDC","Sauvegarde du fichier courant",'always'),
81 ('Fermer24',"closeJDC","Fermeture du fichier courant",'always'),
82 ('Zoom24',"visuJDC","Visualisation du fichier de commandes",'always'),
84 ('Copy24',"copy","Copie l'objet courant",'jdc'),
85 ('Cut24',"cut","Coupe l'objet courant",'jdc'),
86 ('Paste24',"paste","Colle l'objet copié après l'objet courant",'jdc'),
88 ('Delete24',"delete","Supprime l'objet courant",'jdc'),
89 ('Help24',"view_doc","Documentation de l'objet courant",'jdc')
92 menu_defs=prefs.menu_defs['bureau']
96 button_defs=prefs.button_defs['bureau']
100 def __init__(self,appli,parent):
103 if self.appli.test == 0 :
104 splash._splash.configure(text = "Création du bureau")
105 self.nb = Pmw.NoteBook(self.parent,raisecommand=self.selectJDC)
106 self.nb.pack(fill='both',expand=1)
107 self.JDCDisplay_courant=None
109 self.liste_JDCDisplay=[]
110 comploader.charger_composants()
113 self.initialdir = self.appli.CONFIGURATION.initialdir
115 def cree_cataitem(self):
117 On récupère dans l'appli_composant readercata les variables
118 qui servent par la suite pour la création des JDC
120 self.cataitem=self.appli.readercata.cataitem
121 self.cata=self.appli.readercata.cata
122 self.cata_ordonne_dico=self.appli.readercata.cata_ordonne_dico
123 self.code=self.appli.readercata.code
124 self.version_code=self.appli.readercata.version_code
125 self.fic_cata=self.appli.readercata.fic_cata
127 def selectJDC(self,event=None):
129 Cette méthode est appelée chaque fois que l'on sélectionne
130 l'onglet d'un JDC dans le NoteBook des JDC.
131 Elle permet de stocker dans les variable self.JDC et
132 self.JDCDisplay_courant les valeurs concernant le JDC courant
134 if len(self.liste_JDCDisplay) == 0 : return
135 #if self.JDCDisplay_courant : self.JDCDisplay_courant.jdc.unset_context()
136 numero_jdc = self.nb.index(self.nb.getcurselection())
137 self.JDCDisplay_courant.unselect()
138 self.JDCDisplay_courant = self.liste_JDCDisplay[numero_jdc]
139 self.JDC = self.JDCDisplay_courant.jdc
140 self.JDCName = self.JDC.nom
141 self.JDCDisplay_courant.select()
142 #print "selectJDC",numero_jdc,self.JDCDisplay_courant,self.JDCName
144 def newJDC_include(self,event=None):
146 Initialise un nouveau JDC vierge
148 import Extensions.jdc_include
149 JdC_aux=Extensions.jdc_include.JdC_include
151 self.appli.statusbar.reset_affichage_infos()
153 CONTEXT.unset_current_step()
154 jaux=self.cata[0].JdC(procedure="",appli=self.appli,
155 cata=self.cata,cata_ord_dico=self.cata_ordonne_dico,
156 rep_mat=self.appli.CONFIGURATION.rep_mat,
160 J=JdC_aux(procedure="",appli=self.appli,
161 cata=self.cata,cata_ord_dico=self.cata_ordonne_dico,
163 rep_mat=self.appli.CONFIGURATION.rep_mat,
168 self.ShowJDC(J,self.JDCName)
169 self.appli.toolbar.active_boutons()
171 def newJDC(self,event=None):
173 Initialise un nouveau JDC include vierge
175 self.appli.statusbar.reset_affichage_infos()
177 CONTEXT.unset_current_step()
178 J=self.cata[0].JdC(procedure="",appli=self.appli,
179 cata=self.cata,cata_ord_dico=self.cata_ordonne_dico,
180 rep_mat=self.appli.CONFIGURATION.rep_mat,
185 self.ShowJDC(J,self.JDCName)
186 self.appli.toolbar.active_boutons()
188 def ShowJDC(self,JDC,nom,label_onglet=None,JDCDISPLAY=JDCDISPLAY,enregistre="non"):
190 Lance l'affichage du JDC cad création du JDCDisplay
191 Rajoute le JDCDisplay à la liste des JDCDisplay si label_onglet == None cad si on crée
192 bien un nouveau JDCDisplay et non si on remplace (renommage de l'onglet)
195 self.JDCName = self.JDC.nom = nom
196 if label_onglet == None :
197 # On veut un nouvel onglet
198 label_onglet = self.GetLabelJDC()
199 self.nb.add(label_onglet,tab_text = nom,tab_width=20)
203 self.JDCDisplay_courant=JDCDISPLAY(self.JDC,nom,appli=self.appli,parent=self.nb.page(label_onglet))
205 self.liste_JDCDisplay.append(self.JDCDisplay_courant)
206 self.JDCDisplay_courant.modified='n'
207 if enregistre != "non" :
208 self.JDCDisplay_courant.fichier=self.fileName
210 self.initialdir = self.appli.CONFIGURATION.rep_user
211 self.nb.selectpage(label_onglet)
212 self.nb.setnaturalsize()
213 texte = "Jeu de commandes :" + self.JDCName+" ouvert"
214 CONNECTOR.Connect(JDC,"close",self.onClose,(self.JDCDisplay_courant,))
215 self.appli.affiche_infos(texte)
217 def onClose(self,jdcdisplay):
218 #print "onClose",jdcdisplay
219 self.closeJDCDISPLAY(jdcdisplay)
221 def closeJDCDISPLAY(self,jdc):
223 Ferme le jdcdisplay spécifié par l'argument jdc
225 if jdc is self.JDCDisplay_courant:
226 # on ferme le jdcdisplay courant
227 self.closeSelectedJDC()
229 # on ferme un autre jdcdisplay que le courant
230 old_JDCDisplay=self.JDCDisplay_courant
231 old_page=self.nb.getcurselection()
233 self.JDCDisplay_courant=jdc
235 numero_jdc=self.liste_JDCDisplay.index(jdc)
236 self.nb.selectpage(numero_jdc)
239 self.closeSelectedJDC()
240 self.JDCDisplay_courant=old_JDCDisplay
241 self.JDC=old_JDCDisplay.jdc
242 self.nb.selectpage(old_page)
244 def closeJDC (self,event=None) :
246 Ferme le JDC associé au JDCDISPLAY selectionné
248 if self.JDCDisplay_courant :
249 self.JDCDisplay_courant.jdc.close()
251 def closeSelectedJDC (self) :
253 Ferme le JDC courant et détruit l'onglet associé dans le notebook self.nb
255 if self.JDCDisplay_courant.modified == 'o' :
256 message = "Voulez-vous sauvegarder le jeu de commandes "+self.JDC.nom+" courant ?"
257 reponse = askyesno(title="Sauvegarde du jdc courant",
260 test = self.saveJDC()
262 self.appli.affiche_infos("Sauvegarde impossible")
265 CONNECTOR.Disconnect(self.JDCDisplay_courant.jdc,"close",self.onClose,(self.JDCDisplay_courant,))
266 self.JDCDisplay_courant.supprime()
267 self.JDCDisplay_courant.jdc.supprime()
268 self.liste_JDCDisplay.remove(self.JDCDisplay_courant)
269 # Active le mecanisme de selection du notebook (selectJDC)
270 self.nb.delete(self.nb.getcurselection())
273 index = self.nb.index(self.nb.getcurselection())
274 self.JDCDisplay_courant = self.liste_JDCDisplay[index]
275 self.JDC = self.JDCDisplay_courant.jdc
278 self.JDCDisplay_courant = None
279 self.appli.toolbar.inactive_boutons()
281 def visuCRJDC(self,event=None):
282 return self.visuCR(mode='JDC')
284 def visuCR(self,mode):
286 Méthode permettant l'affichage du rapport de validation
289 if not hasattr(self,'JDC') : return
290 titre="rapport de validation du jeu de commandes courant"
291 cr = self.JDC.report()
292 #self.update_jdc_courant()
294 from Noyau.N_CR import CR
296 cr.debut = "Début rapport de validation du catalogue"
297 cr.fin = "Fin rapport de validation du catalogue"
298 titre="rapport de validation du catalogue"
299 if hasattr(self,'cata_ordonne_cr') :
300 cr.add(self.cata_ordonne_cr)
301 if hasattr(self,'cata_dev_ordonne_cr') :
302 cr.add(self.cata_dev_ordonne_cr)
303 for cata in self.cata:
304 if hasattr(cata,'JdC'):
305 cr.add(cata.JdC.report())
307 self.visu_texte_cr = Fenetre(self.appli,titre=titre,texte=texte_cr)
309 def openJDC(self,event=None,file=None,units=None,enregistre="oui"):
311 Demande à l'utilisateur quel JDC existant il veut ouvrir
313 if self.code == 'ASTER':
314 filetypes = ( ("format "+self.appli.format_fichier.get(), ".com*"),("Tous",'*'))
315 elif self.code == 'HOMARD' :
316 filetypes = ( ("format "+self.appli.format_fichier.get(), ".py"),("Tous",'*'))
318 filetypes = ( ("format "+self.appli.format_fichier.get(), ".py"),)
319 if not hasattr(self,'initialdir'):
320 self.initialdir = self.appli.CONFIGURATION.initialdir
323 file = askopenfilename(title="Ouverture d'un fichier de commandes Aster",
324 defaultextension=".comm",
325 filetypes = filetypes,
326 initialdir = self.initialdir)
329 e=extension_fichier(file)
330 self.JDCName=stripPath(file)
331 self.initialdir = os.path.dirname(os.path.abspath(file))
335 format=self.appli.format_fichier.get()
336 # Il faut convertir le contenu du fichier en fonction du format
337 if convert.plugins.has_key(format):
338 # Le convertisseur existe on l'utilise
339 p=convert.plugins[format]()
341 text=p.convert('exec',self.appli)
342 if not p.cr.estvide():
343 self.appli.affiche_infos("Erreur à la conversion")
345 titre="compte-rendu d'erreurs, EFICAS ne sait pas convertir ce fichier",
346 texte = str(p.cr)).wait()
348 if enregistre == "oui" :
349 self.appli.listeFichiers.aOuvert(file)
351 # Il n'existe pas c'est une erreur
352 self.appli.affiche_infos("Type de fichier non reconnu")
353 showerror("Type de fichier non reconnu","EFICAS ne sait pas ouvrir ce type de fichier")
356 # On se met dans le repertoire ou se trouve le fichier de commandes
357 # pour trouver les eventuels fichiers include ou autres
358 # localises a cote du fichier de commandes
359 os.chdir(self.initialdir)
360 CONTEXT.unset_current_step()
361 J=self.cata[0].JdC(procedure=text,appli=self.appli,
362 cata=self.cata,cata_ord_dico=self.cata_ordonne_dico,
364 rep_mat=self.appli.CONFIGURATION.rep_mat,
366 if units is not None:
367 J.recorded_units=units
368 J.old_recorded_units=units
371 txt_exception = J.cr.get_mess_exception()
373 # des exceptions ont été levées à la création du JDC
374 # --> on affiche les erreurs mais pas le JDC
376 self.appli.affiche_infos("Erreur fatale au chargement de %s" %file)
377 if self.appli.test == 0 :
378 showerror("Erreur fatale au chargement d'un fichier",txt_exception)
380 self.ShowJDC(J,self.JDCName,enregistre=enregistre)
381 self.appli.toolbar.active_boutons()
382 # si le JDC ne contient rien (vide), on retourne ici
383 if len(self.JDC.etapes) == 0 : return
384 # dans le cas où le JDC est invalide, on affiche son CR
385 if not self.JDC.isvalid():
386 self.appli.top.update()
387 self.visuCR(mode='JDC')
388 # On a ouvert un Patron
390 def GetLabelJDC(self,nb_jdc = 'absent'):
392 Retourne le label de l'onglet du NoteBook associé au JDC à afficher
394 if nb_jdc == 'absent':
395 nb_jdc = len(self.nb.pagenames())
397 label_onglet = 'JDC'+`nb_jdc`
398 if label_onglet not in self.nb.pagenames() :
401 return self.GetLabelJDC(nb_jdc)
403 def saveasJDC(self,event=None):
405 Sauvegarde le JDC courant en demandant impérativement à l'utilisateur de
406 donner le nom du fichier de sauvegarde
408 self.saveJDC(echo='oui')
410 def saveJDC(self,echo='non'):
412 Sauvegarde le JDC courant.
413 Retourne 1 si la sauvegarde s'est bien faite, 0 sinon.
414 Si echo = 'oui' : interactif (l'utilisateur donne le nom sous lequel il
416 Si echo = 'non' : muet (sauvegarde le JDC dans JDC.procedure)
418 if not hasattr(self,'JDC') : return 0
419 format=self.appli.format_fichier.get()
420 if generator.plugins.has_key(format):
421 # Le generateur existe on l'utilise
422 g=generator.plugins[format]()
423 jdc_formate=g.gener(self.JDC,format='beautifie')
424 if format == 'homard':
425 self.jdc_homard=g.get_homard()
426 if not g.cr.estvide():
427 self.appli.affiche_infos("Erreur à la generation")
428 showerror("Erreur à la generation","EFICAS ne sait pas convertir ce JDC")
431 # Il n'existe pas c'est une erreur
432 self.appli.affiche_infos("Format %s non reconnu" % format)
433 showerror("Format %s non reconnu" % format,"EFICAS ne sait pas convertir le JDC")
435 self.jdc_fini = string.replace(jdc_formate,'\r\n','\n')
437 if echo =='oui' or self.JDCDisplay_courant.fichier == None:
438 return self.asknomsauvegardeJDC()
439 elif self.JDCDisplay_courant.fichier != None :
441 # Pour sauvegarde dans l etude si lancement depuis salome
442 if self.appli.salome != 0:
444 self.appli.salome.rangeInStudy(self.JDCDisplay_courant.fichier)
445 from panelsSalome import SALOME_UNIQUE_BASE_Panel
446 if len(SALOME_UNIQUE_BASE_Panel.dict_fichier_unite) > 0 :
447 self.appli.salome.creeConfigTxt(self.appli.CONFIGURATION.initialdir,SALOME_UNIQUE_BASE_Panel.dict_fichier_unite)
451 MyCLinit=eficasCL.CLinit()
457 #PN Fin Ajout --> Salome
458 # le JDC a déjà un nom : on sauvegarde directement sans demander
459 # un autre nom au développeur
460 if not save_in_file(self.JDCDisplay_courant.fichier,self.jdc_fini,self.appli.dir) :
461 showinfo("Erreur","Problème à la sauvegarde du fichier :" + `self.JDCDisplay_courant.fichier`)
464 if self.appli.format_fichier.get() == 'homard':
465 self.save_homard(self.JDCDisplay_courant.fichier,self.jdc_homard)
466 self.JDCDisplay_courant.stop_modif()
467 self.appli.affiche_infos("sauvegarde de "+`self.JDCDisplay_courant.fichier`+" effectuée")
470 def asknomsauvegardeJDC(self):
471 """ Demande à l'utilsateur le nom sous lequel il veut sauvegarder le JDC courant """
472 titre = "Sauvegarde d'un fichier de commandes "+self.code
473 if self.code == 'ASTER':
475 filtyp = ( ("ASTER", ".comm"),)
478 filtyp = ( (self.code, ".py"),)
479 sauvegarde = asksaveasfilename(title=titre,
480 defaultextension=defext,
482 initialdir = self.initialdir)
483 #initialdir = self.appli.CONFIGURATION.initialdir)
484 #initialdir = self.appli.CONFIGURATION.rep_user)
486 # PN ajout --> Salome
487 # Pour sauvegarde dans l etude si lancement depuis salome
488 if self.appli.salome != 0:
490 self.appli.salome.rangeInStudy(sauvegarde)
491 from panelsSalome import SALOME_UNIQUE_BASE_Panel
492 if len(SALOME_UNIQUE_BASE_Panel.dict_fichier_unite) > 0 :
493 self.appli.salome.creeConfigTxt(self.appli.CONFIGURATION.initialdir,SALOME_UNIQUE_BASE_Panel.dict_fichier_unite)
497 MyCLinit=eficasCL.CLinit()
503 # PN fin ajout --> Salome
504 if not save_in_file(sauvegarde,self.jdc_fini,None) :
505 showinfo("Erreur","Problème à la sauvegarde du fichier "+`sauvegarde`)
508 if self.appli.format_fichier.get() == 'homard':
509 self.save_homard(sauvegarde,self.jdc_homard)
510 self.JDCDisplay_courant.stop_modif()
511 self.appli.affiche_infos("Sauvegarde effectuée")
512 if sauvegarde != self.JDCDisplay_courant.fichier :
513 # l'utilisateur a sauvegardé le JDC sous un autre nom
514 self.JDCDisplay_courant.fichier = sauvegarde
515 self.JDCName = self.JDC.nom = stripPath(sauvegarde)
516 self.JDC.changefichier(sauvegarde)
522 def changeNomPage(self):
523 """ Change le nom de l'onglet contenant le JDC courant : en fait détruit l'actuel
524 et recrée un autre onglet à la même place avec le bon nom
527 self.JDCDisplay_courant.jdc.nom = nom
528 nom_page = self.nb.getcurselection()
529 num_page = self.nb.index(nom_page)
530 tab = self.nb.tab(num_page)
531 tab.configure(text = nom)
533 def exitEFICAS(self,event=None):
535 Permet de sortir d'EFICAS en demandant à l'utilisateur
536 s'il veut sauvegarder les modifications en cours
538 liste = self.GetListeJDCaSauvegarder()
540 # Certains fichiers n'ont pas été sauvegardés ...
541 if askyesno("Enregistrer modifications","Enregistrer les modifications ?") :
542 test = self.saveall(liste)
545 if askyesno ("Quitter","Voulez-vous vraiment quitter l'application ?") :
546 for JDCDisplay in self.liste_JDCDisplay:
547 JDCDisplay.jdc.supprime()
551 def GetListeJDCaSauvegarder(self) :
552 """ Retourne parmi la liste de tous les JDC ouverts la liste de ceux qui ont été modifiés """
553 if not self.JDCDisplay_courant : return []
554 if len(self.liste_JDCDisplay) == 0 : return l
556 for JDCDisplay in self.liste_JDCDisplay:
557 if JDCDisplay.modified == 'o' :
561 def copy(self,event=None):
563 Lance la copie sur le JDC courant
565 if self.JDCDisplay_courant : self.JDCDisplay_courant.doCopy()
567 def paste(self,event=None):
569 Lance le collage sur le JDC courant
571 if self.JDCDisplay_courant : self.JDCDisplay_courant.doPaste()
573 def cut(self,event=None):
575 Lance le cut sur le JDC courant
577 if self.JDCDisplay_courant: self.JDCDisplay_courant.doCut()
581 Lance la suppression du noeud courant
583 if not self.JDCDisplay_courant : return
584 self.JDCDisplay_courant.init_modif()
585 self.JDCDisplay_courant.node_selected.delete()
587 def visuJDC_py(self,event=None):
589 Méthode permettant d'afficher dans une fenêtre à part l'écho au
590 format python du jdc courant
592 if not hasattr(self,'JDC') : return
593 jdc_fini = self.get_text_JDC('python')
594 if jdc_fini == None : return
596 titre = 'fichier '+ self.JDCName + ' à la syntaxe Python',
601 Méthode permettant d'afficher dans une fenêtre à part l'écho au
602 format .comm ou .py du jdc courant
604 if not hasattr(self,'JDC') : return
605 titre = 'fichier '+ self.JDCName + ' à la syntaxe '+ self.code
606 format=self.appli.format_fichier.get()
607 self.jdc_fini = self.get_text_JDC(format)
608 if self.jdc_fini == None : return
609 self.visu_fichier_cmd = Fenetre(self.appli,titre=titre,texte = self.jdc_fini)
611 def get_text_JDC(self,format):
612 if generator.plugins.has_key(format):
613 # Le generateur existe on l'utilise
614 g=generator.plugins[format]()
615 jdc_formate=g.gener(self.JDC,format='beautifie')
616 if not g.cr.estvide():
617 self.appli.affiche_infos("Erreur à la generation")
618 showerror("Erreur à la generation","EFICAS ne sait pas convertir ce JDC")
623 # Il n'existe pas c'est une erreur
624 self.appli.affiche_infos("Format %s non reconnu" % format)
625 showerror("Format %s non reconnu" % format,"EFICAS ne sait pas convertir le JDC en format %s "% format)
630 Permet d'ouvrir le fichier doc U de la commande au format pdf avec Acrobat Reader
631 - Ne fonctionne pas sous UNIX (chemin d'accès Acrobat Reader)
632 - indication du chemin d'accès aux fichiers pdf à revoir : trop statique
634 if not self.JDCDisplay_courant : return
636 cle_doc = self.JDCDisplay_courant.node_selected.item.get_docu()
637 if cle_doc == None : return
638 cle_doc = string.replace(cle_doc,'.','')
639 cle_doc = string.replace(cle_doc,'-','')
640 commande = self.appli.CONFIGURATION.exec_acrobat
641 nom_fichier = cle_doc+".pdf"
642 fichier = os.path.abspath(os.path.join(self.appli.CONFIGURATION.path_doc,nom_fichier))
644 os.spawnv(os.P_NOWAIT,commande,(commande,fichier,))
645 elif os.name == 'posix':
646 script ="#!/usr/bin/sh \n%s %s&" %(commande,fichier)
647 pid = os.system(script)
648 except AttributeError:
649 traceback.print_exc()
652 def visu_a_plat(self,event=None):
654 Méthode permettant d'afficher dans une fenêtre à part l'écho 'à plat' du jdc courant
656 if not hasattr(self,'JDC') : return
657 titre = 'fichier '+ self.JDCName + ' à plat '
658 self.jdc_fini = self.get_text_JDC('aplat')
659 if self.jdc_fini == None : return
660 self.visu_fichier_cmd = Fenetre(self.appli,titre=titre,texte = self.jdc_fini)
662 def visu_txt_brut_JDC(self,event=None):
664 Méthode permettant d'afficher le jeu de commandes tel qu'il a été passé au JDC
666 if not hasattr(self,'JDC') : return
667 titre = "fichier de commandes utilisateur"
668 #texte = self.JDC.procedure
670 if self.JDCDisplay_courant.fichier == None:
671 self.appli.affiche_infos("Pas de fichier initial")
672 showerror("Impossible de visualiser le fichier initial",
673 "EFICAS ne peut visualiser le fichier initial.\nIl s'agit d'un nouveau JDC")
675 f=open(self.JDCDisplay_courant.fichier,'r')
678 self.visu_texte_JDC = Fenetre(self.appli,titre=titre,texte=texte)
680 def affichage_fichier_ini(self):
682 Affichage des valeurs des paramètres relus par Eficas
684 self.appli.CONFIGURATION.affichage_fichier_ini()
686 def saveall(self,liste):
688 Sauvegarde tous les JDC contenus dans liste
691 for JDCDisplay in liste :
692 self.JDCDisplay_courant=JDCDisplay
693 self.JDC = JDCDisplay.jdc
694 test = test * self.saveJDC(echo = 'non')
697 def save_homard(self,nom,texte):
698 file_homard=nom+'.conf_homard'
700 f=open(file_homard,'w')
706 print "Pb a la sauvegarde sous le format homard"
707 if self.appli.salome != 0:
709 self.appli.salome.rangeInStudy(file_homard,"_CONF")
711 # ---------------------------------------------------------------------------
712 # Méthodes liées aux mots-clés inconnus
713 # ---------------------------------------------------------------------------
715 def mc_inconnus(self):
716 l_mc = self.JDCDisplay_courant.jdc.get_liste_mc_inconnus()
717 o = fenetre_mc_inconnus(l_mc)
718 l = o.wait_new_list()
719 #print "mc_inconnus_new_list: ",l
720 #CCAR: Il n' y a pas de retour vers le JDC
722 def aideEFICAS(self,event=None):
723 AIDE.go(master=self.parent)
725 def update_jdc_courant(self):
726 self.JDCDisplay_courant.update()