X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=Editeur%2Fappli.py;h=0a03c2550294f71d8e8bd8edd6950593666013ae;hb=fd27c38037ee9c07a594b6727c99965322d9f9bc;hp=740b1eb8f17167717e5235556ba22dfefbf4685b;hpb=d87eb90bcf9f18e22e82aaa66f3a546eaf73d990;p=tools%2Feficas.git diff --git a/Editeur/appli.py b/Editeur/appli.py index 740b1eb8..0a03c255 100644 --- a/Editeur/appli.py +++ b/Editeur/appli.py @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- # CONFIGURATION MANAGEMENT OF EDF VERSION # ====================================================================== # COPYRIGHT (C) 1991 - 2002 EDF R&D WWW.CODE-ASTER.ORG @@ -24,11 +25,12 @@ L'aspect applicatif doit etre pris en charge par la classe dérivée """ # Modules Python +import os import sys import types import Pmw import Tkinter -from tkMessageBox import showinfo,askyesno,showerror +from widgets import showerror # Modules Eficas import splash @@ -39,7 +41,7 @@ import properties from widgets import Fenetre from Misc import MakeNomComplet -VERSION="EFICAS v1.4" +VERSION="EFICAS v1.6" class APPLI: def __init__ (self,master,code='ASTER',fichier=None) : @@ -61,11 +63,17 @@ class APPLI: self.affiche_FAQ() # AY : cas ou le nom du fichier a été passé en argument if fichier : - try : - self.bureau.openJDC( str(MakeNomComplet.FILENAME(fichier)) ) - except Exception,e : - showerror( "ARGUMENT INVALIDE", str(e) ) + fich=str(MakeNomComplet.FILENAME(fichier)) + if not os.path.isfile(fich): + showerror("Fichier inexistant", "Fichier %s en argument n'existe pas" % fich) + else: + self.bureau.openJDC( fich) # AY : fin + # PN : ajout d un attribut pour indiquer si + # l appli a ete lance depuis Salome + self.salome=0 + + def send_message(self,message): self.message=message @@ -204,6 +212,13 @@ class APPLI: if not item : menu.add_separator() else: + if len(item)==3: + raccourci=item[2] + newitem=(item[0],item[1]) + else : + raccourci="" + newitem=item + item=newitem label,method=item if type(method) == types.TupleType: # On a un tuple => on cree une cascade @@ -218,6 +233,8 @@ class APPLI: else: command=getattr(appli_composant,method) menu.add_command(label=label,command=command) + if raccourci != "" : + self.top.bind(raccourci,command) # Si au moins un radiobouton existe on invoke le premier if radio:menu.invoke(radio)