X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=Editeur%2Fappli.py;h=0a03c2550294f71d8e8bd8edd6950593666013ae;hb=fd27c38037ee9c07a594b6727c99965322d9f9bc;hp=df7fbaa7a16b452f984bff247c416febd2d795c8;hpb=5afee7e5cc04d611b69969f10c57624c42cc9213;p=tools%2Feficas.git diff --git a/Editeur/appli.py b/Editeur/appli.py index df7fbaa7..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.3" +VERSION="EFICAS v1.6" class APPLI: def __init__ (self,master,code='ASTER',fichier=None) : @@ -57,15 +59,21 @@ class APPLI: self.message='' self.cree_composants_graphiques() self.load_appli_composants() # Creation du BUREAU - self.affiche_FAQ() splash.fini_splash() + 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 @@ -163,8 +171,8 @@ class APPLI: Retourne un texte d'informations sur la session courante d'EFICAS """ texte = VERSION + '\n\n' - texte = texte + 'EFICAS est un produit développé par \nEDF-Division Stratégie et Développement\n' - texte = texte + 'Equipe : MTI/MMN\n\n' + texte = texte + 'EFICAS est un produit développé par \nEDF-R&D\n' + texte = texte + 'Equipe : SINETICS\n\n' texte = texte + 'Code utilisé : %s version %s\n' % (self.code,properties.version) return texte @@ -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)