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
145 def newJDC_include(self,event=None):
147 Initialise un nouveau JDC include vierge
149 import Extensions.jdc_include
150 JdC_aux=Extensions.jdc_include.JdC_include
152 self.appli.statusbar.reset_affichage_infos()
154 CONTEXT.unset_current_step()
155 jaux=self.cata[0].JdC(procedure="",appli=self.appli,
156 cata=self.cata,cata_ord_dico=self.cata_ordonne_dico,
157 rep_mat=self.appli.CONFIGURATION.rep_mat,
161 J=JdC_aux(procedure="",appli=self.appli,
162 cata=self.cata,cata_ord_dico=self.cata_ordonne_dico,
164 rep_mat=self.appli.CONFIGURATION.rep_mat,
169 self.ShowJDC(J,self.JDCName)
170 self.appli.toolbar.active_boutons()
173 def newJDC(self,event=None):
175 Initialise un nouveau JDC vierge
177 self.appli.statusbar.reset_affichage_infos()
179 CONTEXT.unset_current_step()
180 J=self.cata[0].JdC(procedure="",appli=self.appli,
181 cata=self.cata,cata_ord_dico=self.cata_ordonne_dico,
182 rep_mat=self.appli.CONFIGURATION.rep_mat,
187 self.ShowJDC(J,self.JDCName)
188 self.appli.toolbar.active_boutons()
191 def ShowJDC(self,JDC,nom,label_onglet=None,JDCDISPLAY=JDCDISPLAY,enregistre="non"):
193 Lance l'affichage du JDC cad création du JDCDisplay
194 Rajoute le JDCDisplay à la liste des JDCDisplay si label_onglet == None cad si on crée
195 bien un nouveau JDCDisplay et non si on remplace (renommage de l'onglet)
198 self.JDCName = self.JDC.nom = nom
199 if label_onglet == None :
200 # On veut un nouvel onglet
201 label_onglet = self.GetLabelJDC()
202 self.nb.add(label_onglet,tab_text = nom,tab_width=20)
206 self.JDCDisplay_courant=JDCDISPLAY(self.JDC,nom,appli=self.appli,parent=self.nb.page(label_onglet))
208 self.liste_JDCDisplay.append(self.JDCDisplay_courant)
209 self.JDCDisplay_courant.modified='n'
210 if enregistre != "non" :
211 self.JDCDisplay_courant.fichier=self.fileName
213 self.initialdir = self.appli.CONFIGURATION.rep_user
214 self.nb.selectpage(label_onglet)
215 self.nb.setnaturalsize()
216 self.nb.bind_all("<Key-Next>",lambda e,s=self:s.selectArbreDown())
217 self.nb.bind_all("<Key-Prior>",lambda e,s=self:s.selectArbreUp())
218 self.nb.bind_all("<Insert>",lambda e,s=self:s.deplieReplieNode())
219 texte = "Jeu de commandes :" + self.JDCName+" ouvert"
220 CONNECTOR.Connect(JDC,"close",self.onClose,(self.JDCDisplay_courant,))
221 self.appli.affiche_infos(texte)
223 def onClose(self,jdcdisplay):
224 #print "onClose",jdcdisplay
225 self.closeJDCDISPLAY(jdcdisplay)
227 def closeJDCDISPLAY(self,jdc):
229 Ferme le jdcdisplay spécifié par l'argument jdc
231 if jdc is self.JDCDisplay_courant:
232 # on ferme le jdcdisplay courant
233 self.closeSelectedJDC()
235 # on ferme un autre jdcdisplay que le courant
236 old_JDCDisplay=self.JDCDisplay_courant
237 old_page=self.nb.getcurselection()
239 self.JDCDisplay_courant=jdc
241 numero_jdc=self.liste_JDCDisplay.index(jdc)
242 self.nb.selectpage(numero_jdc)
245 self.closeSelectedJDC()
246 self.JDCDisplay_courant=old_JDCDisplay
247 self.JDC=old_JDCDisplay.jdc
248 self.nb.selectpage(old_page)
250 def closeJDC (self,event=None) :
252 Ferme le JDC associé au JDCDISPLAY selectionné
254 if self.JDCDisplay_courant :
255 self.JDCDisplay_courant.jdc.close()
257 def closeSelectedJDC (self) :
259 Ferme le JDC courant et détruit l'onglet associé dans le notebook self.nb
261 if self.JDCDisplay_courant.modified == 'o' :
262 message = "Voulez-vous sauvegarder le jeu de commandes "+self.JDC.nom+" courant ?"
263 reponse = askyesno(title="Sauvegarde du jdc courant",
266 test = self.saveJDC()
268 self.appli.affiche_infos("Sauvegarde impossible")
271 CONNECTOR.Disconnect(self.JDCDisplay_courant.jdc,"close",self.onClose,(self.JDCDisplay_courant,))
272 self.JDCDisplay_courant.supprime()
273 self.JDCDisplay_courant.jdc.supprime()
274 self.liste_JDCDisplay.remove(self.JDCDisplay_courant)
275 # Active le mecanisme de selection du notebook (selectJDC)
276 self.nb.delete(self.nb.getcurselection())
279 index = self.nb.index(self.nb.getcurselection())
280 self.JDCDisplay_courant = self.liste_JDCDisplay[index]
281 self.JDC = self.JDCDisplay_courant.jdc
284 self.JDCDisplay_courant = None
285 self.appli.toolbar.inactive_boutons()
287 def visuCRJDC(self,event=None):
288 return self.visuCR(mode='JDC')
290 def visuCR(self,mode):
292 Méthode permettant l'affichage du rapport de validation
295 if not hasattr(self,'JDC') : return
296 titre="rapport de validation du jeu de commandes courant"
297 cr = self.JDC.report()
298 #self.update_jdc_courant()
300 from Noyau.N_CR import CR
302 cr.debut = "Début rapport de validation du catalogue"
303 cr.fin = "Fin rapport de validation du catalogue"
304 titre="rapport de validation du catalogue"
305 if hasattr(self,'cata_ordonne_cr') :
306 cr.add(self.cata_ordonne_cr)
307 if hasattr(self,'cata_dev_ordonne_cr') :
308 cr.add(self.cata_dev_ordonne_cr)
309 for cata in self.cata:
310 if hasattr(cata,'JdC'):
311 cr.add(cata.JdC.report())
313 self.visu_texte_cr = Fenetre(self.appli,titre=titre,texte=texte_cr)
315 def openJDC(self,event=None,file=None,units=None,enregistre="oui"):
317 Demande à l'utilisateur quel JDC existant il veut ouvrir
319 if self.code == 'ASTER':
320 filetypes = ( ("format "+self.appli.format_fichier.get(), ".com*"),("Tous",'*'))
321 elif self.code == 'HOMARD' :
322 filetypes = ( ("format "+self.appli.format_fichier.get(), ".py"),("Tous",'*'))
324 filetypes = ( ("format "+self.appli.format_fichier.get(), ".py"),)
325 if not hasattr(self,'initialdir'):
326 self.initialdir = self.appli.CONFIGURATION.initialdir
329 file = askopenfilename(title="Ouverture d'un fichier de commandes Aster",
330 defaultextension=".comm",
331 filetypes = filetypes,
332 initialdir = self.initialdir)
335 e=extension_fichier(file)
336 self.JDCName=stripPath(file)
337 self.initialdir = os.path.dirname(os.path.abspath(file))
341 format=self.appli.format_fichier.get()
342 # Il faut convertir le contenu du fichier en fonction du format
343 if convert.plugins.has_key(format):
344 # Le convertisseur existe on l'utilise
345 p=convert.plugins[format]()
347 text=p.convert('exec',self.appli)
348 if not p.cr.estvide():
349 self.appli.affiche_infos("Erreur à la conversion")
351 titre="compte-rendu d'erreurs, EFICAS ne sait pas convertir ce fichier",
352 texte = str(p.cr)).wait()
354 if enregistre == "oui" :
355 self.appli.listeFichiers.aOuvert(file)
357 # Il n'existe pas c'est une erreur
358 self.appli.affiche_infos("Type de fichier non reconnu")
359 showerror("Type de fichier non reconnu","EFICAS ne sait pas ouvrir ce type de fichier")
362 # On se met dans le repertoire ou se trouve le fichier de commandes
363 # pour trouver les eventuels fichiers include ou autres
364 # localises a cote du fichier de commandes
365 os.chdir(self.initialdir)
366 CONTEXT.unset_current_step()
367 J=self.cata[0].JdC(procedure=text,appli=self.appli,
368 cata=self.cata,cata_ord_dico=self.cata_ordonne_dico,
370 rep_mat=self.appli.CONFIGURATION.rep_mat,
372 if units is not None:
373 J.recorded_units=units
374 J.old_recorded_units=units
377 txt_exception = J.cr.get_mess_exception()
379 # des exceptions ont été levées à la création du JDC
380 # --> on affiche les erreurs mais pas le JDC
382 self.appli.affiche_infos("Erreur fatale au chargement de %s" %file)
383 if self.appli.test == 0 :
384 showerror("Erreur fatale au chargement d'un fichier",txt_exception)
386 self.ShowJDC(J,self.JDCName,enregistre=enregistre)
387 self.appli.toolbar.active_boutons()
388 # si le JDC ne contient rien (vide), on retourne ici
389 if len(self.JDC.etapes) == 0 : return
390 # dans le cas où le JDC est invalide, on affiche son CR
391 if not self.JDC.isvalid():
392 self.appli.top.update()
393 self.visuCR(mode='JDC')
396 def deplieReplieNode(self):
397 self.JDCDisplay_courant.tree.tree.deplieReplieNode()
399 def selectArbreDown(self):
400 self.JDCDisplay_courant.tree.tree.canvas.focus_set()
401 self.JDCDisplay_courant.tree.tree.mot_down_force()
403 def selectArbreUp(self):
404 self.JDCDisplay_courant.tree.tree.canvas.focus_set()
405 self.JDCDisplay_courant.tree.tree.mot_up_force()
407 def GetLabelJDC(self,nb_jdc = 'absent'):
409 Retourne le label de l'onglet du NoteBook associé au JDC à afficher
411 if nb_jdc == 'absent':
412 nb_jdc = len(self.nb.pagenames())
414 label_onglet = 'JDC'+`nb_jdc`
415 if label_onglet not in self.nb.pagenames() :
418 return self.GetLabelJDC(nb_jdc)
420 def saveasJDC(self,event=None):
422 Sauvegarde le JDC courant en demandant impérativement à l'utilisateur de
423 donner le nom du fichier de sauvegarde
425 self.saveJDC(echo='oui')
427 def saveJDC(self,echo='non'):
429 Sauvegarde le JDC courant.
430 Retourne 1 si la sauvegarde s'est bien faite, 0 sinon.
431 Si echo = 'oui' : interactif (l'utilisateur donne le nom sous lequel il
433 Si echo = 'non' : muet (sauvegarde le JDC dans JDC.procedure)
436 if not hasattr(self,'JDC') : return 0
437 format=self.appli.format_fichier.get()
438 if generator.plugins.has_key(format):
439 # Le generateur existe on l'utilise
440 g=generator.plugins[format]()
441 jdc_formate=g.gener(self.JDC,format='beautifie')
442 if format == 'homard':
443 self.jdc_homard=g.get_homard()
444 if not g.cr.estvide():
445 self.appli.affiche_infos("Erreur à la generation")
446 showerror("Erreur à la generation","EFICAS ne sait pas convertir ce JDC")
449 # Il n'existe pas c'est une erreur
450 self.appli.affiche_infos("Format %s non reconnu" % format)
451 showerror("Format %s non reconnu" % format,"EFICAS ne sait pas convertir le JDC")
453 self.jdc_fini = string.replace(jdc_formate,'\r\n','\n')
455 if echo =='oui' or self.JDCDisplay_courant.fichier == None:
456 ok = self.asknomsauvegardeJDC()
457 elif self.JDCDisplay_courant.fichier != None :
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`)
465 if self.appli.format_fichier.get() == 'homard':
466 self.save_homard(self.JDCDisplay_courant.fichier,self.jdc_homard)
467 self.JDCDisplay_courant.stop_modif()
468 self.appli.affiche_infos("sauvegarde de "+`self.JDCDisplay_courant.fichier`+" effectuée")
471 if ok and hasattr( self.appli, 'salome'):
472 # eficas a été lancé à partir deSalome
473 #1)ajout dans l'arbre d'étude du nom du jdc
474 ok, msg = self.appli.addJdcInSalome( self.JDCDisplay_courant.fichier )
477 from panelsSalome import SALOME_UNIQUE_BASE_Panel
478 if len(SALOME_UNIQUE_BASE_Panel.dict_fichier_unite) > 0 :
479 print 'CS_pbruno if len(SALOMchier_unite) > 0 :???????'
480 self.appli.creeConfigTxt( self.appli.CONFIGURATION.initialdir, SALOME_UNIQUE_BASE_Panel.dict_fichier_unite )
482 #3)création/mise à jours d'un maillage dans Salome
483 self.appli.createOrUpdateMesh()
486 def asknomsauvegardeJDC(self):
487 """ Demande à l'utilsateur le nom sous lequel il veut sauvegarder le JDC courant """
488 titre = "Sauvegarde d'un fichier de commandes "+self.code
489 if self.code == 'ASTER':
491 filtyp = ( ("ASTER", ".comm"),)
494 filtyp = ( (self.code, ".py"),)
495 sauvegarde = asksaveasfilename(title=titre,
496 defaultextension=defext,
498 initialdir = self.initialdir)
499 #initialdir = self.appli.CONFIGURATION.initialdir)
500 #initialdir = self.appli.CONFIGURATION.rep_user)
502 if not save_in_file(sauvegarde,self.jdc_fini,None) :
503 showinfo("Erreur","Problème à la sauvegarde du fichier "+`sauvegarde`)
506 if self.appli.format_fichier.get() == 'homard':
507 self.save_homard(sauvegarde,self.jdc_homard)
508 self.JDCDisplay_courant.stop_modif()
509 self.appli.affiche_infos("Sauvegarde effectuée")
510 if sauvegarde != self.JDCDisplay_courant.fichier :
511 # l'utilisateur a sauvegardé le JDC sous un autre nom
512 self.JDCDisplay_courant.fichier = sauvegarde
513 self.JDCName = self.JDC.nom = stripPath(sauvegarde)
514 self.JDC.changefichier(sauvegarde)
520 def changeNomPage(self):
521 """ Change le nom de l'onglet contenant le JDC courant : en fait détruit l'actuel
522 et recrée un autre onglet à la même place avec le bon nom
525 self.JDCDisplay_courant.jdc.nom = nom
526 nom_page = self.nb.getcurselection()
527 num_page = self.nb.index(nom_page)
528 tab = self.nb.tab(num_page)
529 tab.configure(text = nom)
531 def exitEFICAS(self,event=None):
533 Permet de sortir d'EFICAS en demandant à l'utilisateur
534 s'il veut sauvegarder les modifications en cours
536 liste = self.GetListeJDCaSauvegarder()
538 # Certains fichiers n'ont pas été sauvegardés ...
539 if askyesno("Enregistrer modifications","Enregistrer les modifications ?") :
540 test = self.saveall(liste)
543 if askyesno ("Quitter","Voulez-vous vraiment quitter l'application ?") :
544 for JDCDisplay in self.liste_JDCDisplay:
545 JDCDisplay.jdc.supprime()
549 def GetListeJDCaSauvegarder(self) :
550 """ Retourne parmi la liste de tous les JDC ouverts la liste de ceux qui ont été modifiés """
551 if not self.JDCDisplay_courant : return []
552 if len(self.liste_JDCDisplay) == 0 : return l
554 for JDCDisplay in self.liste_JDCDisplay:
555 if JDCDisplay.modified == 'o' :
559 def copy(self,event=None):
561 Lance la copie sur le JDC courant
563 if self.JDCDisplay_courant : self.JDCDisplay_courant.doCopy()
565 def paste(self,event=None):
567 Lance le collage sur le JDC courant
569 if self.JDCDisplay_courant : self.JDCDisplay_courant.doPaste()
571 def cut(self,event=None):
573 Lance le cut sur le JDC courant
575 if self.JDCDisplay_courant: self.JDCDisplay_courant.doCut()
579 Lance la suppression du noeud courant
581 if not self.JDCDisplay_courant : return
582 self.JDCDisplay_courant.init_modif()
583 self.JDCDisplay_courant.node_selected.delete()
585 def visuJDC_py(self,event=None):
587 Méthode permettant d'afficher dans une fenêtre à part l'écho au
588 format python du jdc courant
590 if not hasattr(self,'JDC') : return
591 jdc_fini = self.get_text_JDC('python')
592 if jdc_fini == None : return
594 titre = 'fichier '+ self.JDCName + ' à la syntaxe Python',
599 Méthode permettant d'afficher dans une fenêtre à part l'écho au
600 format .comm ou .py du jdc courant
602 if not hasattr(self,'JDC') : return
603 titre = 'fichier '+ self.JDCName + ' à la syntaxe '+ self.code
604 format=self.appli.format_fichier.get()
605 self.jdc_fini = self.get_text_JDC(format)
606 if self.jdc_fini == None : return
607 self.visu_fichier_cmd = Fenetre(self.appli,titre=titre,texte = self.jdc_fini)
609 def get_text_JDC(self,format):
610 if generator.plugins.has_key(format):
611 # Le generateur existe on l'utilise
612 g=generator.plugins[format]()
613 jdc_formate=g.gener(self.JDC,format='beautifie')
614 if not g.cr.estvide():
615 self.appli.affiche_infos("Erreur à la generation")
616 showerror("Erreur à la generation","EFICAS ne sait pas convertir ce JDC")
621 # Il n'existe pas c'est une erreur
622 self.appli.affiche_infos("Format %s non reconnu" % format)
623 showerror("Format %s non reconnu" % format,"EFICAS ne sait pas convertir le JDC en format %s "% format)
628 Permet d'ouvrir le fichier doc U de la commande au format pdf avec Acrobat Reader
629 - Ne fonctionne pas sous UNIX (chemin d'accès Acrobat Reader)
630 - indication du chemin d'accès aux fichiers pdf à revoir : trop statique
632 if not self.JDCDisplay_courant : return
634 cle_doc = self.JDCDisplay_courant.node_selected.item.get_docu()
635 if cle_doc == None : return
636 cle_doc = string.replace(cle_doc,'.','')
637 cle_doc = string.replace(cle_doc,'-','')
638 commande = self.appli.CONFIGURATION.exec_acrobat
639 nom_fichier = cle_doc+".pdf"
640 fichier = os.path.abspath(os.path.join(self.appli.CONFIGURATION.path_doc,nom_fichier))
642 os.spawnv(os.P_NOWAIT,commande,(commande,fichier,))
643 elif os.name == 'posix':
644 script ="#!/usr/bin/sh \n%s %s&" %(commande,fichier)
645 pid = os.system(script)
646 except AttributeError:
647 traceback.print_exc()
650 def visu_a_plat(self,event=None):
652 Méthode permettant d'afficher dans une fenêtre à part l'écho 'à plat' du jdc courant
654 if not hasattr(self,'JDC') : return
655 titre = 'fichier '+ self.JDCName + ' à plat '
656 self.jdc_fini = self.get_text_JDC('aplat')
657 if self.jdc_fini == None : return
658 self.visu_fichier_cmd = Fenetre(self.appli,titre=titre,texte = self.jdc_fini)
660 def visu_txt_brut_JDC(self,event=None):
662 Méthode permettant d'afficher le jeu de commandes tel qu'il a été passé au JDC
664 if not hasattr(self,'JDC') : return
665 titre = "fichier de commandes utilisateur"
666 #texte = self.JDC.procedure
668 if self.JDCDisplay_courant.fichier == None:
669 self.appli.affiche_infos("Pas de fichier initial")
670 showerror("Impossible de visualiser le fichier initial",
671 "EFICAS ne peut visualiser le fichier initial.\nIl s'agit d'un nouveau JDC")
673 os.chdir(self.appli.dir)
674 f=open(self.JDCDisplay_courant.fichier,'r')
677 self.visu_texte_JDC = Fenetre(self.appli,titre=titre,texte=texte)
679 def affichage_fichier_ini(self):
681 Affichage des valeurs des paramètres relus par Eficas
683 self.appli.CONFIGURATION.affichage_fichier_ini()
685 def saveall(self,liste):
687 Sauvegarde tous les JDC contenus dans liste
690 for JDCDisplay in liste :
691 self.JDCDisplay_courant=JDCDisplay
692 self.JDC = JDCDisplay.jdc
693 test = test * self.saveJDC(echo = 'non')
696 def save_homard(self,nom,texte):
697 file_homard=nom+'.conf_homard'
699 f=open(file_homard,'w')
705 print "Pb a la sauvegarde sous le format homard"
706 if hasattr( self.appli, 'salome'):
708 self.appli.salome.rangeInStudy(file_homard,"_CONF")
710 # ---------------------------------------------------------------------------
711 # Méthodes liées aux mots-clés inconnus
712 # ---------------------------------------------------------------------------
714 def mc_inconnus(self):
715 l_mc = self.JDCDisplay_courant.jdc.get_liste_mc_inconnus()
716 o = fenetre_mc_inconnus(l_mc)
717 l = o.wait_new_list()
718 #print "mc_inconnus_new_list: ",l
719 #CCAR: Il n' y a pas de retour vers le JDC
721 def aideEFICAS(self,event=None):
722 AIDE.go(master=self.parent)
724 def update_jdc_courant(self):
725 self.JDCDisplay_courant.update()