From: cvs2git Date: Mon, 9 Sep 2002 10:39:07 +0000 (+0000) Subject: This commit was manufactured by cvs2git to create tag 'V1_3a2'. X-Git-Tag: V1_3a2 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=f8975cb3d56fecfc5130f24537976df6c7d6029a;p=tools%2Feficas.git This commit was manufactured by cvs2git to create tag 'V1_3a2'. Sprout from I26 2002-09-02 17:27:12 UTC eficas 'Version Aster 6.3.14' Cherrypick from master 2002-09-09 10:39:06 UTC eficas 'CCAR: evolution demandee dans la fiche EO2001-066 : on peut specifier dans editeur.ini': AIDE/__init__.py AIDE/aide_gui.py AIDE/aide_objets.py AIDE/index_aide.py Accas/A_ASSD.py Accas/A_AU_MOINS_UN.py Accas/A_A_CLASSER.py Accas/A_BLOC.py Accas/A_ENSEMBLE.py Accas/A_ETAPE.py Accas/A_EVAL.py Accas/A_EXCLUS.py Accas/A_FACT.py Accas/A_FORM.py Accas/A_FORM_ETAPE.py Accas/A_JDC.py Accas/A_JDC_CATA.py Accas/A_MACRO.py Accas/A_MACRO_ETAPE.py Accas/A_MCBLOC.py Accas/A_MCFACT.py Accas/A_MCLIST.py Accas/A_MCNUPLET.py Accas/A_MCSIMP.py Accas/A_NUPLET.py Accas/A_OPER.py Accas/A_PRESENT_ABSENT.py Accas/A_PRESENT_PRESENT.py Accas/A_PROC.py Accas/A_PROC_ETAPE.py Accas/A_SIMP.py Accas/A_UN_PARMI.py Accas/__init__.py Aster/INSTALL Aster/LICENSE.TERMS Aster/README Aster/alphasdist.py Aster/editeur.ini Aster/eficas_aster.py Aster/prefs.py Aster/sdist.py Editeur/Interp.py Editeur/Objecttreeitem.py Editeur/__init__.py Editeur/analyse_catalogue.py Editeur/appli.py Editeur/browser.py Editeur/bureau.py Editeur/catabrowser.py Editeur/cataediteur.py Editeur/centerwindow.py Editeur/compobloc.py Editeur/compocomm.py Editeur/compocommandecomm.py Editeur/compofact.py Editeur/compoformule.py Editeur/compojdc.py Editeur/compomacro.py Editeur/compomclist.py Editeur/componiveau.py Editeur/componuplet.py Editeur/compooper.py Editeur/compoparam.py Editeur/compoparameval.py Editeur/compoproc.py Editeur/composimp.py Editeur/configuration.py Editeur/definition_cata.py Editeur/eficas.py Editeur/eficas_go.py Editeur/faq.py Editeur/fenetre_mc_inconnus.py Editeur/fontes.py Editeur/images.py Editeur/import_code.py Editeur/jdcdisplay.py Editeur/menubar.py Editeur/options.py Editeur/panels.py Editeur/readercata.py Editeur/splash.py Editeur/statusbar.py Editeur/toolbar.py Editeur/tooltip.py Editeur/treeitemincanvas.py Editeur/treewidget.py Editeur/utils.py Editeur/widgets.py Exemples/ex11/main.py Extensions/__init__.py Extensions/commande_comm.py Extensions/commentaire.py Extensions/etape_niveau.py Extensions/interpreteur_formule.py Extensions/jdc.py Extensions/mcnuplet.py Extensions/niveau.py Extensions/nuplet.py Extensions/parametre.py Extensions/parametre_eval.py Extensions/pluginloader.py Ihm/I_ASSD.py Ihm/I_A_CLASSER.py Ihm/I_ENTITE.py Ihm/I_ETAPE.py Ihm/I_EXCLUS.py Ihm/I_FONCTION.py Ihm/I_FORM_ETAPE.py Ihm/I_JDC.py Ihm/I_JDC_CATA.py Ihm/I_MACRO_ETAPE.py Ihm/I_MCBLOC.py Ihm/I_MCCOMPO.py Ihm/I_MCFACT.py Ihm/I_MCLIST.py Ihm/I_MCSIMP.py Ihm/I_OBJECT.py Ihm/I_PRESENT_ABSENT.py Ihm/I_PRESENT_PRESENT.py Ihm/I_PROC_ETAPE.py Ihm/I_REGLE.py Ihm/I_UN_PARMI.py Ihm/__init__.py Installation/Doc_technique_install.doc Installation/README Installation/README_install Installation/install.py Minicode/cata_saturne.py Minicode/eficas_mini.py Minicode/prefs.py Tools/__init__.py Validation/V_ETAPE.py Validation/V_MACRO_ETAPE.py convert/Parserv5/Translate.py convert/Parserv5/__init__.py convert/Parserv5/conv.py convert/Parserv5/tables.py convert/Parserv5/tables.tag convert/__init__.py convert/convert_asterv5.py convert/convert_ini.py convert/convert_pyth.py convert/convert_python.py convert/parseur_python.py generator/Formatage.py generator/__init__.py generator/generator_aplat.py generator/generator_asterv5.py generator/generator_ini.py generator/generator_pyth.py generator/generator_python.py --- diff --git a/AIDE/__init__.py b/AIDE/__init__.py new file mode 100644 index 00000000..e4fa4596 --- /dev/null +++ b/AIDE/__init__.py @@ -0,0 +1,12 @@ +import os +import aide_objets +import aide_gui + +def go(fichier=None,master=None): + if not fichier : + fichier=os.path.join(os.path.dirname(__file__),"index_aide.py") + index = aide_objets.INDEX(fichier) + index.build() + o = aide_gui.AIDE_GUI(index,master=master) + o.build() + return o diff --git a/AIDE/aide_gui.py b/AIDE/aide_gui.py new file mode 100644 index 00000000..50aa3ce6 --- /dev/null +++ b/AIDE/aide_gui.py @@ -0,0 +1,212 @@ +""" +Ce module génère l'IHM permettant d'accéder à l'aide en ligne d'une application(ex: EFICAS) +Il analyse l'objet index passé en argument et génére automatiquement en conséquence le menu +avec liens hyper texte +""" + +from Tkinter import * + +class AIDE_GUI: + """ + Classe définissant l'IHM de l'appli d'aide + """ + def __init__(self,objet,master=None): + self.objet = objet + self.master = master + self.init() + self.init_window() + self.init_frames() + self.init_buttons() + self.init_text() + + def init(self): + """ + Initialise les structures de données utlisées par l'objet + """ + self.padx = [0,0,0,0] + self.padx[0] = 0 + self.padx[1] = 30 + self.padx[2] = 50 + self.historique = [] + + def init_window(self): + """ + Initialise la fenêtre mère de l'appli + """ + fenetre = Toplevel() + if self.master : + self.fenetre = fenetre + else: + self.fenetre = fenetre.master + fenetre.destroy() + self.fenetre.title(self.objet.titre) + self.fenetre.geometry("700x700+50+50") + self.fenetre.resizable(1,1) + #self.fenetre.minsize(600,800) + #self.fenetre.maxsize(900,800) + self.fenetre.protocol("WM_DELETE_WINDOW",self.quit) + self.fenetre.update() + + def init_frames(self): + """ + Initialise les frames principales de l'appli + """ + self.frame1 = Frame(self.fenetre,relief='flat',bd=2) + self.frame2 = Frame(self.fenetre,relief='flat',bd=2) + self.frame1.grid(row=0,column=0,sticky='news') + self.frame2.grid(row=1,column=0,sticky='news') + self.fenetre.grid_columnconfigure(0,weight=1,minsize=0) + self.fenetre.grid_rowconfigure(1,minsize=30) + self.fenetre.grid_rowconfigure(0,weight=1,minsize=0) + + def init_buttons(self): + """ + Crée les boutons dans le bas de la fenêtre + """ + self.b_retour = Button(self.frame2,text = "Précédent",command=self.go_back) + self.b_retour.place(relx=0.33,rely=0.5,anchor='center') + Button(self.frame2,text="Fermer",command=self.quit).place(relx=0.66,rely=0.5,anchor='center') + + + def init_text(self): + """ + Construit le widget Text qui accueillera l'index et les fichiers + """ + self.scroll_v = Scrollbar(self.frame1) + self.scroll_v.grid(row=0,column=1,rowspan=2,sticky='nesw') + self.scroll_h = Scrollbar(self.frame1,orient='horizontal') + self.scroll_h.grid(row=1,column=0,rowspan=2,sticky='nesw') + self.canvas = Canvas(self.frame1, + bg='white', + relief='sunken', + scrollregion=(0,0,1000,1000), + yscrollcommand=self.scroll_v.set, + xscrollcommand=self.scroll_h.set) + self.canvas.grid(row=0,column=0,sticky='nesw') + self.scroll_v.configure(command=self.canvas.yview) + self.scroll_h.configure(command=self.canvas.xview) + self.frame1.grid_columnconfigure(0,weight=1,minsize=0) + self.frame1.grid_rowconfigure(0,weight=1,minsize=0) + self.frame1.grid_rowconfigure(1,minsize=10) + self.frame1.grid_columnconfigure(1,minsize=10) + + def build(self): + """ + Lance la construction dynamique de l'index en hyper texte + """ + self.frame1.update_idletasks() + largeur = self.frame1.winfo_width() + self.canvas.create_rectangle(0,0,1,1,outline='white') + self.y_courant = 0 + # Construction du titre encadré d'une bordure + titre = self.canvas.create_text(int(largeur/2),50,anchor='center',text=self.objet.titre,font="Helvetica 12 bold") + bbox = self.canvas.bbox(titre) + bordure = self.canvas.create_rectangle(bbox[0]-5,bbox[1]-5,bbox[2]+5,bbox[3]+5, + outline = 'black', + fill = 'grey75') + self.canvas.lower(bordure) + self.y_courant += 100 + # Construction des items + for item in self.objet.l_items : + self.build_item(item,0) + # Affichage du texte dans le fichier associé (s'il existe) + if self.objet.fichier : + try: + texte=open(self.objet.fichier,'r').read() + except: + texte="Fichier %s inaccessible" % self.objet.fichier + self.canvas.create_text(10,self.y_courant+20, + text=texte, + anchor='nw') + # Configuration dynamique des boutons + self.config_boutons() + # + self.canvas.config(scrollregion=self.canvas.bbox('all')) + + def config_boutons(self): + """ + Activation du bouton précédent s'il y a lieu + """ + if self.historique : + self.b_retour.config(state='normal') + else : + self.b_retour.config(state='disabled') + + def build_item(self,item,padx): + """ + Affiche l'item dans le menu décalé de padx + """ + l = Label(self.canvas, + text=item.titre, + foreground = 'blue', + background='white', + font="Helvetica 12 bold") + l.bind("",lambda e,s=self,o=item : s.update_objet(o)) + l.bind("",lambda e,s=self,o=l : s.select_label(o)) + l.bind("",lambda e,s=self,o=l : s.deselect_label(o)) + self.canvas.create_window(self.padx[padx],self.y_courant,window=l,anchor='w') + self.y_courant += 20 + for sub_item in item.l_items : + self.build_item(sub_item,padx+1) + + def show_file(self,fichier): + """ + Affiche le fichier passé en argument + """ + print "on veut afficher :",fichier + + def select_label(self,label): + """ + Callback invoqué lorsque le label passé en argument est sélectionné + """ + label.config(fg='white',bg='blue') + + def deselect_label(self,label): + """ + Callback invoqué lorsque le label passé en argument est sélectionné + """ + label.config(bg='white',fg='blue') + + def go_back(self): + """ + Affiche l'item précédent + """ + self.update_objet(self.historique[-1]) + self.historique = self.historique[0:-1] + # Configuration dynamique des boutons + self.config_boutons() + + def update_objet(self,new_objet): + """ + Cette méthode remplace l'objet courant par new_objet. + Elle vide le widget text et affiche le nouvel objet + """ + if not self.historique : + self.historique.append(self.objet) + elif new_objet is not self.historique[-1] : + self.historique.append(self.objet) + self.objet = new_objet + self.canvas.delete('all') + self.build() + + def quit(self): + """ + Ferme l'appli Aide + """ + self.fenetre.destroy() + + + + + + + + + + + + + + + + diff --git a/AIDE/aide_objets.py b/AIDE/aide_objets.py new file mode 100644 index 00000000..e8e923fd --- /dev/null +++ b/AIDE/aide_objets.py @@ -0,0 +1,76 @@ +""" +Ce module génère un objet INDEX par lecture et interprétation du fichier texte +le décrivant (ex : index_aide.py) +""" + +import os + +class ITEM_INDEX : + """ + Construit un objet ITEM_INDEX + """ + def __init__(self,t_item): + self.t_item = t_item + self.init() + + def init(self): + """ + Initialise les structures de données de l'item + """ + self.titre = "" + self.fichier = "" + self.l_items = [] + + def build(self): + """ + Construit les sous-items de self s'il y a lieu et retoruve le label et le fichier de l'item + dans le tuple + """ + self.titre = self.t_item[0] + self.fichier = self.t_item[1] + l_items = self.t_item[2] + if l_items : + for item in l_items : + o = ITEM_INDEX(item) + o.build() + self.l_items.append(o) + +class INDEX : + """ + Construit un objet INDEX (non graphique) à partir de l'interprétation du fichier d'index + (type index_aide.py) passé en argument + """ + def __init__(self,fichier_index): + self.fichier_index = fichier_index + self.init() + + def init(self): + """ + Initialise les structures de données propres à l'index + """ + self.titre = "" + self.fichier = None + self.l_items = [] + + def build(self): + """ + Lit le fichier index et l'interprète + """ + txt = open(self.fichier_index,'r').read() + d = {} + d['repertoire']=os.path.dirname(self.fichier_index) + #txt = "items ="+txt + #print txt + exec txt in d + items = d.get("items",None) + if items : + self.titre = items[0] + self.fichier = items[1] + l_items = items[2] + for item in l_items : + o = ITEM_INDEX(item) + o.build() + self.l_items.append(o) + + + diff --git a/AIDE/index_aide.py b/AIDE/index_aide.py new file mode 100644 index 00000000..6c462c81 --- /dev/null +++ b/AIDE/index_aide.py @@ -0,0 +1,24 @@ +""" +Contient la description des fichiers d'aide et leur structuration + +chaque panneau est un tuple de 3 éléments : + +- élément 1 : titre de la page +- élément 2 : URL du fichier à afficher quand on visualise cette page d'aide ou None si aucun +- élément 3 : tuple contenant les sous-panneaux de ce panneau (tuple de 3-tuples) ou None si aucun + +La variable repertoire est initialisee avec le chemin du repertoire local +""" + +import os + +items =("Aide en ligne EFICAS",None, + ( + ("FAQs",os.path.join(repertoire,"..","Editeur","faqs.txt"),None), + ("Install",os.path.join(repertoire,"..","INSTALL"), + ( + ("Procedure d'installation",os.path.join(repertoire,"..","README_install"),None), + ) + ), + ), + ) diff --git a/Accas/A_ASSD.py b/Accas/A_ASSD.py new file mode 100644 index 00000000..b9661c45 --- /dev/null +++ b/Accas/A_ASSD.py @@ -0,0 +1,49 @@ +# CONFIGURATION MANAGEMENT OF EDF VERSION +# ====================================================================== +# COPYRIGHT (C) 1991 - 2002 EDF R&D WWW.CODE-ASTER.ORG +# THIS PROGRAM IS FREE SOFTWARE; YOU CAN REDISTRIBUTE IT AND/OR MODIFY +# IT UNDER THE TERMS OF THE GNU GENERAL PUBLIC LICENSE AS PUBLISHED BY +# THE FREE SOFTWARE FOUNDATION; EITHER VERSION 2 OF THE LICENSE, OR +# (AT YOUR OPTION) ANY LATER VERSION. +# +# THIS PROGRAM IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL, BUT +# WITHOUT ANY WARRANTY; WITHOUT EVEN THE IMPLIED WARRANTY OF +# MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. SEE THE GNU +# GENERAL PUBLIC LICENSE FOR MORE DETAILS. +# +# YOU SHOULD HAVE RECEIVED A COPY OF THE GNU GENERAL PUBLIC LICENSE +# ALONG WITH THIS PROGRAM; IF NOT, WRITE TO EDF R&D CODE_ASTER, +# 1 AVENUE DU GENERAL DE GAULLE, 92141 CLAMART CEDEX, FRANCE. +# +# +# ====================================================================== + +from Ihm import I_ASSD +from Ihm import I_FONCTION +from Noyau import N_ASSD +from Noyau import N_GEOM +from Noyau import N_FONCTION +from Noyau import N_CO + +# On ajoute la classe ASSD dans l'héritage multiple pour recréer +# une hiérarchie d'héritage identique à celle de Noyau +# pour faire en sorte que isinstance(o,ASSD) marche encore après +# dérivation + +class ASSD(N_ASSD.ASSD,I_ASSD.ASSD):pass + +class assd(N_ASSD.assd,I_ASSD.ASSD,ASSD):pass + +class FONCTION(N_FONCTION.FONCTION,I_FONCTION.FONCTION,ASSD): + def __init__(self,etape=None,sd=None,reg='oui'): + N_FONCTION.FONCTION.__init__(self,etape=etape,sd=sd,reg=reg) + I_FONCTION.FONCTION.__init__(self,etape=etape,sd=sd,reg=reg) + +class fonction(N_FONCTION.fonction,I_FONCTION.fonction,ASSD): + def __init__(self,etape=None,sd=None,reg='oui'): + N_FONCTION.fonction.__init__(self,etape=etape,sd=sd,reg=reg) + I_FONCTION.fonction.__init__(self,etape=etape,sd=sd,reg=reg) + +class GEOM(N_GEOM.GEOM,I_ASSD.ASSD,ASSD):pass +class geom(N_GEOM.geom,I_ASSD.ASSD,ASSD):pass +class CO(N_CO.CO,I_ASSD.ASSD,ASSD):pass diff --git a/Accas/A_AU_MOINS_UN.py b/Accas/A_AU_MOINS_UN.py index d7c525b0..eb194670 100644 --- a/Accas/A_AU_MOINS_UN.py +++ b/Accas/A_AU_MOINS_UN.py @@ -1,3 +1,22 @@ +# CONFIGURATION MANAGEMENT OF EDF VERSION +# ====================================================================== +# COPYRIGHT (C) 1991 - 2002 EDF R&D WWW.CODE-ASTER.ORG +# THIS PROGRAM IS FREE SOFTWARE; YOU CAN REDISTRIBUTE IT AND/OR MODIFY +# IT UNDER THE TERMS OF THE GNU GENERAL PUBLIC LICENSE AS PUBLISHED BY +# THE FREE SOFTWARE FOUNDATION; EITHER VERSION 2 OF THE LICENSE, OR +# (AT YOUR OPTION) ANY LATER VERSION. +# +# THIS PROGRAM IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL, BUT +# WITHOUT ANY WARRANTY; WITHOUT EVEN THE IMPLIED WARRANTY OF +# MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. SEE THE GNU +# GENERAL PUBLIC LICENSE FOR MORE DETAILS. +# +# YOU SHOULD HAVE RECEIVED A COPY OF THE GNU GENERAL PUBLIC LICENSE +# ALONG WITH THIS PROGRAM; IF NOT, WRITE TO EDF R&D CODE_ASTER, +# 1 AVENUE DU GENERAL DE GAULLE, 92141 CLAMART CEDEX, FRANCE. +# +# +# ====================================================================== from Noyau import N_REGLE from Validation import V_AU_MOINS_UN from Ihm import I_REGLE diff --git a/Accas/A_A_CLASSER.py b/Accas/A_A_CLASSER.py index c3b32deb..b522b2cd 100644 --- a/Accas/A_A_CLASSER.py +++ b/Accas/A_A_CLASSER.py @@ -1,3 +1,22 @@ +# CONFIGURATION MANAGEMENT OF EDF VERSION +# ====================================================================== +# COPYRIGHT (C) 1991 - 2002 EDF R&D WWW.CODE-ASTER.ORG +# THIS PROGRAM IS FREE SOFTWARE; YOU CAN REDISTRIBUTE IT AND/OR MODIFY +# IT UNDER THE TERMS OF THE GNU GENERAL PUBLIC LICENSE AS PUBLISHED BY +# THE FREE SOFTWARE FOUNDATION; EITHER VERSION 2 OF THE LICENSE, OR +# (AT YOUR OPTION) ANY LATER VERSION. +# +# THIS PROGRAM IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL, BUT +# WITHOUT ANY WARRANTY; WITHOUT EVEN THE IMPLIED WARRANTY OF +# MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. SEE THE GNU +# GENERAL PUBLIC LICENSE FOR MORE DETAILS. +# +# YOU SHOULD HAVE RECEIVED A COPY OF THE GNU GENERAL PUBLIC LICENSE +# ALONG WITH THIS PROGRAM; IF NOT, WRITE TO EDF R&D CODE_ASTER, +# 1 AVENUE DU GENERAL DE GAULLE, 92141 CLAMART CEDEX, FRANCE. +# +# +# ====================================================================== from Noyau import N_REGLE from Validation import V_A_CLASSER from Ihm import I_A_CLASSER diff --git a/Accas/A_BLOC.py b/Accas/A_BLOC.py index 5b341d6c..d8e16e74 100644 --- a/Accas/A_BLOC.py +++ b/Accas/A_BLOC.py @@ -1,3 +1,22 @@ +# CONFIGURATION MANAGEMENT OF EDF VERSION +# ====================================================================== +# COPYRIGHT (C) 1991 - 2002 EDF R&D WWW.CODE-ASTER.ORG +# THIS PROGRAM IS FREE SOFTWARE; YOU CAN REDISTRIBUTE IT AND/OR MODIFY +# IT UNDER THE TERMS OF THE GNU GENERAL PUBLIC LICENSE AS PUBLISHED BY +# THE FREE SOFTWARE FOUNDATION; EITHER VERSION 2 OF THE LICENSE, OR +# (AT YOUR OPTION) ANY LATER VERSION. +# +# THIS PROGRAM IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL, BUT +# WITHOUT ANY WARRANTY; WITHOUT EVEN THE IMPLIED WARRANTY OF +# MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. SEE THE GNU +# GENERAL PUBLIC LICENSE FOR MORE DETAILS. +# +# YOU SHOULD HAVE RECEIVED A COPY OF THE GNU GENERAL PUBLIC LICENSE +# ALONG WITH THIS PROGRAM; IF NOT, WRITE TO EDF R&D CODE_ASTER, +# 1 AVENUE DU GENERAL DE GAULLE, 92141 CLAMART CEDEX, FRANCE. +# +# +# ====================================================================== from Noyau import N_BLOC from Ihm import I_ENTITE import A_MCBLOC diff --git a/Accas/A_ENSEMBLE.py b/Accas/A_ENSEMBLE.py index 6675920b..e9ebac78 100644 --- a/Accas/A_ENSEMBLE.py +++ b/Accas/A_ENSEMBLE.py @@ -1,3 +1,22 @@ +# CONFIGURATION MANAGEMENT OF EDF VERSION +# ====================================================================== +# COPYRIGHT (C) 1991 - 2002 EDF R&D WWW.CODE-ASTER.ORG +# THIS PROGRAM IS FREE SOFTWARE; YOU CAN REDISTRIBUTE IT AND/OR MODIFY +# IT UNDER THE TERMS OF THE GNU GENERAL PUBLIC LICENSE AS PUBLISHED BY +# THE FREE SOFTWARE FOUNDATION; EITHER VERSION 2 OF THE LICENSE, OR +# (AT YOUR OPTION) ANY LATER VERSION. +# +# THIS PROGRAM IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL, BUT +# WITHOUT ANY WARRANTY; WITHOUT EVEN THE IMPLIED WARRANTY OF +# MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. SEE THE GNU +# GENERAL PUBLIC LICENSE FOR MORE DETAILS. +# +# YOU SHOULD HAVE RECEIVED A COPY OF THE GNU GENERAL PUBLIC LICENSE +# ALONG WITH THIS PROGRAM; IF NOT, WRITE TO EDF R&D CODE_ASTER, +# 1 AVENUE DU GENERAL DE GAULLE, 92141 CLAMART CEDEX, FRANCE. +# +# +# ====================================================================== from Noyau import N_REGLE from Validation import V_ENSEMBLE from Ihm import I_REGLE diff --git a/Accas/A_ETAPE.py b/Accas/A_ETAPE.py index cfd20bd9..512a3648 100644 --- a/Accas/A_ETAPE.py +++ b/Accas/A_ETAPE.py @@ -1,3 +1,22 @@ +# CONFIGURATION MANAGEMENT OF EDF VERSION +# ====================================================================== +# COPYRIGHT (C) 1991 - 2002 EDF R&D WWW.CODE-ASTER.ORG +# THIS PROGRAM IS FREE SOFTWARE; YOU CAN REDISTRIBUTE IT AND/OR MODIFY +# IT UNDER THE TERMS OF THE GNU GENERAL PUBLIC LICENSE AS PUBLISHED BY +# THE FREE SOFTWARE FOUNDATION; EITHER VERSION 2 OF THE LICENSE, OR +# (AT YOUR OPTION) ANY LATER VERSION. +# +# THIS PROGRAM IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL, BUT +# WITHOUT ANY WARRANTY; WITHOUT EVEN THE IMPLIED WARRANTY OF +# MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. SEE THE GNU +# GENERAL PUBLIC LICENSE FOR MORE DETAILS. +# +# YOU SHOULD HAVE RECEIVED A COPY OF THE GNU GENERAL PUBLIC LICENSE +# ALONG WITH THIS PROGRAM; IF NOT, WRITE TO EDF R&D CODE_ASTER, +# 1 AVENUE DU GENERAL DE GAULLE, 92141 CLAMART CEDEX, FRANCE. +# +# +# ====================================================================== from Noyau import N_ETAPE from Validation import V_ETAPE from Ihm import I_ETAPE diff --git a/Accas/A_EVAL.py b/Accas/A_EVAL.py index dff258a9..ab40f123 100644 --- a/Accas/A_EVAL.py +++ b/Accas/A_EVAL.py @@ -1,3 +1,22 @@ +# CONFIGURATION MANAGEMENT OF EDF VERSION +# ====================================================================== +# COPYRIGHT (C) 1991 - 2002 EDF R&D WWW.CODE-ASTER.ORG +# THIS PROGRAM IS FREE SOFTWARE; YOU CAN REDISTRIBUTE IT AND/OR MODIFY +# IT UNDER THE TERMS OF THE GNU GENERAL PUBLIC LICENSE AS PUBLISHED BY +# THE FREE SOFTWARE FOUNDATION; EITHER VERSION 2 OF THE LICENSE, OR +# (AT YOUR OPTION) ANY LATER VERSION. +# +# THIS PROGRAM IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL, BUT +# WITHOUT ANY WARRANTY; WITHOUT EVEN THE IMPLIED WARRANTY OF +# MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. SEE THE GNU +# GENERAL PUBLIC LICENSE FOR MORE DETAILS. +# +# YOU SHOULD HAVE RECEIVED A COPY OF THE GNU GENERAL PUBLIC LICENSE +# ALONG WITH THIS PROGRAM; IF NOT, WRITE TO EDF R&D CODE_ASTER, +# 1 AVENUE DU GENERAL DE GAULLE, 92141 CLAMART CEDEX, FRANCE. +# +# +# ====================================================================== from Noyau import N_EVAL class EVAL(N_EVAL.EVAL): diff --git a/Accas/A_EXCLUS.py b/Accas/A_EXCLUS.py index 5473d01a..5bbf943e 100644 --- a/Accas/A_EXCLUS.py +++ b/Accas/A_EXCLUS.py @@ -1,3 +1,22 @@ +# CONFIGURATION MANAGEMENT OF EDF VERSION +# ====================================================================== +# COPYRIGHT (C) 1991 - 2002 EDF R&D WWW.CODE-ASTER.ORG +# THIS PROGRAM IS FREE SOFTWARE; YOU CAN REDISTRIBUTE IT AND/OR MODIFY +# IT UNDER THE TERMS OF THE GNU GENERAL PUBLIC LICENSE AS PUBLISHED BY +# THE FREE SOFTWARE FOUNDATION; EITHER VERSION 2 OF THE LICENSE, OR +# (AT YOUR OPTION) ANY LATER VERSION. +# +# THIS PROGRAM IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL, BUT +# WITHOUT ANY WARRANTY; WITHOUT EVEN THE IMPLIED WARRANTY OF +# MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. SEE THE GNU +# GENERAL PUBLIC LICENSE FOR MORE DETAILS. +# +# YOU SHOULD HAVE RECEIVED A COPY OF THE GNU GENERAL PUBLIC LICENSE +# ALONG WITH THIS PROGRAM; IF NOT, WRITE TO EDF R&D CODE_ASTER, +# 1 AVENUE DU GENERAL DE GAULLE, 92141 CLAMART CEDEX, FRANCE. +# +# +# ====================================================================== from Noyau import N_REGLE from Validation import V_EXCLUS from Ihm import I_EXCLUS diff --git a/Accas/A_FACT.py b/Accas/A_FACT.py index d40a9c59..b2c8998e 100644 --- a/Accas/A_FACT.py +++ b/Accas/A_FACT.py @@ -1,3 +1,22 @@ +# CONFIGURATION MANAGEMENT OF EDF VERSION +# ====================================================================== +# COPYRIGHT (C) 1991 - 2002 EDF R&D WWW.CODE-ASTER.ORG +# THIS PROGRAM IS FREE SOFTWARE; YOU CAN REDISTRIBUTE IT AND/OR MODIFY +# IT UNDER THE TERMS OF THE GNU GENERAL PUBLIC LICENSE AS PUBLISHED BY +# THE FREE SOFTWARE FOUNDATION; EITHER VERSION 2 OF THE LICENSE, OR +# (AT YOUR OPTION) ANY LATER VERSION. +# +# THIS PROGRAM IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL, BUT +# WITHOUT ANY WARRANTY; WITHOUT EVEN THE IMPLIED WARRANTY OF +# MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. SEE THE GNU +# GENERAL PUBLIC LICENSE FOR MORE DETAILS. +# +# YOU SHOULD HAVE RECEIVED A COPY OF THE GNU GENERAL PUBLIC LICENSE +# ALONG WITH THIS PROGRAM; IF NOT, WRITE TO EDF R&D CODE_ASTER, +# 1 AVENUE DU GENERAL DE GAULLE, 92141 CLAMART CEDEX, FRANCE. +# +# +# ====================================================================== from Noyau import N_FACT from Ihm import I_ENTITE import A_MCFACT diff --git a/Accas/A_FORM.py b/Accas/A_FORM.py index 132a24b9..ea61db3e 100644 --- a/Accas/A_FORM.py +++ b/Accas/A_FORM.py @@ -1,3 +1,22 @@ +# CONFIGURATION MANAGEMENT OF EDF VERSION +# ====================================================================== +# COPYRIGHT (C) 1991 - 2002 EDF R&D WWW.CODE-ASTER.ORG +# THIS PROGRAM IS FREE SOFTWARE; YOU CAN REDISTRIBUTE IT AND/OR MODIFY +# IT UNDER THE TERMS OF THE GNU GENERAL PUBLIC LICENSE AS PUBLISHED BY +# THE FREE SOFTWARE FOUNDATION; EITHER VERSION 2 OF THE LICENSE, OR +# (AT YOUR OPTION) ANY LATER VERSION. +# +# THIS PROGRAM IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL, BUT +# WITHOUT ANY WARRANTY; WITHOUT EVEN THE IMPLIED WARRANTY OF +# MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. SEE THE GNU +# GENERAL PUBLIC LICENSE FOR MORE DETAILS. +# +# YOU SHOULD HAVE RECEIVED A COPY OF THE GNU GENERAL PUBLIC LICENSE +# ALONG WITH THIS PROGRAM; IF NOT, WRITE TO EDF R&D CODE_ASTER, +# 1 AVENUE DU GENERAL DE GAULLE, 92141 CLAMART CEDEX, FRANCE. +# +# +# ====================================================================== from Noyau import N_FORM from Ihm import I_ENTITE import A_FORM_ETAPE diff --git a/Accas/A_FORM_ETAPE.py b/Accas/A_FORM_ETAPE.py index 9c6483bd..af4d7cf0 100644 --- a/Accas/A_FORM_ETAPE.py +++ b/Accas/A_FORM_ETAPE.py @@ -1,3 +1,22 @@ +# CONFIGURATION MANAGEMENT OF EDF VERSION +# ====================================================================== +# COPYRIGHT (C) 1991 - 2002 EDF R&D WWW.CODE-ASTER.ORG +# THIS PROGRAM IS FREE SOFTWARE; YOU CAN REDISTRIBUTE IT AND/OR MODIFY +# IT UNDER THE TERMS OF THE GNU GENERAL PUBLIC LICENSE AS PUBLISHED BY +# THE FREE SOFTWARE FOUNDATION; EITHER VERSION 2 OF THE LICENSE, OR +# (AT YOUR OPTION) ANY LATER VERSION. +# +# THIS PROGRAM IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL, BUT +# WITHOUT ANY WARRANTY; WITHOUT EVEN THE IMPLIED WARRANTY OF +# MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. SEE THE GNU +# GENERAL PUBLIC LICENSE FOR MORE DETAILS. +# +# YOU SHOULD HAVE RECEIVED A COPY OF THE GNU GENERAL PUBLIC LICENSE +# ALONG WITH THIS PROGRAM; IF NOT, WRITE TO EDF R&D CODE_ASTER, +# 1 AVENUE DU GENERAL DE GAULLE, 92141 CLAMART CEDEX, FRANCE. +# +# +# ====================================================================== from Noyau import N_FORM_ETAPE from Validation import V_MACRO_ETAPE from Ihm import I_FORM_ETAPE diff --git a/Accas/A_JDC.py b/Accas/A_JDC.py index b709e01f..9216fe5a 100644 --- a/Accas/A_JDC.py +++ b/Accas/A_JDC.py @@ -1,9 +1,30 @@ +# CONFIGURATION MANAGEMENT OF EDF VERSION +# ====================================================================== +# COPYRIGHT (C) 1991 - 2002 EDF R&D WWW.CODE-ASTER.ORG +# THIS PROGRAM IS FREE SOFTWARE; YOU CAN REDISTRIBUTE IT AND/OR MODIFY +# IT UNDER THE TERMS OF THE GNU GENERAL PUBLIC LICENSE AS PUBLISHED BY +# THE FREE SOFTWARE FOUNDATION; EITHER VERSION 2 OF THE LICENSE, OR +# (AT YOUR OPTION) ANY LATER VERSION. +# +# THIS PROGRAM IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL, BUT +# WITHOUT ANY WARRANTY; WITHOUT EVEN THE IMPLIED WARRANTY OF +# MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. SEE THE GNU +# GENERAL PUBLIC LICENSE FOR MORE DETAILS. +# +# YOU SHOULD HAVE RECEIVED A COPY OF THE GNU GENERAL PUBLIC LICENSE +# ALONG WITH THIS PROGRAM; IF NOT, WRITE TO EDF R&D CODE_ASTER, +# 1 AVENUE DU GENERAL DE GAULLE, 92141 CLAMART CEDEX, FRANCE. +# +# +# ====================================================================== from Noyau import N_JDC from Validation import V_JDC from Extensions import jdc from Ihm import I_JDC class JDC(jdc.JDC,I_JDC.JDC,V_JDC.JDC,N_JDC.JDC): + from A_ASSD import CO,assd + def __init__(self,*pos,**args): N_JDC.JDC.__init__(self,*pos,**args) V_JDC.JDC.__init__(self) diff --git a/Accas/A_JDC_CATA.py b/Accas/A_JDC_CATA.py index 0a810dc3..10cf409e 100644 --- a/Accas/A_JDC_CATA.py +++ b/Accas/A_JDC_CATA.py @@ -1,3 +1,22 @@ +# CONFIGURATION MANAGEMENT OF EDF VERSION +# ====================================================================== +# COPYRIGHT (C) 1991 - 2002 EDF R&D WWW.CODE-ASTER.ORG +# THIS PROGRAM IS FREE SOFTWARE; YOU CAN REDISTRIBUTE IT AND/OR MODIFY +# IT UNDER THE TERMS OF THE GNU GENERAL PUBLIC LICENSE AS PUBLISHED BY +# THE FREE SOFTWARE FOUNDATION; EITHER VERSION 2 OF THE LICENSE, OR +# (AT YOUR OPTION) ANY LATER VERSION. +# +# THIS PROGRAM IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL, BUT +# WITHOUT ANY WARRANTY; WITHOUT EVEN THE IMPLIED WARRANTY OF +# MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. SEE THE GNU +# GENERAL PUBLIC LICENSE FOR MORE DETAILS. +# +# YOU SHOULD HAVE RECEIVED A COPY OF THE GNU GENERAL PUBLIC LICENSE +# ALONG WITH THIS PROGRAM; IF NOT, WRITE TO EDF R&D CODE_ASTER, +# 1 AVENUE DU GENERAL DE GAULLE, 92141 CLAMART CEDEX, FRANCE. +# +# +# ====================================================================== from Noyau import N_JDC_CATA import A_JDC from Ihm import I_JDC_CATA diff --git a/Accas/A_MACRO.py b/Accas/A_MACRO.py index 311769f8..d4e3fd1d 100644 --- a/Accas/A_MACRO.py +++ b/Accas/A_MACRO.py @@ -1,3 +1,22 @@ +# CONFIGURATION MANAGEMENT OF EDF VERSION +# ====================================================================== +# COPYRIGHT (C) 1991 - 2002 EDF R&D WWW.CODE-ASTER.ORG +# THIS PROGRAM IS FREE SOFTWARE; YOU CAN REDISTRIBUTE IT AND/OR MODIFY +# IT UNDER THE TERMS OF THE GNU GENERAL PUBLIC LICENSE AS PUBLISHED BY +# THE FREE SOFTWARE FOUNDATION; EITHER VERSION 2 OF THE LICENSE, OR +# (AT YOUR OPTION) ANY LATER VERSION. +# +# THIS PROGRAM IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL, BUT +# WITHOUT ANY WARRANTY; WITHOUT EVEN THE IMPLIED WARRANTY OF +# MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. SEE THE GNU +# GENERAL PUBLIC LICENSE FOR MORE DETAILS. +# +# YOU SHOULD HAVE RECEIVED A COPY OF THE GNU GENERAL PUBLIC LICENSE +# ALONG WITH THIS PROGRAM; IF NOT, WRITE TO EDF R&D CODE_ASTER, +# 1 AVENUE DU GENERAL DE GAULLE, 92141 CLAMART CEDEX, FRANCE. +# +# +# ====================================================================== from Noyau import N_MACRO from Ihm import I_ENTITE import A_MACRO_ETAPE diff --git a/Accas/A_MACRO_ETAPE.py b/Accas/A_MACRO_ETAPE.py index 29463bd5..9613ebb0 100644 --- a/Accas/A_MACRO_ETAPE.py +++ b/Accas/A_MACRO_ETAPE.py @@ -1,3 +1,22 @@ +# CONFIGURATION MANAGEMENT OF EDF VERSION +# ====================================================================== +# COPYRIGHT (C) 1991 - 2002 EDF R&D WWW.CODE-ASTER.ORG +# THIS PROGRAM IS FREE SOFTWARE; YOU CAN REDISTRIBUTE IT AND/OR MODIFY +# IT UNDER THE TERMS OF THE GNU GENERAL PUBLIC LICENSE AS PUBLISHED BY +# THE FREE SOFTWARE FOUNDATION; EITHER VERSION 2 OF THE LICENSE, OR +# (AT YOUR OPTION) ANY LATER VERSION. +# +# THIS PROGRAM IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL, BUT +# WITHOUT ANY WARRANTY; WITHOUT EVEN THE IMPLIED WARRANTY OF +# MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. SEE THE GNU +# GENERAL PUBLIC LICENSE FOR MORE DETAILS. +# +# YOU SHOULD HAVE RECEIVED A COPY OF THE GNU GENERAL PUBLIC LICENSE +# ALONG WITH THIS PROGRAM; IF NOT, WRITE TO EDF R&D CODE_ASTER, +# 1 AVENUE DU GENERAL DE GAULLE, 92141 CLAMART CEDEX, FRANCE. +# +# +# ====================================================================== from Noyau import N_MACRO_ETAPE from Validation import V_MACRO_ETAPE from Ihm import I_MACRO_ETAPE diff --git a/Accas/A_MCBLOC.py b/Accas/A_MCBLOC.py index 3f931840..963ae8f1 100644 --- a/Accas/A_MCBLOC.py +++ b/Accas/A_MCBLOC.py @@ -1,3 +1,22 @@ +# CONFIGURATION MANAGEMENT OF EDF VERSION +# ====================================================================== +# COPYRIGHT (C) 1991 - 2002 EDF R&D WWW.CODE-ASTER.ORG +# THIS PROGRAM IS FREE SOFTWARE; YOU CAN REDISTRIBUTE IT AND/OR MODIFY +# IT UNDER THE TERMS OF THE GNU GENERAL PUBLIC LICENSE AS PUBLISHED BY +# THE FREE SOFTWARE FOUNDATION; EITHER VERSION 2 OF THE LICENSE, OR +# (AT YOUR OPTION) ANY LATER VERSION. +# +# THIS PROGRAM IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL, BUT +# WITHOUT ANY WARRANTY; WITHOUT EVEN THE IMPLIED WARRANTY OF +# MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. SEE THE GNU +# GENERAL PUBLIC LICENSE FOR MORE DETAILS. +# +# YOU SHOULD HAVE RECEIVED A COPY OF THE GNU GENERAL PUBLIC LICENSE +# ALONG WITH THIS PROGRAM; IF NOT, WRITE TO EDF R&D CODE_ASTER, +# 1 AVENUE DU GENERAL DE GAULLE, 92141 CLAMART CEDEX, FRANCE. +# +# +# ====================================================================== from Noyau import N_MCBLOC from Validation import V_MCBLOC from Ihm import I_MCBLOC diff --git a/Accas/A_MCFACT.py b/Accas/A_MCFACT.py index 96d172a6..5a1b2a96 100644 --- a/Accas/A_MCFACT.py +++ b/Accas/A_MCFACT.py @@ -1,3 +1,22 @@ +# CONFIGURATION MANAGEMENT OF EDF VERSION +# ====================================================================== +# COPYRIGHT (C) 1991 - 2002 EDF R&D WWW.CODE-ASTER.ORG +# THIS PROGRAM IS FREE SOFTWARE; YOU CAN REDISTRIBUTE IT AND/OR MODIFY +# IT UNDER THE TERMS OF THE GNU GENERAL PUBLIC LICENSE AS PUBLISHED BY +# THE FREE SOFTWARE FOUNDATION; EITHER VERSION 2 OF THE LICENSE, OR +# (AT YOUR OPTION) ANY LATER VERSION. +# +# THIS PROGRAM IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL, BUT +# WITHOUT ANY WARRANTY; WITHOUT EVEN THE IMPLIED WARRANTY OF +# MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. SEE THE GNU +# GENERAL PUBLIC LICENSE FOR MORE DETAILS. +# +# YOU SHOULD HAVE RECEIVED A COPY OF THE GNU GENERAL PUBLIC LICENSE +# ALONG WITH THIS PROGRAM; IF NOT, WRITE TO EDF R&D CODE_ASTER, +# 1 AVENUE DU GENERAL DE GAULLE, 92141 CLAMART CEDEX, FRANCE. +# +# +# ====================================================================== from Noyau import N_MCFACT from Validation import V_MCFACT from Ihm import I_MCFACT diff --git a/Accas/A_MCLIST.py b/Accas/A_MCLIST.py index e3fba40a..d2874c59 100644 --- a/Accas/A_MCLIST.py +++ b/Accas/A_MCLIST.py @@ -1,3 +1,22 @@ +# CONFIGURATION MANAGEMENT OF EDF VERSION +# ====================================================================== +# COPYRIGHT (C) 1991 - 2002 EDF R&D WWW.CODE-ASTER.ORG +# THIS PROGRAM IS FREE SOFTWARE; YOU CAN REDISTRIBUTE IT AND/OR MODIFY +# IT UNDER THE TERMS OF THE GNU GENERAL PUBLIC LICENSE AS PUBLISHED BY +# THE FREE SOFTWARE FOUNDATION; EITHER VERSION 2 OF THE LICENSE, OR +# (AT YOUR OPTION) ANY LATER VERSION. +# +# THIS PROGRAM IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL, BUT +# WITHOUT ANY WARRANTY; WITHOUT EVEN THE IMPLIED WARRANTY OF +# MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. SEE THE GNU +# GENERAL PUBLIC LICENSE FOR MORE DETAILS. +# +# YOU SHOULD HAVE RECEIVED A COPY OF THE GNU GENERAL PUBLIC LICENSE +# ALONG WITH THIS PROGRAM; IF NOT, WRITE TO EDF R&D CODE_ASTER, +# 1 AVENUE DU GENERAL DE GAULLE, 92141 CLAMART CEDEX, FRANCE. +# +# +# ====================================================================== from Noyau import N_MCLIST from Validation import V_MCLIST from Ihm import I_MCLIST diff --git a/Accas/A_MCNUPLET.py b/Accas/A_MCNUPLET.py index 49bfa75b..76258bae 100644 --- a/Accas/A_MCNUPLET.py +++ b/Accas/A_MCNUPLET.py @@ -1,3 +1,22 @@ +# CONFIGURATION MANAGEMENT OF EDF VERSION +# ====================================================================== +# COPYRIGHT (C) 1991 - 2002 EDF R&D WWW.CODE-ASTER.ORG +# THIS PROGRAM IS FREE SOFTWARE; YOU CAN REDISTRIBUTE IT AND/OR MODIFY +# IT UNDER THE TERMS OF THE GNU GENERAL PUBLIC LICENSE AS PUBLISHED BY +# THE FREE SOFTWARE FOUNDATION; EITHER VERSION 2 OF THE LICENSE, OR +# (AT YOUR OPTION) ANY LATER VERSION. +# +# THIS PROGRAM IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL, BUT +# WITHOUT ANY WARRANTY; WITHOUT EVEN THE IMPLIED WARRANTY OF +# MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. SEE THE GNU +# GENERAL PUBLIC LICENSE FOR MORE DETAILS. +# +# YOU SHOULD HAVE RECEIVED A COPY OF THE GNU GENERAL PUBLIC LICENSE +# ALONG WITH THIS PROGRAM; IF NOT, WRITE TO EDF R&D CODE_ASTER, +# 1 AVENUE DU GENERAL DE GAULLE, 92141 CLAMART CEDEX, FRANCE. +# +# +# ====================================================================== from Extensions import mcnuplet from Ihm import I_MCCOMPO diff --git a/Accas/A_MCSIMP.py b/Accas/A_MCSIMP.py index 35854885..b517eb65 100644 --- a/Accas/A_MCSIMP.py +++ b/Accas/A_MCSIMP.py @@ -1,3 +1,22 @@ +# CONFIGURATION MANAGEMENT OF EDF VERSION +# ====================================================================== +# COPYRIGHT (C) 1991 - 2002 EDF R&D WWW.CODE-ASTER.ORG +# THIS PROGRAM IS FREE SOFTWARE; YOU CAN REDISTRIBUTE IT AND/OR MODIFY +# IT UNDER THE TERMS OF THE GNU GENERAL PUBLIC LICENSE AS PUBLISHED BY +# THE FREE SOFTWARE FOUNDATION; EITHER VERSION 2 OF THE LICENSE, OR +# (AT YOUR OPTION) ANY LATER VERSION. +# +# THIS PROGRAM IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL, BUT +# WITHOUT ANY WARRANTY; WITHOUT EVEN THE IMPLIED WARRANTY OF +# MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. SEE THE GNU +# GENERAL PUBLIC LICENSE FOR MORE DETAILS. +# +# YOU SHOULD HAVE RECEIVED A COPY OF THE GNU GENERAL PUBLIC LICENSE +# ALONG WITH THIS PROGRAM; IF NOT, WRITE TO EDF R&D CODE_ASTER, +# 1 AVENUE DU GENERAL DE GAULLE, 92141 CLAMART CEDEX, FRANCE. +# +# +# ====================================================================== from Noyau import N_MCSIMP from Validation import V_MCSIMP from Ihm import I_MCSIMP diff --git a/Accas/A_NUPLET.py b/Accas/A_NUPLET.py index 1d19c2c0..6c1c5f4c 100644 --- a/Accas/A_NUPLET.py +++ b/Accas/A_NUPLET.py @@ -1,3 +1,22 @@ +# CONFIGURATION MANAGEMENT OF EDF VERSION +# ====================================================================== +# COPYRIGHT (C) 1991 - 2002 EDF R&D WWW.CODE-ASTER.ORG +# THIS PROGRAM IS FREE SOFTWARE; YOU CAN REDISTRIBUTE IT AND/OR MODIFY +# IT UNDER THE TERMS OF THE GNU GENERAL PUBLIC LICENSE AS PUBLISHED BY +# THE FREE SOFTWARE FOUNDATION; EITHER VERSION 2 OF THE LICENSE, OR +# (AT YOUR OPTION) ANY LATER VERSION. +# +# THIS PROGRAM IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL, BUT +# WITHOUT ANY WARRANTY; WITHOUT EVEN THE IMPLIED WARRANTY OF +# MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. SEE THE GNU +# GENERAL PUBLIC LICENSE FOR MORE DETAILS. +# +# YOU SHOULD HAVE RECEIVED A COPY OF THE GNU GENERAL PUBLIC LICENSE +# ALONG WITH THIS PROGRAM; IF NOT, WRITE TO EDF R&D CODE_ASTER, +# 1 AVENUE DU GENERAL DE GAULLE, 92141 CLAMART CEDEX, FRANCE. +# +# +# ====================================================================== from Extensions import nuplet import A_MCLIST diff --git a/Accas/A_OPER.py b/Accas/A_OPER.py index f7c6107b..50e3d340 100644 --- a/Accas/A_OPER.py +++ b/Accas/A_OPER.py @@ -1,3 +1,22 @@ +# CONFIGURATION MANAGEMENT OF EDF VERSION +# ====================================================================== +# COPYRIGHT (C) 1991 - 2002 EDF R&D WWW.CODE-ASTER.ORG +# THIS PROGRAM IS FREE SOFTWARE; YOU CAN REDISTRIBUTE IT AND/OR MODIFY +# IT UNDER THE TERMS OF THE GNU GENERAL PUBLIC LICENSE AS PUBLISHED BY +# THE FREE SOFTWARE FOUNDATION; EITHER VERSION 2 OF THE LICENSE, OR +# (AT YOUR OPTION) ANY LATER VERSION. +# +# THIS PROGRAM IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL, BUT +# WITHOUT ANY WARRANTY; WITHOUT EVEN THE IMPLIED WARRANTY OF +# MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. SEE THE GNU +# GENERAL PUBLIC LICENSE FOR MORE DETAILS. +# +# YOU SHOULD HAVE RECEIVED A COPY OF THE GNU GENERAL PUBLIC LICENSE +# ALONG WITH THIS PROGRAM; IF NOT, WRITE TO EDF R&D CODE_ASTER, +# 1 AVENUE DU GENERAL DE GAULLE, 92141 CLAMART CEDEX, FRANCE. +# +# +# ====================================================================== from Noyau import N_OPER from Ihm import I_ENTITE import A_ETAPE diff --git a/Accas/A_PRESENT_ABSENT.py b/Accas/A_PRESENT_ABSENT.py index ac2b0b30..fc77397c 100644 --- a/Accas/A_PRESENT_ABSENT.py +++ b/Accas/A_PRESENT_ABSENT.py @@ -1,3 +1,22 @@ +# CONFIGURATION MANAGEMENT OF EDF VERSION +# ====================================================================== +# COPYRIGHT (C) 1991 - 2002 EDF R&D WWW.CODE-ASTER.ORG +# THIS PROGRAM IS FREE SOFTWARE; YOU CAN REDISTRIBUTE IT AND/OR MODIFY +# IT UNDER THE TERMS OF THE GNU GENERAL PUBLIC LICENSE AS PUBLISHED BY +# THE FREE SOFTWARE FOUNDATION; EITHER VERSION 2 OF THE LICENSE, OR +# (AT YOUR OPTION) ANY LATER VERSION. +# +# THIS PROGRAM IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL, BUT +# WITHOUT ANY WARRANTY; WITHOUT EVEN THE IMPLIED WARRANTY OF +# MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. SEE THE GNU +# GENERAL PUBLIC LICENSE FOR MORE DETAILS. +# +# YOU SHOULD HAVE RECEIVED A COPY OF THE GNU GENERAL PUBLIC LICENSE +# ALONG WITH THIS PROGRAM; IF NOT, WRITE TO EDF R&D CODE_ASTER, +# 1 AVENUE DU GENERAL DE GAULLE, 92141 CLAMART CEDEX, FRANCE. +# +# +# ====================================================================== from Noyau import N_REGLE from Validation import V_PRESENT_ABSENT from Ihm import I_PRESENT_ABSENT diff --git a/Accas/A_PRESENT_PRESENT.py b/Accas/A_PRESENT_PRESENT.py index 96f52fd6..bb14edfb 100644 --- a/Accas/A_PRESENT_PRESENT.py +++ b/Accas/A_PRESENT_PRESENT.py @@ -1,3 +1,22 @@ +# CONFIGURATION MANAGEMENT OF EDF VERSION +# ====================================================================== +# COPYRIGHT (C) 1991 - 2002 EDF R&D WWW.CODE-ASTER.ORG +# THIS PROGRAM IS FREE SOFTWARE; YOU CAN REDISTRIBUTE IT AND/OR MODIFY +# IT UNDER THE TERMS OF THE GNU GENERAL PUBLIC LICENSE AS PUBLISHED BY +# THE FREE SOFTWARE FOUNDATION; EITHER VERSION 2 OF THE LICENSE, OR +# (AT YOUR OPTION) ANY LATER VERSION. +# +# THIS PROGRAM IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL, BUT +# WITHOUT ANY WARRANTY; WITHOUT EVEN THE IMPLIED WARRANTY OF +# MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. SEE THE GNU +# GENERAL PUBLIC LICENSE FOR MORE DETAILS. +# +# YOU SHOULD HAVE RECEIVED A COPY OF THE GNU GENERAL PUBLIC LICENSE +# ALONG WITH THIS PROGRAM; IF NOT, WRITE TO EDF R&D CODE_ASTER, +# 1 AVENUE DU GENERAL DE GAULLE, 92141 CLAMART CEDEX, FRANCE. +# +# +# ====================================================================== from Noyau import N_REGLE from Validation import V_PRESENT_PRESENT from Ihm import I_PRESENT_PRESENT diff --git a/Accas/A_PROC.py b/Accas/A_PROC.py index d0b56b07..2602a54d 100644 --- a/Accas/A_PROC.py +++ b/Accas/A_PROC.py @@ -1,3 +1,22 @@ +# CONFIGURATION MANAGEMENT OF EDF VERSION +# ====================================================================== +# COPYRIGHT (C) 1991 - 2002 EDF R&D WWW.CODE-ASTER.ORG +# THIS PROGRAM IS FREE SOFTWARE; YOU CAN REDISTRIBUTE IT AND/OR MODIFY +# IT UNDER THE TERMS OF THE GNU GENERAL PUBLIC LICENSE AS PUBLISHED BY +# THE FREE SOFTWARE FOUNDATION; EITHER VERSION 2 OF THE LICENSE, OR +# (AT YOUR OPTION) ANY LATER VERSION. +# +# THIS PROGRAM IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL, BUT +# WITHOUT ANY WARRANTY; WITHOUT EVEN THE IMPLIED WARRANTY OF +# MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. SEE THE GNU +# GENERAL PUBLIC LICENSE FOR MORE DETAILS. +# +# YOU SHOULD HAVE RECEIVED A COPY OF THE GNU GENERAL PUBLIC LICENSE +# ALONG WITH THIS PROGRAM; IF NOT, WRITE TO EDF R&D CODE_ASTER, +# 1 AVENUE DU GENERAL DE GAULLE, 92141 CLAMART CEDEX, FRANCE. +# +# +# ====================================================================== from Noyau import N_PROC from Ihm import I_ENTITE import A_PROC_ETAPE diff --git a/Accas/A_PROC_ETAPE.py b/Accas/A_PROC_ETAPE.py index 9d7c0f89..26836709 100644 --- a/Accas/A_PROC_ETAPE.py +++ b/Accas/A_PROC_ETAPE.py @@ -1,3 +1,22 @@ +# CONFIGURATION MANAGEMENT OF EDF VERSION +# ====================================================================== +# COPYRIGHT (C) 1991 - 2002 EDF R&D WWW.CODE-ASTER.ORG +# THIS PROGRAM IS FREE SOFTWARE; YOU CAN REDISTRIBUTE IT AND/OR MODIFY +# IT UNDER THE TERMS OF THE GNU GENERAL PUBLIC LICENSE AS PUBLISHED BY +# THE FREE SOFTWARE FOUNDATION; EITHER VERSION 2 OF THE LICENSE, OR +# (AT YOUR OPTION) ANY LATER VERSION. +# +# THIS PROGRAM IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL, BUT +# WITHOUT ANY WARRANTY; WITHOUT EVEN THE IMPLIED WARRANTY OF +# MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. SEE THE GNU +# GENERAL PUBLIC LICENSE FOR MORE DETAILS. +# +# YOU SHOULD HAVE RECEIVED A COPY OF THE GNU GENERAL PUBLIC LICENSE +# ALONG WITH THIS PROGRAM; IF NOT, WRITE TO EDF R&D CODE_ASTER, +# 1 AVENUE DU GENERAL DE GAULLE, 92141 CLAMART CEDEX, FRANCE. +# +# +# ====================================================================== from Noyau import N_PROC_ETAPE from Validation import V_PROC_ETAPE from Ihm import I_PROC_ETAPE diff --git a/Accas/A_SIMP.py b/Accas/A_SIMP.py index 3cafb492..898c23bc 100644 --- a/Accas/A_SIMP.py +++ b/Accas/A_SIMP.py @@ -1,3 +1,22 @@ +# CONFIGURATION MANAGEMENT OF EDF VERSION +# ====================================================================== +# COPYRIGHT (C) 1991 - 2002 EDF R&D WWW.CODE-ASTER.ORG +# THIS PROGRAM IS FREE SOFTWARE; YOU CAN REDISTRIBUTE IT AND/OR MODIFY +# IT UNDER THE TERMS OF THE GNU GENERAL PUBLIC LICENSE AS PUBLISHED BY +# THE FREE SOFTWARE FOUNDATION; EITHER VERSION 2 OF THE LICENSE, OR +# (AT YOUR OPTION) ANY LATER VERSION. +# +# THIS PROGRAM IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL, BUT +# WITHOUT ANY WARRANTY; WITHOUT EVEN THE IMPLIED WARRANTY OF +# MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. SEE THE GNU +# GENERAL PUBLIC LICENSE FOR MORE DETAILS. +# +# YOU SHOULD HAVE RECEIVED A COPY OF THE GNU GENERAL PUBLIC LICENSE +# ALONG WITH THIS PROGRAM; IF NOT, WRITE TO EDF R&D CODE_ASTER, +# 1 AVENUE DU GENERAL DE GAULLE, 92141 CLAMART CEDEX, FRANCE. +# +# +# ====================================================================== from Noyau import N_SIMP from Ihm import I_ENTITE import A_MCSIMP diff --git a/Accas/A_UN_PARMI.py b/Accas/A_UN_PARMI.py index ee7a5058..55b281d3 100644 --- a/Accas/A_UN_PARMI.py +++ b/Accas/A_UN_PARMI.py @@ -1,3 +1,22 @@ +# CONFIGURATION MANAGEMENT OF EDF VERSION +# ====================================================================== +# COPYRIGHT (C) 1991 - 2002 EDF R&D WWW.CODE-ASTER.ORG +# THIS PROGRAM IS FREE SOFTWARE; YOU CAN REDISTRIBUTE IT AND/OR MODIFY +# IT UNDER THE TERMS OF THE GNU GENERAL PUBLIC LICENSE AS PUBLISHED BY +# THE FREE SOFTWARE FOUNDATION; EITHER VERSION 2 OF THE LICENSE, OR +# (AT YOUR OPTION) ANY LATER VERSION. +# +# THIS PROGRAM IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL, BUT +# WITHOUT ANY WARRANTY; WITHOUT EVEN THE IMPLIED WARRANTY OF +# MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. SEE THE GNU +# GENERAL PUBLIC LICENSE FOR MORE DETAILS. +# +# YOU SHOULD HAVE RECEIVED A COPY OF THE GNU GENERAL PUBLIC LICENSE +# ALONG WITH THIS PROGRAM; IF NOT, WRITE TO EDF R&D CODE_ASTER, +# 1 AVENUE DU GENERAL DE GAULLE, 92141 CLAMART CEDEX, FRANCE. +# +# +# ====================================================================== from Noyau import N_REGLE from Validation import V_UN_PARMI from Ihm import I_UN_PARMI diff --git a/Accas/__init__.py b/Accas/__init__.py index b61776b3..f3930531 100644 --- a/Accas/__init__.py +++ b/Accas/__init__.py @@ -1,3 +1,22 @@ +# CONFIGURATION MANAGEMENT OF EDF VERSION +# ====================================================================== +# COPYRIGHT (C) 1991 - 2002 EDF R&D WWW.CODE-ASTER.ORG +# THIS PROGRAM IS FREE SOFTWARE; YOU CAN REDISTRIBUTE IT AND/OR MODIFY +# IT UNDER THE TERMS OF THE GNU GENERAL PUBLIC LICENSE AS PUBLISHED BY +# THE FREE SOFTWARE FOUNDATION; EITHER VERSION 2 OF THE LICENSE, OR +# (AT YOUR OPTION) ANY LATER VERSION. +# +# THIS PROGRAM IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL, BUT +# WITHOUT ANY WARRANTY; WITHOUT EVEN THE IMPLIED WARRANTY OF +# MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. SEE THE GNU +# GENERAL PUBLIC LICENSE FOR MORE DETAILS. +# +# YOU SHOULD HAVE RECEIVED A COPY OF THE GNU GENERAL PUBLIC LICENSE +# ALONG WITH THIS PROGRAM; IF NOT, WRITE TO EDF R&D CODE_ASTER, +# 1 AVENUE DU GENERAL DE GAULLE, 92141 CLAMART CEDEX, FRANCE. +# +# +# ====================================================================== """ Ce package contient les classes qui seront effectivement utilisées dans les applications. C'est dans ce package que sont réalisées les combinaisons de classes de base @@ -39,11 +58,11 @@ from A_EXCLUS import EXCLUS from A_ENSEMBLE import ENSEMBLE from A_A_CLASSER import A_CLASSER -from Noyau.N_ASSD import ASSD,assd -from Noyau.N_GEOM import GEOM,geom -from Noyau.N_FONCTION import FONCTION -from Noyau.N_FONCTION import fonction -from Noyau.N_CO import CO +from A_ASSD import ASSD,assd +from A_ASSD import GEOM,geom +from A_ASSD import FONCTION, fonction +from A_ASSD import CO + from Noyau.N__F import _F from Noyau.N_Exception import AsException diff --git a/Aster/INSTALL b/Aster/INSTALL new file mode 100644 index 00000000..e3a5d8fe --- /dev/null +++ b/Aster/INSTALL @@ -0,0 +1,40 @@ + + +1- Installation standard + +Pour installer EFICAS a partir de la distribution : .tgz +faire : + tar xzvf .tgz + +ce qui a pour effet de créer un répertoire de nom . + +Pour modifier l'emplacement de la doc, le chemin d'accès à Acrobat Reader, +les catalogues, il faut modifier le fichier editeur.ini dans le répertoire Aster. + + +ATTENTION : +Si Eficas est installé dans un répertoire particulier d'administration +dans lequel les utilisateurs n'ont pas le droit d'écriture, il faut que +l'administrateur lance Eficas pour générer +les fichiers et catalogues compilés .pyc et _pickled.py + + + +2- Utilisation d'Eficas + +Pour utiliser Eficas, aller dans le répertoire Aster et faire : + python eficas_aster.py + + + +3- Installation avec un noyau pré-installé + +Aller dans le répertoire Aster du répertoire Eficas +et modifier le fichier prefs.py comme suit : +Mettre dans la variable CODE_PATH le chemin absolu vers +le répertoire contenant les deux répertoires Noyau et Validation que vous voulez +utiliser à la place de ceux fournis dans la livraison d'Eficas + +Pour changer les catalogues, modifier le fichier editeur.ini dans le répertoire Aster + + diff --git a/Aster/LICENSE.TERMS b/Aster/LICENSE.TERMS new file mode 100644 index 00000000..8c88a1e5 --- /dev/null +++ b/Aster/LICENSE.TERMS @@ -0,0 +1,21 @@ + ====================================================================== + THIS PROGRAM IS FREE SOFTWARE. YOU CAN REDISTRIBUTE IT AND/OR MODIFY + IT UNDER THE TERMS OF THE GNU GENERAL PUBLIC LICENSE AS PUBLISHED BY + THE FREE SOFTWARE FOUNDATION, EITHER VERSION 2 OF THE LICENSE, AND + ANY LATER VERSION. + THIS PROGRAM IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL, BUT + WITHOUT ANY WARRANTY, WITHOUT EVEN THE IMPLIED WARRANTY OF + MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. + SEE THE GNU GENERAL PUBLIC LICENSE FOR MORE DETAILS. + ====================================================================== + TRADUCTION EDF ( POUR INFORMATION ) + ====================================================================== + CE PROGRAMME EST UN LOGICIEL LIBRE. VOUS POUVEZ LE DIFFUSER ET/OU LE + MODIFIER SELON LES DISPOSITIONS DE LA LICENCE GRAND PUBLIC GNU (GPL) + TELLE QU'ELLE EST PUBLIEE PAR LA FREE SOFTWARE FOUNDATION, VERSION 2 + DE LA LICENCE ET TOUTE VERSION ULTERIEURE. + CE PROGRAMME EST DIFFUSE AVEC L'ESPOIR QU'IL SERA UTILE, MAIS SANS + GARANTIE, SANS MEME LA GARANTIE IMPLICITE DE QUALIFICATION DE MISE SUR + LE MARCHE OU D'ADAPTATION A UNE UTILISATION PARTICULIERE. + VOIR POUR DE PLUS AMPLES DETAILS LA LICENCE GRAND PUBLIC GNU (GPL) + ====================================================================== diff --git a/Aster/README b/Aster/README new file mode 100644 index 00000000..0597ecbb --- /dev/null +++ b/Aster/README @@ -0,0 +1,2 @@ + +Pour installer EFICAS voir dans le fichier INSTALL diff --git a/Aster/alphasdist.py b/Aster/alphasdist.py new file mode 100644 index 00000000..8095a873 --- /dev/null +++ b/Aster/alphasdist.py @@ -0,0 +1,120 @@ +""" + Ce module sert à construire les distributions de versions alpha d'EFICAS en fonction + du tag CVS courant (Vx_yaz). Une version alpha est une version dont toutes les fonctionnalités + ne sont pas implémentées. On utilise pour ces versions, les packages Noyau Validation Cata et Macro + locaux. + Les distributions sont : + - un tar.gz pour UNIX ne contenant pas mxTextTools + - un zip pour Windows contenant mx TextTools préinstallé + L'utilisation de ce module est la suivante : + 1- Se mettre dans un répertoire de travail + 2- Configurer son environnement pour utiliser le référentiel CVS EFICAS + 3- Exporter les sources d'Eficas par la commande : + cvs export -r TAG -d Eficas_export EficasV1_2 + ou TAG est le tag CVS de la version que l'on veut distribuer (par exemple V1_3a1) + 4- Aller dans le répertoire Eficas_export + 4- Executer le script alphasdist.py + python alphasdist.py + Ce qui a pour effet de creer un repertoire dist contenant les 2 distributions + et de les copier dans le répertoire indiqué par dir_download s'il est accessible + +""" +import os,shutil,glob,sys +import types + +version="$Name: $"[7:-2] or 'Test1_3' +# ==========Path du noyau local ==================== +path_Noyau=".." +# ============================================================ +nom_distrib="Eficas"+version+"AsterSTA6" +path_distrib=os.path.join("dist",nom_distrib) +path_TextTools="/home/eficas/pkg/mxTools/egenix2.0.2pourWindows/mx/TextTools" +dir_download= "/home/eficas/WWW/telechargement/eficas" + +def main(): + if os.path.isdir('dist'):shutil.rmtree('dist') + + copyfiles('.',path_distrib,['LICENSE.TERMS','INSTALL']) + + copyfiles('../Editeur',os.path.join(path_distrib,'Editeur'),['*.py','faqs.txt']) + copyfiles('../Ihm',os.path.join(path_distrib,'Ihm'),['*.py']) + copyfiles('../Extensions',os.path.join(path_distrib,'Extensions'),['*.py']) + copyfiles('../Accas',os.path.join(path_distrib,'Accas'),['*.py']) + copyfiles('../Macro',os.path.join(path_distrib,'Macro'),['*.py']) + copyfiles('../AIDE',os.path.join(path_distrib,'AIDE'),['*.py']) + copyfiles('../AIDE/fichiers',os.path.join(path_distrib,'AIDE/fichiers'),['*']) + copyfiles('../Aster',os.path.join(path_distrib,'Aster'),['prefs.py', + 'editeur.ini', + 'eficas_aster.py', + ]) + copyfiles('../convert',os.path.join(path_distrib,'convert'),['*.py']) + copyfiles('../convert/Parserv5',os.path.join(path_distrib,'convert','Parserv5'),['*.py']) + + copyfiles('../generator',os.path.join(path_distrib,'generator'),['*.py']) + + copyfiles('../Editeur/icons',os.path.join(path_distrib,'Editeur','icons'),['*.gif']) + + copyfiles(os.path.join(path_Noyau,'Noyau'),os.path.join(path_distrib,'Noyau'),['*.py']) + copyfiles(os.path.join(path_Noyau,'Validation'),os.path.join(path_distrib,'Validation'),['*.py']) + copyfiles('../Aster/Cata',os.path.join(path_distrib,'Aster','Cata'),['*.py', + ]) + + copyfiles('../Tools',os.path.join(path_distrib,'Tools'),['*.py']) + copyfiles('../Tools/foztools',os.path.join(path_distrib,'Tools','foztools'),['*.py']) + + tarball= maketarball('dist',nom_distrib,nom_distrib) + try: + shutil.copy(tarball,dir_download) + except: + print "Repertoire de download inconnu : ",dir_download + + try: + shutil.copytree(path_TextTools,os.path.join(path_distrib,'Tools','TextTools')) + except: + print "Impossible de recuperer mxTextTools : ",dir_download + sys.exit(1) + + zipfile= makezipfile('dist',nom_distrib,nom_distrib) + try: + shutil.copy(zipfile,dir_download) + except: + print "Repertoire de download inconnu : ",dir_download + +def make_dir(dir_cible): + if type(dir_cible) is not types.StringType: + raise "make_dir : dir_cible doit etre une string (%s)" % `dir_cible` + head,tail=os.path.split(dir_cible) + tails=[tail] + while head and tail and not os.path.isdir(head): + head,tail=os.path.split(head) + tails.insert(0, tail) + + for d in tails: + head = os.path.join(head, d) + if not os.path.isdir(head):os.mkdir(head) + + +def copyfiles(dir_origin,dir_cible,listfiles): + if not os.path.isdir(dir_cible):make_dir(dir_cible) + for glob_files in listfiles: + for file in glob.glob(os.path.join(dir_origin,glob_files)): + shutil.copy(file,dir_cible) + +def maketarball(dir_trav,dir_cible,nom_tar): + prev=os.getcwd() + print prev + os.chdir(dir_trav) + os.system("tar -cf "+nom_tar+".tar "+dir_cible) + os.system("gzip -f9 "+nom_tar+".tar ") + os.chdir(prev) + return os.path.join(dir_trav,nom_tar+".tar.gz") + +def makezipfile(dir_trav,dir_cible,nom_tar): + prev=os.getcwd() + os.chdir(dir_trav) + os.system("zip -rq "+nom_tar+".zip "+dir_cible) + os.chdir(prev) + return os.path.join(dir_trav,nom_tar+".zip") + +main() + diff --git a/Aster/editeur.ini b/Aster/editeur.ini index e86dc069..d455d048 100644 --- a/Aster/editeur.ini +++ b/Aster/editeur.ini @@ -1,3 +1,23 @@ +# CONFIGURATION MANAGEMENT OF EDF VERSION +# ====================================================================== +# COPYRIGHT (C) 1991 - 2002 EDF R&D WWW.CODE-ASTER.ORG +# THIS PROGRAM IS FREE SOFTWARE; YOU CAN REDISTRIBUTE IT AND/OR MODIFY +# IT UNDER THE TERMS OF THE GNU GENERAL PUBLIC LICENSE AS PUBLISHED BY +# THE FREE SOFTWARE FOUNDATION; EITHER VERSION 2 OF THE LICENSE, OR +# (AT YOUR OPTION) ANY LATER VERSION. +# +# THIS PROGRAM IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL, BUT +# WITHOUT ANY WARRANTY; WITHOUT EVEN THE IMPLIED WARRANTY OF +# MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. SEE THE GNU +# GENERAL PUBLIC LICENSE FOR MORE DETAILS. +# +# YOU SHOULD HAVE RECEIVED A COPY OF THE GNU GENERAL PUBLIC LICENSE +# ALONG WITH THIS PROGRAM; IF NOT, WRITE TO EDF R&D CODE_ASTER, +# 1 AVENUE DU GENERAL DE GAULLE, 92141 CLAMART CEDEX, FRANCE. +# +# +# ====================================================================== + import os import prefs @@ -12,11 +32,13 @@ isdeveloppeur = "NON" path_cata_dev = "/tmp/cata" # Répertoire temporaire rep_travail = "/tmp" +# Répertoire initial +initialdir=os.curdir # Choix des catalogues rep_mat="bidon" -catalogues = (('ASTER','v5',os.path.join(rep_cata,'cata_STA5.py'),'asterv5'), +catalogues = (#('ASTER','v5',os.path.join(rep_cata,'cata_STA5.py'),'asterv5'), ('ASTER','v6',os.path.join(rep_cata,'cata_STA6.py'),'python','defaut'), ) diff --git a/Aster/eficas_aster.py b/Aster/eficas_aster.py index 2debb64d..ca862a94 100755 --- a/Aster/eficas_aster.py +++ b/Aster/eficas_aster.py @@ -1,4 +1,24 @@ #!/usr/bin/env python +# CONFIGURATION MANAGEMENT OF EDF VERSION +# ====================================================================== +# COPYRIGHT (C) 1991 - 2002 EDF R&D WWW.CODE-ASTER.ORG +# THIS PROGRAM IS FREE SOFTWARE; YOU CAN REDISTRIBUTE IT AND/OR MODIFY +# IT UNDER THE TERMS OF THE GNU GENERAL PUBLIC LICENSE AS PUBLISHED BY +# THE FREE SOFTWARE FOUNDATION; EITHER VERSION 2 OF THE LICENSE, OR +# (AT YOUR OPTION) ANY LATER VERSION. +# +# THIS PROGRAM IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL, BUT +# WITHOUT ANY WARRANTY; WITHOUT EVEN THE IMPLIED WARRANTY OF +# MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. SEE THE GNU +# GENERAL PUBLIC LICENSE FOR MORE DETAILS. +# +# YOU SHOULD HAVE RECEIVED A COPY OF THE GNU GENERAL PUBLIC LICENSE +# ALONG WITH THIS PROGRAM; IF NOT, WRITE TO EDF R&D CODE_ASTER, +# 1 AVENUE DU GENERAL DE GAULLE, 92141 CLAMART CEDEX, FRANCE. +# +# +# ====================================================================== + """ Ce module sert à lancer EFICAS configuré pour Code_Aster """ diff --git a/Aster/prefs.py b/Aster/prefs.py index f3d82ae8..7b70f11c 100644 --- a/Aster/prefs.py +++ b/Aster/prefs.py @@ -1,3 +1,23 @@ +# CONFIGURATION MANAGEMENT OF EDF VERSION +# ====================================================================== +# COPYRIGHT (C) 1991 - 2002 EDF R&D WWW.CODE-ASTER.ORG +# THIS PROGRAM IS FREE SOFTWARE; YOU CAN REDISTRIBUTE IT AND/OR MODIFY +# IT UNDER THE TERMS OF THE GNU GENERAL PUBLIC LICENSE AS PUBLISHED BY +# THE FREE SOFTWARE FOUNDATION; EITHER VERSION 2 OF THE LICENSE, OR +# (AT YOUR OPTION) ANY LATER VERSION. +# +# THIS PROGRAM IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL, BUT +# WITHOUT ANY WARRANTY; WITHOUT EVEN THE IMPLIED WARRANTY OF +# MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. SEE THE GNU +# GENERAL PUBLIC LICENSE FOR MORE DETAILS. +# +# YOU SHOULD HAVE RECEIVED A COPY OF THE GNU GENERAL PUBLIC LICENSE +# ALONG WITH THIS PROGRAM; IF NOT, WRITE TO EDF R&D CODE_ASTER, +# 1 AVENUE DU GENERAL DE GAULLE, 92141 CLAMART CEDEX, FRANCE. +# +# +# ====================================================================== + import os # REPINI sert à localiser le fichier editeur.ini @@ -19,3 +39,48 @@ CODE_PATH = None # Par défaut on utilise le répertoire icons dans Editeur ICONDIR=os.path.join(INSTALLDIR,'Editeur','icons') +# lang indique la langue utilisée pour les chaines d'aide : fr ou an +lang='fr' + +labels= ('Fichier','Edition','Jeu de commandes', + # 'Catalogue','Browsers','Options' + 'Aide', + ) + +appli_composants=['readercata','bureau', + # 'browser','options' + ] + +menu_defs={ 'bureau': [ + ('Fichier',[ + ('Nouveau','newJDC'), + ('Ouvrir','openJDC'), + ('Enregistrer','saveJDC'), + ('Enregistrer sous','saveasJDC'), + None, + ('Fermer','closeJDC'), + ('Quitter','exitEFICAS'), + ] + ), + ('Edition',[ + ('Copier','copy'), + ('Couper','cut'), + ('Coller','paste'), + ] + ), + ('Jeu de commandes',[ + ('Rapport de validation','visuCRJDC'), + # ('Fichier à plat','visu_a_plat'), + ('Fichier format v6','visuJDC_py'), + ('Fichier source','visu_txt_brut_JDC'), + ('Paramètres Eficas','affichage_fichier_ini'), + ('Mots-clés inconnus','mc_inconnus'), + ] + ), + ('Aide',[ + ('Aide EFICAS','aideEFICAS'), + ] + ), + ] + } + diff --git a/Aster/sdist.py b/Aster/sdist.py new file mode 100644 index 00000000..f95b682e --- /dev/null +++ b/Aster/sdist.py @@ -0,0 +1,118 @@ +""" + Ce module sert à construire les distributions d'EFICAS en fonction + du tag CVS courant + Les distributions sont : + - un tar.gz pour UNIX ne contenant pas mxTextTools + - un zip pour Windows contenant mx TextTools préinstallé + L'utilisation de ce module est la suivante : + 1- Se mettre dans un répertoire de travail + 2- Configurer son environnement pour utiliser le référentiel CVS EFICAS + 3- Exporter les sources d'EficasV1 par la commande : + cvs export -r TAG -d Eficas_export EficasV1 + ou TAG est le tag CVS de la version que l'on veut distribuer (par exemple V1_1p1) + 4- Copier le répertoire fourni par Aster (ACCAS6.2.0) au meme niveau que Eficas_export + 5- Aller dans le répertoire Eficas_export + 6- Executer le script sdist.py + python sdist.py + Ce qui a pour effet de creer un repertoire dist contenant les 2 distributions + et de les copier dans le répertoire indiqué par dir_download s'il est accessible + +""" +import os,shutil,glob,sys +import types + +version="$Name: $"[7:-2] or 'Test1_2' +# ==========Path du noyau fourni par Aster==================== +path_Noyau="../../Accas6.3.0" +# ============================================================ +nom_distrib="Eficas"+version+"AsterSTA6" +path_distrib=os.path.join("dist",nom_distrib) +path_TextTools="/home/eficas/pkg/mxTools/egenix2.0.2pourWindows/mx/TextTools" +dir_download= "/home/eficas/WWW/telechargement/eficas" + +def main(): + if os.path.isdir('dist'):shutil.rmtree('dist') + + copyfiles('.',path_distrib,['LICENSE.TERMS','INSTALL']) + + copyfiles('../Editeur',os.path.join(path_distrib,'Editeur'),['*.py','faqs.txt']) + copyfiles('../Ihm',os.path.join(path_distrib,'Ihm'),['*.py']) + copyfiles('../Extensions',os.path.join(path_distrib,'Extensions'),['*.py']) + copyfiles('../Accas',os.path.join(path_distrib,'Accas'),['*.py']) + copyfiles('../AIDE',os.path.join(path_distrib,'AIDE'),['*.py']) + copyfiles('../AIDE/fichiers',os.path.join(path_distrib,'AIDE/fichiers'),['*']) + copyfiles('../Aster',os.path.join(path_distrib,'Aster'),['prefs.py', + 'editeur.ini', + 'eficas_aster.py', + ]) + copyfiles('../convert',os.path.join(path_distrib,'convert'),['*.py']) + copyfiles('../convert/Parserv5',os.path.join(path_distrib,'convert','Parserv5'),['*.py']) + + copyfiles('../generator',os.path.join(path_distrib,'generator'),['*.py']) + + copyfiles('../Editeur/icons',os.path.join(path_distrib,'Editeur','icons'),['*.gif']) + + copyfiles(os.path.join(path_Noyau,'Noyau'),os.path.join(path_distrib,'Noyau'),['*.py']) + copyfiles(os.path.join(path_Noyau,'Validation'),os.path.join(path_distrib,'Validation'),['*.py']) + copyfiles(os.path.join(path_Noyau,'Cata'),os.path.join(path_distrib,'Aster','Cata'),['*.py', + ]) + + copyfiles('../Tools',os.path.join(path_distrib,'Tools'),['*.py']) + copyfiles('../Tools/foztools',os.path.join(path_distrib,'Tools','foztools'),['*.py']) + + tarball= maketarball('dist',nom_distrib,nom_distrib) + try: + shutil.copy(tarball,dir_download) + except: + print "Repertoire de download inconnu : ",dir_download + + try: + shutil.copytree(path_TextTools,os.path.join(path_distrib,'Tools','TextTools')) + except: + print "Impossible de recuperer mxTextTools : ",dir_download + sys.exit(1) + + zipfile= makezipfile('dist',nom_distrib,nom_distrib) + try: + shutil.copy(zipfile,dir_download) + except: + print "Repertoire de download inconnu : ",dir_download + +def make_dir(dir_cible): + if type(dir_cible) is not types.StringType: + raise "make_dir : dir_cible doit etre une string (%s)" % `dir_cible` + head,tail=os.path.split(dir_cible) + tails=[tail] + while head and tail and not os.path.isdir(head): + head,tail=os.path.split(head) + tails.insert(0, tail) + + for d in tails: + head = os.path.join(head, d) + if not os.path.isdir(head):os.mkdir(head) + + +def copyfiles(dir_origin,dir_cible,listfiles): + if not os.path.isdir(dir_cible):make_dir(dir_cible) + for glob_files in listfiles: + for file in glob.glob(os.path.join(dir_origin,glob_files)): + shutil.copy(file,dir_cible) + +def maketarball(dir_trav,dir_cible,nom_tar): + prev=os.getcwd() + print prev + os.chdir(dir_trav) + os.system("tar -cf "+nom_tar+".tar "+dir_cible) + os.system("gzip -f9 "+nom_tar+".tar ") + os.chdir(prev) + return os.path.join(dir_trav,nom_tar+".tar.gz") + +def makezipfile(dir_trav,dir_cible,nom_tar): + prev=os.getcwd() + os.chdir(dir_trav) + os.system("zip -rq "+nom_tar+".zip "+dir_cible) + os.chdir(prev) + return os.path.join(dir_trav,nom_tar+".zip") + +main() + diff --git a/Editeur/Interp.py b/Editeur/Interp.py index 5b320e19..752a44c7 100644 --- a/Editeur/Interp.py +++ b/Editeur/Interp.py @@ -1,9 +1,21 @@ -#@ MODIF Interp Editeur DATE 02/07/2001 AUTEUR D6BHHJP J.P.LEFEBVRE # CONFIGURATION MANAGEMENT OF EDF VERSION # ====================================================================== -# COPYRIGHT (C) 1991 - 2001 EDF R&D WWW.CODE-ASTER.ORG -# SEE THE FILE "LICENSE.TERMS" FOR INFORMATION ON USAGE AND -# REDISTRIBUTION OF THIS FILE. +# COPYRIGHT (C) 1991 - 2002 EDF R&D WWW.CODE-ASTER.ORG +# THIS PROGRAM IS FREE SOFTWARE; YOU CAN REDISTRIBUTE IT AND/OR MODIFY +# IT UNDER THE TERMS OF THE GNU GENERAL PUBLIC LICENSE AS PUBLISHED BY +# THE FREE SOFTWARE FOUNDATION; EITHER VERSION 2 OF THE LICENSE, OR +# (AT YOUR OPTION) ANY LATER VERSION. +# +# THIS PROGRAM IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL, BUT +# WITHOUT ANY WARRANTY; WITHOUT EVEN THE IMPLIED WARRANTY OF +# MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. SEE THE GNU +# GENERAL PUBLIC LICENSE FOR MORE DETAILS. +# +# YOU SHOULD HAVE RECEIVED A COPY OF THE GNU GENERAL PUBLIC LICENSE +# ALONG WITH THIS PROGRAM; IF NOT, WRITE TO EDF R&D CODE_ASTER, +# 1 AVENUE DU GENERAL DE GAULLE, 92141 CLAMART CEDEX, FRANCE. +# +# # ====================================================================== import Tkinter,ScrolledText diff --git a/Editeur/Objecttreeitem.py b/Editeur/Objecttreeitem.py index 7e9ff7db..2ee01c7a 100644 --- a/Editeur/Objecttreeitem.py +++ b/Editeur/Objecttreeitem.py @@ -1,3 +1,22 @@ +# CONFIGURATION MANAGEMENT OF EDF VERSION +# ====================================================================== +# COPYRIGHT (C) 1991 - 2002 EDF R&D WWW.CODE-ASTER.ORG +# THIS PROGRAM IS FREE SOFTWARE; YOU CAN REDISTRIBUTE IT AND/OR MODIFY +# IT UNDER THE TERMS OF THE GNU GENERAL PUBLIC LICENSE AS PUBLISHED BY +# THE FREE SOFTWARE FOUNDATION; EITHER VERSION 2 OF THE LICENSE, OR +# (AT YOUR OPTION) ANY LATER VERSION. +# +# THIS PROGRAM IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL, BUT +# WITHOUT ANY WARRANTY; WITHOUT EVEN THE IMPLIED WARRANTY OF +# MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. SEE THE GNU +# GENERAL PUBLIC LICENSE FOR MORE DETAILS. +# +# YOU SHOULD HAVE RECEIVED A COPY OF THE GNU GENERAL PUBLIC LICENSE +# ALONG WITH THIS PROGRAM; IF NOT, WRITE TO EDF R&D CODE_ASTER, +# 1 AVENUE DU GENERAL DE GAULLE, 92141 CLAMART CEDEX, FRANCE. +# +# +# ====================================================================== """ """ # import généraux @@ -294,10 +313,7 @@ class ObjectTreeItem(TreeItem,Delegate): def get_fr(self): """ Retourne le fr de l'objet pointé par self """ - try: - return self.object.get_fr() - except: - return '' + return self.object.get_fr() def get_docu(self): """ Retourne la clé de doc de l'objet pointé par self """ @@ -393,6 +409,12 @@ class SequenceTreeItem(ObjectTreeItem): def GetText(self): return " " + def additem(self,obj,pos): + # XXX Passer par addentite de MCList ??? + self.object.insert(pos,obj) + item = self.make_objecttreeitem(self.appli, obj.nom + ":", obj) + return item + def suppitem(self,item): if not self.object.isMCList():return 1 try : diff --git a/Editeur/__init__.py b/Editeur/__init__.py index e69de29b..427090e6 100644 --- a/Editeur/__init__.py +++ b/Editeur/__init__.py @@ -0,0 +1,19 @@ +# CONFIGURATION MANAGEMENT OF EDF VERSION +# ====================================================================== +# COPYRIGHT (C) 1991 - 2002 EDF R&D WWW.CODE-ASTER.ORG +# THIS PROGRAM IS FREE SOFTWARE; YOU CAN REDISTRIBUTE IT AND/OR MODIFY +# IT UNDER THE TERMS OF THE GNU GENERAL PUBLIC LICENSE AS PUBLISHED BY +# THE FREE SOFTWARE FOUNDATION; EITHER VERSION 2 OF THE LICENSE, OR +# (AT YOUR OPTION) ANY LATER VERSION. +# +# THIS PROGRAM IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL, BUT +# WITHOUT ANY WARRANTY; WITHOUT EVEN THE IMPLIED WARRANTY OF +# MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. SEE THE GNU +# GENERAL PUBLIC LICENSE FOR MORE DETAILS. +# +# YOU SHOULD HAVE RECEIVED A COPY OF THE GNU GENERAL PUBLIC LICENSE +# ALONG WITH THIS PROGRAM; IF NOT, WRITE TO EDF R&D CODE_ASTER, +# 1 AVENUE DU GENERAL DE GAULLE, 92141 CLAMART CEDEX, FRANCE. +# +# +# ====================================================================== diff --git a/Editeur/analyse_catalogue.py b/Editeur/analyse_catalogue.py index b52a564f..c06aafb3 100644 --- a/Editeur/analyse_catalogue.py +++ b/Editeur/analyse_catalogue.py @@ -1,9 +1,21 @@ -#@ MODIF analyse_catalogue Accas DATE 02/07/2001 AUTEUR D6BHHJP J.P.LEFEBVRE # CONFIGURATION MANAGEMENT OF EDF VERSION # ====================================================================== -# COPYRIGHT (C) 1991 - 2001 EDF R&D WWW.CODE-ASTER.ORG -# SEE THE FILE "LICENSE.TERMS" FOR INFORMATION ON USAGE AND -# REDISTRIBUTION OF THIS FILE. +# COPYRIGHT (C) 1991 - 2002 EDF R&D WWW.CODE-ASTER.ORG +# THIS PROGRAM IS FREE SOFTWARE; YOU CAN REDISTRIBUTE IT AND/OR MODIFY +# IT UNDER THE TERMS OF THE GNU GENERAL PUBLIC LICENSE AS PUBLISHED BY +# THE FREE SOFTWARE FOUNDATION; EITHER VERSION 2 OF THE LICENSE, OR +# (AT YOUR OPTION) ANY LATER VERSION. +# +# THIS PROGRAM IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL, BUT +# WITHOUT ANY WARRANTY; WITHOUT EVEN THE IMPLIED WARRANTY OF +# MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. SEE THE GNU +# GENERAL PUBLIC LICENSE FOR MORE DETAILS. +# +# YOU SHOULD HAVE RECEIVED A COPY OF THE GNU GENERAL PUBLIC LICENSE +# ALONG WITH THIS PROGRAM; IF NOT, WRITE TO EDF R&D CODE_ASTER, +# 1 AVENUE DU GENERAL DE GAULLE, 92141 CLAMART CEDEX, FRANCE. +# +# # ====================================================================== from string import split,strip,lowercase,uppercase import re,string,cPickle,os @@ -11,8 +23,8 @@ import re,string,cPickle,os from Noyau.N_CR import CR # -__Id__="$Id: analyse_catalogue.py,v 1.13.18.3 2001/06/19 12:24:48 iliade Exp $" -__version__="$Name: FR_28_06_10_00 $" +__Id__="$Id: analyse_catalogue.py,v 1.1.1.1 2002/03/26 09:08:45 eficas Exp $" +__version__="$Name: $" # l_noms_commandes = ['OPER','PROC','MACRO','FORM'] l_noms_composes=['FACT','BLOC','NUPL','FORM'] diff --git a/Editeur/appli.py b/Editeur/appli.py index f8b031f7..1fce87ce 100644 --- a/Editeur/appli.py +++ b/Editeur/appli.py @@ -1,3 +1,22 @@ +# CONFIGURATION MANAGEMENT OF EDF VERSION +# ====================================================================== +# COPYRIGHT (C) 1991 - 2002 EDF R&D WWW.CODE-ASTER.ORG +# THIS PROGRAM IS FREE SOFTWARE; YOU CAN REDISTRIBUTE IT AND/OR MODIFY +# IT UNDER THE TERMS OF THE GNU GENERAL PUBLIC LICENSE AS PUBLISHED BY +# THE FREE SOFTWARE FOUNDATION; EITHER VERSION 2 OF THE LICENSE, OR +# (AT YOUR OPTION) ANY LATER VERSION. +# +# THIS PROGRAM IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL, BUT +# WITHOUT ANY WARRANTY; WITHOUT EVEN THE IMPLIED WARRANTY OF +# MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. SEE THE GNU +# GENERAL PUBLIC LICENSE FOR MORE DETAILS. +# +# YOU SHOULD HAVE RECEIVED A COPY OF THE GNU GENERAL PUBLIC LICENSE +# ALONG WITH THIS PROGRAM; IF NOT, WRITE TO EDF R&D CODE_ASTER, +# 1 AVENUE DU GENERAL DE GAULLE, 92141 CLAMART CEDEX, FRANCE. +# +# +# ====================================================================== """ Ce module contient la classe APPLI qui est la classe mère de l'application EFICAS. Elle prend en charge l'organisation générale @@ -13,6 +32,9 @@ import Tkinter import splash import prefs import fontes +import tooltip + +VERSION="EFICAS v1.3" class APPLI: def __init__ (self,master,code='ASTER',fichier=None) : @@ -21,7 +43,7 @@ class APPLI: self.top.protocol("WM_DELETE_WINDOW",self.exitEFICAS) self.top.minsize(900,500) self.top.geometry("900x500") - self.top.title('EFICAS v1.1 pour '+self.code) + self.top.title(VERSION + ' pour '+self.code) self.top.withdraw() self.initializeTk(master) Pmw.initialise(master) @@ -29,7 +51,7 @@ class APPLI: self.format_fichier = Tkinter.StringVar() self.message='' self.cree_composants_graphiques() - self.load_extensions() + self.load_appli_composants() self.affiche_FAQ() splash.fini_splash() @@ -69,18 +91,18 @@ class APPLI: import statusbar self.statusbar=statusbar.STATUSBAR(self.top) - def load_extensions(self): - splash._splash.configure(text = "Chargement des extensions") - for mname in self.extensions: - self.load_extension(mname) + def load_appli_composants(self): + splash._splash.configure(text = "Chargement des appli_composants") + for mname in self.appli_composants: + self.load_appli_composant(mname) - def load_extension(self,mname): + def load_appli_composant(self,mname): module=__import__(mname,globals(),locals()) factory=getattr(module,mname.upper()) - extension=factory(self,self.top) - setattr(self,mname,extension) - self.fill_menus(extension,extension.menu_defs) - self.toolbar.creer_boutons_extension(extension.button_defs,extension) + appli_composant=factory(self,self.top) + setattr(self,mname,appli_composant) + self.fill_menus(appli_composant,appli_composant.menu_defs) + self.toolbar.creer_boutons_appli_composant(appli_composant.button_defs,appli_composant) def affiche_FAQ(self): import faq @@ -110,6 +132,7 @@ class APPLI: root.option_add('*background', 'grey') root.option_add('*foreground', 'black') root.option_add('*EntryField.Entry.background', 'white') + root.option_add('*Entry*background', 'white') root.option_add('*Listbox*background', 'white') root.option_add('*Listbox*selectBackground', '#00008b') root.option_add('*Listbox*selectForeground', 'white') @@ -127,7 +150,7 @@ class APPLI: """ Retourne un texte d'informations sur la session courante d'EFICAS """ - texte = 'EFICAS v1.1\n\n' + 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 + 'Code utilisé : %s\n' %self.code @@ -150,14 +173,14 @@ class APPLI: x=event.x y=event.y widget=event.widget - self.aide = Tkinter.Label(widget ,text = aide, - bg="yellow",relief="ridge",anchor='w') - self.aide.place(in_=widget, - relx=0.5,rely=0.5,anchor='center') - print aide - return - - def fill_menus(self,extension,defs): + self.aide=tooltip.TOOLTIP(widget) + self.aide.xoffset = 10 + self.aide.yoffset = - widget.winfo_height()/2 + self.aide.setText(aide) + self.aide._showTip() + return + + def fill_menus(self,appli_composant,defs): menudict=self.menubar.menudict for mname,itemlist in defs: menu=menudict.get(mname) @@ -167,7 +190,7 @@ class APPLI: menu.add_separator() else: label,method=item - command=getattr(extension,method) + command=getattr(appli_composant,method) menu.add_command(label=label,command=command) diff --git a/Editeur/browser.py b/Editeur/browser.py index 0553c6e3..ba5b9eee 100644 --- a/Editeur/browser.py +++ b/Editeur/browser.py @@ -1,3 +1,22 @@ +# CONFIGURATION MANAGEMENT OF EDF VERSION +# ====================================================================== +# COPYRIGHT (C) 1991 - 2002 EDF R&D WWW.CODE-ASTER.ORG +# THIS PROGRAM IS FREE SOFTWARE; YOU CAN REDISTRIBUTE IT AND/OR MODIFY +# IT UNDER THE TERMS OF THE GNU GENERAL PUBLIC LICENSE AS PUBLISHED BY +# THE FREE SOFTWARE FOUNDATION; EITHER VERSION 2 OF THE LICENSE, OR +# (AT YOUR OPTION) ANY LATER VERSION. +# +# THIS PROGRAM IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL, BUT +# WITHOUT ANY WARRANTY; WITHOUT EVEN THE IMPLIED WARRANTY OF +# MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. SEE THE GNU +# GENERAL PUBLIC LICENSE FOR MORE DETAILS. +# +# YOU SHOULD HAVE RECEIVED A COPY OF THE GNU GENERAL PUBLIC LICENSE +# ALONG WITH THIS PROGRAM; IF NOT, WRITE TO EDF R&D CODE_ASTER, +# 1 AVENUE DU GENERAL DE GAULLE, 92141 CLAMART CEDEX, FRANCE. +# +# +# ====================================================================== """ """ # Modules Python diff --git a/Editeur/bureau.py b/Editeur/bureau.py index 41840842..341ec3f7 100644 --- a/Editeur/bureau.py +++ b/Editeur/bureau.py @@ -1,3 +1,22 @@ +# CONFIGURATION MANAGEMENT OF EDF VERSION +# ====================================================================== +# COPYRIGHT (C) 1991 - 2002 EDF R&D WWW.CODE-ASTER.ORG +# THIS PROGRAM IS FREE SOFTWARE; YOU CAN REDISTRIBUTE IT AND/OR MODIFY +# IT UNDER THE TERMS OF THE GNU GENERAL PUBLIC LICENSE AS PUBLISHED BY +# THE FREE SOFTWARE FOUNDATION; EITHER VERSION 2 OF THE LICENSE, OR +# (AT YOUR OPTION) ANY LATER VERSION. +# +# THIS PROGRAM IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL, BUT +# WITHOUT ANY WARRANTY; WITHOUT EVEN THE IMPLIED WARRANTY OF +# MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. SEE THE GNU +# GENERAL PUBLIC LICENSE FOR MORE DETAILS. +# +# YOU SHOULD HAVE RECEIVED A COPY OF THE GNU GENERAL PUBLIC LICENSE +# ALONG WITH THIS PROGRAM; IF NOT, WRITE TO EDF R&D CODE_ASTER, +# 1 AVENUE DU GENERAL DE GAULLE, 92141 CLAMART CEDEX, FRANCE. +# +# +# ====================================================================== """ Ce module contient la classe BUREAU qui gere les JDC ouverts """ @@ -10,10 +29,12 @@ from tkMessageBox import showinfo,askyesno,showerror # Modules Eficas import splash +import prefs import convert import generator +import AIDE from jdcdisplay import JDCDISPLAY -from utils import extension,stripPath,save_in_file +from utils import extension_fichier,stripPath,save_in_file from widgets import Fenetre,Ask_Format_Fichier from fenetre_mc_inconnus import fenetre_mc_inconnus @@ -58,6 +79,14 @@ class BUREAU: ('Delete24',"delete","Supprime l'objet courant",'jdc'), ('Help24',"view_doc","Documentation de l'objet courant",'jdc') ) + try: + menu_defs=prefs.menu_defs['bureau'] + except: + pass + try: + button_defs=prefs.button_defs['bureau'] + except: + pass def __init__(self,appli,parent): self.parent=parent @@ -72,7 +101,7 @@ class BUREAU: def cree_cataitem(self): """ - On récupère dans l'extension readercata les variables + On récupère dans l'appli_composant readercata les variables qui servent par la suite pour la création des JDC """ self.cataitem=self.appli.readercata.cataitem @@ -108,6 +137,7 @@ class BUREAU: cata_ord_dico=self.cata_ordonne_dico, appli=self.appli) self.JDCName=J.nom + self.fileName=None self.ShowJDC(J,self.JDCName) self.appli.toolbar.active_boutons() @@ -196,11 +226,12 @@ class BUREAU: Demande à l'utilisateur quel JDC existant il veut ouvrir """ if self.code == 'ASTER': - filetypes = ( ("format "+self.appli.format_fichier.get(), ".comm"),) + filetypes = ( ("format "+self.appli.format_fichier.get(), ".comm"),("Tous",'*')) else: filetypes = ( ("format "+self.appli.format_fichier.get(), ".py"),) if not hasattr(self,'initialdir'): - self.initialdir = self.appli.CONFIGURATION.rep_user + #self.initialdir = self.appli.CONFIGURATION.rep_user + self.initialdir = self.appli.CONFIGURATION.initialdir if not file : file = askopenfilename(title="Ouverture d'un fichier de commandes Aster", defaultextension=".comm", @@ -208,7 +239,7 @@ class BUREAU: initialdir = self.initialdir) if file != '': self.fileName = file - e=extension(file) + e=extension_fichier(file) self.JDCName=stripPath(file) self.initialdir = os.path.dirname(file) else : @@ -333,7 +364,8 @@ class BUREAU: sauvegarde = asksaveasfilename(title=titre, defaultextension=defext, filetypes = filtyp, - initialdir = self.appli.CONFIGURATION.rep_user) + initialdir = self.appli.CONFIGURATION.initialdir) + #initialdir = self.appli.CONFIGURATION.rep_user) if sauvegarde != '': if not save_in_file(sauvegarde,self.jdc_fini) : showinfo("Erreur","Problème à la sauvegarde du fichier "+`sauvegarde`) @@ -504,12 +536,16 @@ class BUREAU: """ if not hasattr(self,'JDC') : return titre = "fichier de commandes utilisateur" - texte = self.JDC.procedure - if texte == None: + #texte = self.JDC.procedure + #if texte == None: + if self.JDCDisplay_courant.fichier == None: self.appli.affiche_infos("Pas de fichier initial") - showerror("Impossible de visualiser le fichier initial","EFICAS ne peut visualiser le fichier \ - initial.\nIl s'agit d'un nouveau JDC") + showerror("Impossible de visualiser le fichier initial", + "EFICAS ne peut visualiser le fichier initial.\nIl s'agit d'un nouveau JDC") return + f=open(self.JDCDisplay_courant.fichier,'r') + texte=f.read() + f.close() self.visu_texte_JDC = Fenetre(self.appli,titre=titre,texte=texte) def affichage_fichier_ini(self): @@ -537,4 +573,8 @@ class BUREAU: l_mc = self.JDCDisplay_courant.jdc.get_liste_mc_inconnus() o = fenetre_mc_inconnus(l_mc) l = o.wait_new_list() + #print "mc_inconnus_new_list: ",l + #CCAR: Il n' y a pas de retour vers le JDC + def aideEFICAS(self): + AIDE.go(master=self.parent) diff --git a/Editeur/catabrowser.py b/Editeur/catabrowser.py index 24535cbc..3ecc286f 100644 --- a/Editeur/catabrowser.py +++ b/Editeur/catabrowser.py @@ -1,9 +1,21 @@ -#@ MODIF catabrowser Editeur DATE 02/07/2001 AUTEUR D6BHHJP J.P.LEFEBVRE # CONFIGURATION MANAGEMENT OF EDF VERSION # ====================================================================== -# COPYRIGHT (C) 1991 - 2001 EDF R&D WWW.CODE-ASTER.ORG -# SEE THE FILE "LICENSE.TERMS" FOR INFORMATION ON USAGE AND -# REDISTRIBUTION OF THIS FILE. +# COPYRIGHT (C) 1991 - 2002 EDF R&D WWW.CODE-ASTER.ORG +# THIS PROGRAM IS FREE SOFTWARE; YOU CAN REDISTRIBUTE IT AND/OR MODIFY +# IT UNDER THE TERMS OF THE GNU GENERAL PUBLIC LICENSE AS PUBLISHED BY +# THE FREE SOFTWARE FOUNDATION; EITHER VERSION 2 OF THE LICENSE, OR +# (AT YOUR OPTION) ANY LATER VERSION. +# +# THIS PROGRAM IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL, BUT +# WITHOUT ANY WARRANTY; WITHOUT EVEN THE IMPLIED WARRANTY OF +# MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. SEE THE GNU +# GENERAL PUBLIC LICENSE FOR MORE DETAILS. +# +# YOU SHOULD HAVE RECEIVED A COPY OF THE GNU GENERAL PUBLIC LICENSE +# ALONG WITH THIS PROGRAM; IF NOT, WRITE TO EDF R&D CODE_ASTER, +# 1 AVENUE DU GENERAL DE GAULLE, 92141 CLAMART CEDEX, FRANCE. +# +# # ====================================================================== # Modules Python import os @@ -23,8 +35,8 @@ from Accas import OPER,PROC,MACRO,FORM from Accas import FACT,BLOC,SIMP # -__version__="$Name: V1_1p1 $" -__Id__="$Id: catabrowser.py,v 1.1.1.1 2001/12/04 15:38:22 eficas Exp $" +__version__="$Name: $" +__Id__="$Id: catabrowser.py,v 1.1.1.1 2002/03/26 09:08:46 eficas Exp $" # class Tableau: incr = 10 diff --git a/Editeur/cataediteur.py b/Editeur/cataediteur.py index 5cdbe211..728be924 100644 --- a/Editeur/cataediteur.py +++ b/Editeur/cataediteur.py @@ -1,9 +1,21 @@ -#@ MODIF cataediteur Editeur DATE 02/07/2001 AUTEUR D6BHHJP J.P.LEFEBVRE # CONFIGURATION MANAGEMENT OF EDF VERSION # ====================================================================== -# COPYRIGHT (C) 1991 - 2001 EDF R&D WWW.CODE-ASTER.ORG -# SEE THE FILE "LICENSE.TERMS" FOR INFORMATION ON USAGE AND -# REDISTRIBUTION OF THIS FILE. +# COPYRIGHT (C) 1991 - 2002 EDF R&D WWW.CODE-ASTER.ORG +# THIS PROGRAM IS FREE SOFTWARE; YOU CAN REDISTRIBUTE IT AND/OR MODIFY +# IT UNDER THE TERMS OF THE GNU GENERAL PUBLIC LICENSE AS PUBLISHED BY +# THE FREE SOFTWARE FOUNDATION; EITHER VERSION 2 OF THE LICENSE, OR +# (AT YOUR OPTION) ANY LATER VERSION. +# +# THIS PROGRAM IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL, BUT +# WITHOUT ANY WARRANTY; WITHOUT EVEN THE IMPLIED WARRANTY OF +# MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. SEE THE GNU +# GENERAL PUBLIC LICENSE FOR MORE DETAILS. +# +# YOU SHOULD HAVE RECEIVED A COPY OF THE GNU GENERAL PUBLIC LICENSE +# ALONG WITH THIS PROGRAM; IF NOT, WRITE TO EDF R&D CODE_ASTER, +# 1 AVENUE DU GENERAL DE GAULLE, 92141 CLAMART CEDEX, FRANCE. +# +# # ====================================================================== # Modules Python import os @@ -26,8 +38,8 @@ from Accas import ASSD,GEOM import definition_cata # -__version__="$Name: V1_1p1 $" -__Id__="$Id: cataediteur.py,v 1.1.1.1 2001/12/04 15:38:22 eficas Exp $" +__version__="$Name: $" +__Id__="$Id: cataediteur.py,v 1.1.1.1 2002/03/26 09:08:46 eficas Exp $" # Fonte_Niveau = fontes.canvas_gras_italique diff --git a/Editeur/centerwindow.py b/Editeur/centerwindow.py index 95d9d33b..6b80e0d3 100644 --- a/Editeur/centerwindow.py +++ b/Editeur/centerwindow.py @@ -1,3 +1,22 @@ +# CONFIGURATION MANAGEMENT OF EDF VERSION +# ====================================================================== +# COPYRIGHT (C) 1991 - 2002 EDF R&D WWW.CODE-ASTER.ORG +# THIS PROGRAM IS FREE SOFTWARE; YOU CAN REDISTRIBUTE IT AND/OR MODIFY +# IT UNDER THE TERMS OF THE GNU GENERAL PUBLIC LICENSE AS PUBLISHED BY +# THE FREE SOFTWARE FOUNDATION; EITHER VERSION 2 OF THE LICENSE, OR +# (AT YOUR OPTION) ANY LATER VERSION. +# +# THIS PROGRAM IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL, BUT +# WITHOUT ANY WARRANTY; WITHOUT EVEN THE IMPLIED WARRANTY OF +# MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. SEE THE GNU +# GENERAL PUBLIC LICENSE FOR MORE DETAILS. +# +# YOU SHOULD HAVE RECEIVED A COPY OF THE GNU GENERAL PUBLIC LICENSE +# ALONG WITH THIS PROGRAM; IF NOT, WRITE TO EDF R&D CODE_ASTER, +# 1 AVENUE DU GENERAL DE GAULLE, 92141 CLAMART CEDEX, FRANCE. +# +# +# ====================================================================== """ Ce module contient la fonction utilitaire centerwindow qui sert à centrer une fenetre diff --git a/Editeur/compobloc.py b/Editeur/compobloc.py index 085c7d97..6f0682a0 100644 --- a/Editeur/compobloc.py +++ b/Editeur/compobloc.py @@ -1,9 +1,21 @@ -#@ MODIF compobloc Editeur DATE 02/07/2001 AUTEUR D6BHHJP J.P.LEFEBVRE # CONFIGURATION MANAGEMENT OF EDF VERSION # ====================================================================== -# COPYRIGHT (C) 1991 - 2001 EDF R&D WWW.CODE-ASTER.ORG -# SEE THE FILE "LICENSE.TERMS" FOR INFORMATION ON USAGE AND -# REDISTRIBUTION OF THIS FILE. +# COPYRIGHT (C) 1991 - 2002 EDF R&D WWW.CODE-ASTER.ORG +# THIS PROGRAM IS FREE SOFTWARE; YOU CAN REDISTRIBUTE IT AND/OR MODIFY +# IT UNDER THE TERMS OF THE GNU GENERAL PUBLIC LICENSE AS PUBLISHED BY +# THE FREE SOFTWARE FOUNDATION; EITHER VERSION 2 OF THE LICENSE, OR +# (AT YOUR OPTION) ANY LATER VERSION. +# +# THIS PROGRAM IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL, BUT +# WITHOUT ANY WARRANTY; WITHOUT EVEN THE IMPLIED WARRANTY OF +# MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. SEE THE GNU +# GENERAL PUBLIC LICENSE FOR MORE DETAILS. +# +# YOU SHOULD HAVE RECEIVED A COPY OF THE GNU GENERAL PUBLIC LICENSE +# ALONG WITH THIS PROGRAM; IF NOT, WRITE TO EDF R&D CODE_ASTER, +# 1 AVENUE DU GENERAL DE GAULLE, 92141 CLAMART CEDEX, FRANCE. +# +# # ====================================================================== from Tkinter import * import Pmw diff --git a/Editeur/compocomm.py b/Editeur/compocomm.py index 194730ed..d31e71de 100644 --- a/Editeur/compocomm.py +++ b/Editeur/compocomm.py @@ -1,9 +1,21 @@ -#@ MODIF compocomm Editeur DATE 02/07/2001 AUTEUR D6BHHJP J.P.LEFEBVRE # CONFIGURATION MANAGEMENT OF EDF VERSION # ====================================================================== -# COPYRIGHT (C) 1991 - 2001 EDF R&D WWW.CODE-ASTER.ORG -# SEE THE FILE "LICENSE.TERMS" FOR INFORMATION ON USAGE AND -# REDISTRIBUTION OF THIS FILE. +# COPYRIGHT (C) 1991 - 2002 EDF R&D WWW.CODE-ASTER.ORG +# THIS PROGRAM IS FREE SOFTWARE; YOU CAN REDISTRIBUTE IT AND/OR MODIFY +# IT UNDER THE TERMS OF THE GNU GENERAL PUBLIC LICENSE AS PUBLISHED BY +# THE FREE SOFTWARE FOUNDATION; EITHER VERSION 2 OF THE LICENSE, OR +# (AT YOUR OPTION) ANY LATER VERSION. +# +# THIS PROGRAM IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL, BUT +# WITHOUT ANY WARRANTY; WITHOUT EVEN THE IMPLIED WARRANTY OF +# MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. SEE THE GNU +# GENERAL PUBLIC LICENSE FOR MORE DETAILS. +# +# YOU SHOULD HAVE RECEIVED A COPY OF THE GNU GENERAL PUBLIC LICENSE +# ALONG WITH THIS PROGRAM; IF NOT, WRITE TO EDF R&D CODE_ASTER, +# 1 AVENUE DU GENERAL DE GAULLE, 92141 CLAMART CEDEX, FRANCE. +# +# # ====================================================================== from Tkinter import * import Pmw diff --git a/Editeur/compocommandecomm.py b/Editeur/compocommandecomm.py index 8b8c9237..cab37e89 100644 --- a/Editeur/compocommandecomm.py +++ b/Editeur/compocommandecomm.py @@ -1,9 +1,21 @@ -#@ MODIF compocommandecomm Editeur DATE 02/07/2001 AUTEUR D6BHHJP J.P.LEFEBVRE # CONFIGURATION MANAGEMENT OF EDF VERSION # ====================================================================== -# COPYRIGHT (C) 1991 - 2001 EDF R&D WWW.CODE-ASTER.ORG -# SEE THE FILE "LICENSE.TERMS" FOR INFORMATION ON USAGE AND -# REDISTRIBUTION OF THIS FILE. +# COPYRIGHT (C) 1991 - 2002 EDF R&D WWW.CODE-ASTER.ORG +# THIS PROGRAM IS FREE SOFTWARE; YOU CAN REDISTRIBUTE IT AND/OR MODIFY +# IT UNDER THE TERMS OF THE GNU GENERAL PUBLIC LICENSE AS PUBLISHED BY +# THE FREE SOFTWARE FOUNDATION; EITHER VERSION 2 OF THE LICENSE, OR +# (AT YOUR OPTION) ANY LATER VERSION. +# +# THIS PROGRAM IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL, BUT +# WITHOUT ANY WARRANTY; WITHOUT EVEN THE IMPLIED WARRANTY OF +# MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. SEE THE GNU +# GENERAL PUBLIC LICENSE FOR MORE DETAILS. +# +# YOU SHOULD HAVE RECEIVED A COPY OF THE GNU GENERAL PUBLIC LICENSE +# ALONG WITH THIS PROGRAM; IF NOT, WRITE TO EDF R&D CODE_ASTER, +# 1 AVENUE DU GENERAL DE GAULLE, 92141 CLAMART CEDEX, FRANCE. +# +# # ====================================================================== from Tkinter import * import Pmw diff --git a/Editeur/compofact.py b/Editeur/compofact.py index 0b52bbb3..7e0a7927 100644 --- a/Editeur/compofact.py +++ b/Editeur/compofact.py @@ -1,9 +1,21 @@ -#@ MODIF compofact Editeur DATE 02/07/2001 AUTEUR D6BHHJP J.P.LEFEBVRE # CONFIGURATION MANAGEMENT OF EDF VERSION # ====================================================================== -# COPYRIGHT (C) 1991 - 2001 EDF R&D WWW.CODE-ASTER.ORG -# SEE THE FILE "LICENSE.TERMS" FOR INFORMATION ON USAGE AND -# REDISTRIBUTION OF THIS FILE. +# COPYRIGHT (C) 1991 - 2002 EDF R&D WWW.CODE-ASTER.ORG +# THIS PROGRAM IS FREE SOFTWARE; YOU CAN REDISTRIBUTE IT AND/OR MODIFY +# IT UNDER THE TERMS OF THE GNU GENERAL PUBLIC LICENSE AS PUBLISHED BY +# THE FREE SOFTWARE FOUNDATION; EITHER VERSION 2 OF THE LICENSE, OR +# (AT YOUR OPTION) ANY LATER VERSION. +# +# THIS PROGRAM IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL, BUT +# WITHOUT ANY WARRANTY; WITHOUT EVEN THE IMPLIED WARRANTY OF +# MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. SEE THE GNU +# GENERAL PUBLIC LICENSE FOR MORE DETAILS. +# +# YOU SHOULD HAVE RECEIVED A COPY OF THE GNU GENERAL PUBLIC LICENSE +# ALONG WITH THIS PROGRAM; IF NOT, WRITE TO EDF R&D CODE_ASTER, +# 1 AVENUE DU GENERAL DE GAULLE, 92141 CLAMART CEDEX, FRANCE. +# +# # ====================================================================== import Pmw import Objecttreeitem diff --git a/Editeur/compoformule.py b/Editeur/compoformule.py index b2d640f9..345bacc7 100644 --- a/Editeur/compoformule.py +++ b/Editeur/compoformule.py @@ -1,9 +1,21 @@ -#@ MODIF compoformule Editeur DATE 02/07/2001 AUTEUR D6BHHJP J.P.LEFEBVRE # CONFIGURATION MANAGEMENT OF EDF VERSION # ====================================================================== -# COPYRIGHT (C) 1991 - 2001 EDF R&D WWW.CODE-ASTER.ORG -# SEE THE FILE "LICENSE.TERMS" FOR INFORMATION ON USAGE AND -# REDISTRIBUTION OF THIS FILE. +# COPYRIGHT (C) 1991 - 2002 EDF R&D WWW.CODE-ASTER.ORG +# THIS PROGRAM IS FREE SOFTWARE; YOU CAN REDISTRIBUTE IT AND/OR MODIFY +# IT UNDER THE TERMS OF THE GNU GENERAL PUBLIC LICENSE AS PUBLISHED BY +# THE FREE SOFTWARE FOUNDATION; EITHER VERSION 2 OF THE LICENSE, OR +# (AT YOUR OPTION) ANY LATER VERSION. +# +# THIS PROGRAM IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL, BUT +# WITHOUT ANY WARRANTY; WITHOUT EVEN THE IMPLIED WARRANTY OF +# MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. SEE THE GNU +# GENERAL PUBLIC LICENSE FOR MORE DETAILS. +# +# YOU SHOULD HAVE RECEIVED A COPY OF THE GNU GENERAL PUBLIC LICENSE +# ALONG WITH THIS PROGRAM; IF NOT, WRITE TO EDF R&D CODE_ASTER, +# 1 AVENUE DU GENERAL DE GAULLE, 92141 CLAMART CEDEX, FRANCE. +# +# # ====================================================================== """ Ce module contient les classes permettant de définir les objets graphiques diff --git a/Editeur/compojdc.py b/Editeur/compojdc.py index 64461749..f331c612 100644 --- a/Editeur/compojdc.py +++ b/Editeur/compojdc.py @@ -1,17 +1,27 @@ -#@ MODIF compojdc Editeur DATE 02/07/2001 AUTEUR D6BHHJP J.P.LEFEBVRE # CONFIGURATION MANAGEMENT OF EDF VERSION # ====================================================================== -# COPYRIGHT (C) 1991 - 2001 EDF R&D WWW.CODE-ASTER.ORG -# SEE THE FILE "LICENSE.TERMS" FOR INFORMATION ON USAGE AND -# REDISTRIBUTION OF THIS FILE. +# COPYRIGHT (C) 1991 - 2002 EDF R&D WWW.CODE-ASTER.ORG +# THIS PROGRAM IS FREE SOFTWARE; YOU CAN REDISTRIBUTE IT AND/OR MODIFY +# IT UNDER THE TERMS OF THE GNU GENERAL PUBLIC LICENSE AS PUBLISHED BY +# THE FREE SOFTWARE FOUNDATION; EITHER VERSION 2 OF THE LICENSE, OR +# (AT YOUR OPTION) ANY LATER VERSION. +# +# THIS PROGRAM IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL, BUT +# WITHOUT ANY WARRANTY; WITHOUT EVEN THE IMPLIED WARRANTY OF +# MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. SEE THE GNU +# GENERAL PUBLIC LICENSE FOR MORE DETAILS. +# +# YOU SHOULD HAVE RECEIVED A COPY OF THE GNU GENERAL PUBLIC LICENSE +# ALONG WITH THIS PROGRAM; IF NOT, WRITE TO EDF R&D CODE_ASTER, +# 1 AVENUE DU GENERAL DE GAULLE, 92141 CLAMART CEDEX, FRANCE. +# +# # ====================================================================== -#XXX est ce utile ?from Tkinter import * import Pmw import Objecttreeitem import panels from widgets import ListeChoix -# XXX temporairement supprimé :from Accas import commentaire class JDCPanel(panels.OngletPanel): def init(self): diff --git a/Editeur/compomacro.py b/Editeur/compomacro.py index ce439f5d..edbf840c 100644 --- a/Editeur/compomacro.py +++ b/Editeur/compomacro.py @@ -1,9 +1,21 @@ -#@ MODIF compomacro Editeur DATE 02/07/2001 AUTEUR D6BHHJP J.P.LEFEBVRE # CONFIGURATION MANAGEMENT OF EDF VERSION # ====================================================================== -# COPYRIGHT (C) 1991 - 2001 EDF R&D WWW.CODE-ASTER.ORG -# SEE THE FILE "LICENSE.TERMS" FOR INFORMATION ON USAGE AND -# REDISTRIBUTION OF THIS FILE. +# COPYRIGHT (C) 1991 - 2002 EDF R&D WWW.CODE-ASTER.ORG +# THIS PROGRAM IS FREE SOFTWARE; YOU CAN REDISTRIBUTE IT AND/OR MODIFY +# IT UNDER THE TERMS OF THE GNU GENERAL PUBLIC LICENSE AS PUBLISHED BY +# THE FREE SOFTWARE FOUNDATION; EITHER VERSION 2 OF THE LICENSE, OR +# (AT YOUR OPTION) ANY LATER VERSION. +# +# THIS PROGRAM IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL, BUT +# WITHOUT ANY WARRANTY; WITHOUT EVEN THE IMPLIED WARRANTY OF +# MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. SEE THE GNU +# GENERAL PUBLIC LICENSE FOR MORE DETAILS. +# +# YOU SHOULD HAVE RECEIVED A COPY OF THE GNU GENERAL PUBLIC LICENSE +# ALONG WITH THIS PROGRAM; IF NOT, WRITE TO EDF R&D CODE_ASTER, +# 1 AVENUE DU GENERAL DE GAULLE, 92141 CLAMART CEDEX, FRANCE. +# +# # ====================================================================== # Modules Python import os,sys,string @@ -23,8 +35,8 @@ import convert from widgets import Fenetre # -__version__="$Name: V1_1p1 $" -__Id__="$Id: compomacro.py,v 1.1.1.1 2001/12/04 15:38:22 eficas Exp $" +__version__="$Name: $" +__Id__="$Id: compomacro.py,v 1.4 2002/05/15 15:31:58 eficas Exp $" # class MACROPanel(panels.OngletPanel): @@ -39,7 +51,7 @@ class MACROPanel(panels.OngletPanel): nb.add('Concept', tab_text='Nommer concept') if ficini == 1: nb.add('Fichierinit',tab_text = 'Fichier %s' %self.node.item.get_nom()) - nb.add('Commande', tab_text='Insérer Commande') + nb.add('Commande', tab_text='Nouvelle Commande') nb.add('Commentaire',tab_text='Paramètre/Commentaire') panneau=Pmw.PanedWidget(nb.page("Mocles"), orient='horizontal') @@ -187,6 +199,11 @@ class MACROTreeItem(compooper.EtapeTreeItem): Ce nom dépend de la validité de l'objet """ if self.object.isactif(): + if self.object.state != 'unchanged': + # Si des modifications ont eu lieu on force le calcul des concepts de sortie + # et celui du contexte glissant + self.object.get_type_produit(force=1) + self.object.parent.reset_context() if self.object.isvalid(): return "ast-green-square" else: @@ -230,6 +247,7 @@ class MACROTreeItem(compooper.EtapeTreeItem): # item.object = MCSIMP, MCFACT, MCBLOC ou MCList if item.object.isoblig() : self.appli.affiche_infos('Impossible de supprimer un mot-clé obligatoire ') + print "Impossible de supprimer un mot-clé obligatoire" return 0 else : self.object.suppentite(item.object) @@ -274,10 +292,6 @@ class MACROTreeItem(compooper.EtapeTreeItem): def verif_condition_bloc(self): return self.object.verif_condition_bloc() - def nomme_sd(self,nom): - """ Lance la méthode de nommage de la SD """ - return self.object.nomme_sd(nom) - def get_noms_sd_oper_reentrant(self): return self.object.get_noms_sd_oper_reentrant() diff --git a/Editeur/compomclist.py b/Editeur/compomclist.py index 74f5254e..e1ba88e4 100644 --- a/Editeur/compomclist.py +++ b/Editeur/compomclist.py @@ -1,9 +1,21 @@ -#@ MODIF compomclist Editeur DATE 02/07/2001 AUTEUR D6BHHJP J.P.LEFEBVRE # CONFIGURATION MANAGEMENT OF EDF VERSION # ====================================================================== -# COPYRIGHT (C) 1991 - 2001 EDF R&D WWW.CODE-ASTER.ORG -# SEE THE FILE "LICENSE.TERMS" FOR INFORMATION ON USAGE AND -# REDISTRIBUTION OF THIS FILE. +# COPYRIGHT (C) 1991 - 2002 EDF R&D WWW.CODE-ASTER.ORG +# THIS PROGRAM IS FREE SOFTWARE; YOU CAN REDISTRIBUTE IT AND/OR MODIFY +# IT UNDER THE TERMS OF THE GNU GENERAL PUBLIC LICENSE AS PUBLISHED BY +# THE FREE SOFTWARE FOUNDATION; EITHER VERSION 2 OF THE LICENSE, OR +# (AT YOUR OPTION) ANY LATER VERSION. +# +# THIS PROGRAM IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL, BUT +# WITHOUT ANY WARRANTY; WITHOUT EVEN THE IMPLIED WARRANTY OF +# MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. SEE THE GNU +# GENERAL PUBLIC LICENSE FOR MORE DETAILS. +# +# YOU SHOULD HAVE RECEIVED A COPY OF THE GNU GENERAL PUBLIC LICENSE +# ALONG WITH THIS PROGRAM; IF NOT, WRITE TO EDF R&D CODE_ASTER, +# 1 AVENUE DU GENERAL DE GAULLE, 92141 CLAMART CEDEX, FRANCE. +# +# # ====================================================================== from Tkinter import * import Pmw @@ -39,7 +51,35 @@ class MCListTreeItem(Objecttreeitem.SequenceTreeItem): Retourne 1 si l'objet pointé par self est un MCFact, 0 sinon """ return 0 - + + def isMCList(self): + """ + Retourne 1 si l'objet pointé par self est une MCList, 0 sinon + """ + return 1 + + def additem(self,obj,pos): + """ + Ajoute un objet MCFACT à la MCList (self.object) à la position pos + """ + self.object.init_modif() + obj.verif_existence_sd() + obj.reparent(self.object.parent) + self.object.insert(pos,obj) + item = self.make_objecttreeitem(self.appli, obj.nom + ":", obj) + return item + + def suppitem(self,item): + """ + Retire un objet MCFACT de la MCList (self.object) + """ + self.object.init_modif() + self.object.remove(item.object) + # la liste peut être retournée vide ! + message = "Mot-clé " + item.object.nom + " supprimé" + self.appli.affiche_infos(message) + return 1 + import Accas treeitem = MCListTreeItem objet = Accas.MCList diff --git a/Editeur/componiveau.py b/Editeur/componiveau.py index 67ed0df1..f16c2c13 100644 --- a/Editeur/componiveau.py +++ b/Editeur/componiveau.py @@ -1,9 +1,21 @@ -#@ MODIF componiveau Editeur DATE 02/07/2001 AUTEUR D6BHHJP J.P.LEFEBVRE # CONFIGURATION MANAGEMENT OF EDF VERSION # ====================================================================== -# COPYRIGHT (C) 1991 - 2001 EDF R&D WWW.CODE-ASTER.ORG -# SEE THE FILE "LICENSE.TERMS" FOR INFORMATION ON USAGE AND -# REDISTRIBUTION OF THIS FILE. +# COPYRIGHT (C) 1991 - 2002 EDF R&D WWW.CODE-ASTER.ORG +# THIS PROGRAM IS FREE SOFTWARE; YOU CAN REDISTRIBUTE IT AND/OR MODIFY +# IT UNDER THE TERMS OF THE GNU GENERAL PUBLIC LICENSE AS PUBLISHED BY +# THE FREE SOFTWARE FOUNDATION; EITHER VERSION 2 OF THE LICENSE, OR +# (AT YOUR OPTION) ANY LATER VERSION. +# +# THIS PROGRAM IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL, BUT +# WITHOUT ANY WARRANTY; WITHOUT EVEN THE IMPLIED WARRANTY OF +# MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. SEE THE GNU +# GENERAL PUBLIC LICENSE FOR MORE DETAILS. +# +# YOU SHOULD HAVE RECEIVED A COPY OF THE GNU GENERAL PUBLIC LICENSE +# ALONG WITH THIS PROGRAM; IF NOT, WRITE TO EDF R&D CODE_ASTER, +# 1 AVENUE DU GENERAL DE GAULLE, 92141 CLAMART CEDEX, FRANCE. +# +# # ====================================================================== from Tkinter import * diff --git a/Editeur/componuplet.py b/Editeur/componuplet.py index d4e76fb9..04d11082 100644 --- a/Editeur/componuplet.py +++ b/Editeur/componuplet.py @@ -1,9 +1,21 @@ -#@ MODIF componuplet Editeur DATE 02/07/2001 AUTEUR D6BHHJP J.P.LEFEBVRE # CONFIGURATION MANAGEMENT OF EDF VERSION # ====================================================================== -# COPYRIGHT (C) 1991 - 2001 EDF R&D WWW.CODE-ASTER.ORG -# SEE THE FILE "LICENSE.TERMS" FOR INFORMATION ON USAGE AND -# REDISTRIBUTION OF THIS FILE. +# COPYRIGHT (C) 1991 - 2002 EDF R&D WWW.CODE-ASTER.ORG +# THIS PROGRAM IS FREE SOFTWARE; YOU CAN REDISTRIBUTE IT AND/OR MODIFY +# IT UNDER THE TERMS OF THE GNU GENERAL PUBLIC LICENSE AS PUBLISHED BY +# THE FREE SOFTWARE FOUNDATION; EITHER VERSION 2 OF THE LICENSE, OR +# (AT YOUR OPTION) ANY LATER VERSION. +# +# THIS PROGRAM IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL, BUT +# WITHOUT ANY WARRANTY; WITHOUT EVEN THE IMPLIED WARRANTY OF +# MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. SEE THE GNU +# GENERAL PUBLIC LICENSE FOR MORE DETAILS. +# +# YOU SHOULD HAVE RECEIVED A COPY OF THE GNU GENERAL PUBLIC LICENSE +# ALONG WITH THIS PROGRAM; IF NOT, WRITE TO EDF R&D CODE_ASTER, +# 1 AVENUE DU GENERAL DE GAULLE, 92141 CLAMART CEDEX, FRANCE. +# +# # ====================================================================== # Modules Python import types @@ -17,8 +29,8 @@ import Objecttreeitem import panels # -__version__="$Name: V1_1p1 $" -__Id__="$Id: componuplet.py,v 1.1.1.1 2001/12/04 15:38:22 eficas Exp $" +__version__="$Name: $" +__Id__="$Id: componuplet.py,v 1.1.1.1 2002/03/26 09:08:46 eficas Exp $" # myrepr = Repr() diff --git a/Editeur/compooper.py b/Editeur/compooper.py index eceb5cf8..154aa2ab 100644 --- a/Editeur/compooper.py +++ b/Editeur/compooper.py @@ -1,12 +1,25 @@ -#@ MODIF compooper Editeur DATE 02/07/2001 AUTEUR D6BHHJP J.P.LEFEBVRE # CONFIGURATION MANAGEMENT OF EDF VERSION # ====================================================================== -# COPYRIGHT (C) 1991 - 2001 EDF R&D WWW.CODE-ASTER.ORG -# SEE THE FILE "LICENSE.TERMS" FOR INFORMATION ON USAGE AND -# REDISTRIBUTION OF THIS FILE. +# COPYRIGHT (C) 1991 - 2002 EDF R&D WWW.CODE-ASTER.ORG +# THIS PROGRAM IS FREE SOFTWARE; YOU CAN REDISTRIBUTE IT AND/OR MODIFY +# IT UNDER THE TERMS OF THE GNU GENERAL PUBLIC LICENSE AS PUBLISHED BY +# THE FREE SOFTWARE FOUNDATION; EITHER VERSION 2 OF THE LICENSE, OR +# (AT YOUR OPTION) ANY LATER VERSION. +# +# THIS PROGRAM IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL, BUT +# WITHOUT ANY WARRANTY; WITHOUT EVEN THE IMPLIED WARRANTY OF +# MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. SEE THE GNU +# GENERAL PUBLIC LICENSE FOR MORE DETAILS. +# +# YOU SHOULD HAVE RECEIVED A COPY OF THE GNU GENERAL PUBLIC LICENSE +# ALONG WITH THIS PROGRAM; IF NOT, WRITE TO EDF R&D CODE_ASTER, +# 1 AVENUE DU GENERAL DE GAULLE, 92141 CLAMART CEDEX, FRANCE. +# +# # ====================================================================== from Tkinter import * import Pmw +import traceback import Objecttreeitem import panels import fontes @@ -68,7 +81,8 @@ class OPERPanel(panels.OngletPanel): choix = self.listbox.getcurselection()[0] self.valeur_choisie.set(choix) except: - pass + traceback.print_exc() + def choose_valeur_from_list(self,command): try: @@ -76,7 +90,7 @@ class OPERPanel(panels.OngletPanel): self.valeur_choisie.set(choix) apply(command,(),{}) except: - pass + traceback.print_exc() class EtapeTreeItem(Objecttreeitem.ObjectTreeItem): panel = OPERPanel @@ -189,7 +203,9 @@ class EtapeTreeItem(Objecttreeitem.ObjectTreeItem): def nomme_sd(self,nom): """ Lance la méthode de nommage de la SD """ - return self.object.nomme_sd(nom) + test,mess= self.object.nomme_sd(nom) + if test:self.object.parent.reset_context() + return test,mess def is_reentrant(self): return self.object.is_reentrant() @@ -218,6 +234,16 @@ class EtapeTreeItem(Objecttreeitem.ObjectTreeItem): commande_comment.jdc = commande_comment.parent = self.object.jdc return commande_comment + def replace_child(self,old_item,new_item): + """ + Remplace old_item.object par new_item.object dans les fils de self.object + """ + index = self.object.mc_liste.index(old_item.object) + self.object.init_modif() + self.object.mc_liste.remove(old_item.object) + self.object.mc_liste.insert(index,new_item.object) + self.object.fin_modif() + import Accas treeitem = EtapeTreeItem objet = Accas.ETAPE diff --git a/Editeur/compoparam.py b/Editeur/compoparam.py index cd247e05..b5331466 100644 --- a/Editeur/compoparam.py +++ b/Editeur/compoparam.py @@ -1,9 +1,21 @@ -#@ MODIF compoparam Editeur DATE 02/07/2001 AUTEUR D6BHHJP J.P.LEFEBVRE # CONFIGURATION MANAGEMENT OF EDF VERSION # ====================================================================== -# COPYRIGHT (C) 1991 - 2001 EDF R&D WWW.CODE-ASTER.ORG -# SEE THE FILE "LICENSE.TERMS" FOR INFORMATION ON USAGE AND -# REDISTRIBUTION OF THIS FILE. +# COPYRIGHT (C) 1991 - 2002 EDF R&D WWW.CODE-ASTER.ORG +# THIS PROGRAM IS FREE SOFTWARE; YOU CAN REDISTRIBUTE IT AND/OR MODIFY +# IT UNDER THE TERMS OF THE GNU GENERAL PUBLIC LICENSE AS PUBLISHED BY +# THE FREE SOFTWARE FOUNDATION; EITHER VERSION 2 OF THE LICENSE, OR +# (AT YOUR OPTION) ANY LATER VERSION. +# +# THIS PROGRAM IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL, BUT +# WITHOUT ANY WARRANTY; WITHOUT EVEN THE IMPLIED WARRANTY OF +# MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. SEE THE GNU +# GENERAL PUBLIC LICENSE FOR MORE DETAILS. +# +# YOU SHOULD HAVE RECEIVED A COPY OF THE GNU GENERAL PUBLIC LICENSE +# ALONG WITH THIS PROGRAM; IF NOT, WRITE TO EDF R&D CODE_ASTER, +# 1 AVENUE DU GENERAL DE GAULLE, 92141 CLAMART CEDEX, FRANCE. +# +# # ====================================================================== """ Ce module contient les classes permettant de définir les objets graphiques diff --git a/Editeur/compoparameval.py b/Editeur/compoparameval.py index 13bb98ba..2fa34a60 100644 --- a/Editeur/compoparameval.py +++ b/Editeur/compoparameval.py @@ -1,9 +1,21 @@ -#@ MODIF compoparameval Editeur DATE 02/07/2001 AUTEUR D6BHHJP J.P.LEFEBVRE # CONFIGURATION MANAGEMENT OF EDF VERSION # ====================================================================== -# COPYRIGHT (C) 1991 - 2001 EDF R&D WWW.CODE-ASTER.ORG -# SEE THE FILE "LICENSE.TERMS" FOR INFORMATION ON USAGE AND -# REDISTRIBUTION OF THIS FILE. +# COPYRIGHT (C) 1991 - 2002 EDF R&D WWW.CODE-ASTER.ORG +# THIS PROGRAM IS FREE SOFTWARE; YOU CAN REDISTRIBUTE IT AND/OR MODIFY +# IT UNDER THE TERMS OF THE GNU GENERAL PUBLIC LICENSE AS PUBLISHED BY +# THE FREE SOFTWARE FOUNDATION; EITHER VERSION 2 OF THE LICENSE, OR +# (AT YOUR OPTION) ANY LATER VERSION. +# +# THIS PROGRAM IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL, BUT +# WITHOUT ANY WARRANTY; WITHOUT EVEN THE IMPLIED WARRANTY OF +# MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. SEE THE GNU +# GENERAL PUBLIC LICENSE FOR MORE DETAILS. +# +# YOU SHOULD HAVE RECEIVED A COPY OF THE GNU GENERAL PUBLIC LICENSE +# ALONG WITH THIS PROGRAM; IF NOT, WRITE TO EDF R&D CODE_ASTER, +# 1 AVENUE DU GENERAL DE GAULLE, 92141 CLAMART CEDEX, FRANCE. +# +# # ====================================================================== """ Ce module contient les classes permettant de définir les objets graphiques diff --git a/Editeur/compoproc.py b/Editeur/compoproc.py index 7cbc5edf..88188816 100644 --- a/Editeur/compoproc.py +++ b/Editeur/compoproc.py @@ -1,9 +1,21 @@ -#@ MODIF compoproc Editeur DATE 02/07/2001 AUTEUR D6BHHJP J.P.LEFEBVRE # CONFIGURATION MANAGEMENT OF EDF VERSION # ====================================================================== -# COPYRIGHT (C) 1991 - 2001 EDF R&D WWW.CODE-ASTER.ORG -# SEE THE FILE "LICENSE.TERMS" FOR INFORMATION ON USAGE AND -# REDISTRIBUTION OF THIS FILE. +# COPYRIGHT (C) 1991 - 2002 EDF R&D WWW.CODE-ASTER.ORG +# THIS PROGRAM IS FREE SOFTWARE; YOU CAN REDISTRIBUTE IT AND/OR MODIFY +# IT UNDER THE TERMS OF THE GNU GENERAL PUBLIC LICENSE AS PUBLISHED BY +# THE FREE SOFTWARE FOUNDATION; EITHER VERSION 2 OF THE LICENSE, OR +# (AT YOUR OPTION) ANY LATER VERSION. +# +# THIS PROGRAM IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL, BUT +# WITHOUT ANY WARRANTY; WITHOUT EVEN THE IMPLIED WARRANTY OF +# MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. SEE THE GNU +# GENERAL PUBLIC LICENSE FOR MORE DETAILS. +# +# YOU SHOULD HAVE RECEIVED A COPY OF THE GNU GENERAL PUBLIC LICENSE +# ALONG WITH THIS PROGRAM; IF NOT, WRITE TO EDF R&D CODE_ASTER, +# 1 AVENUE DU GENERAL DE GAULLE, 92141 CLAMART CEDEX, FRANCE. +# +# # ====================================================================== from Tkinter import * import Pmw @@ -19,7 +31,7 @@ class PROCPanel(panels.OngletPanel): nb.pack(fill = 'both', expand = 1) self.nb=nb nb.add('Mocles', tab_text='Ajouter mots-clés') - nb.add('Commande', tab_text='Insérer Commande') + nb.add('Commande', tab_text='Nouvelle Commande') nb.add('Commentaire',tab_text='Paramètre/Commentaire') panneau=Pmw.PanedWidget(nb.page("Mocles"), orient='horizontal') @@ -130,10 +142,6 @@ class ProcEtapeTreeItem(compooper.EtapeTreeItem): def verif_condition_bloc(self): return self.object.verif_condition_bloc() - def nomme_sd(self,nom): - """ Lance la méthode de nommage de la SD """ - return self.object.nomme_sd(nom) - def get_noms_sd_oper_reentrant(self): return self.object.get_noms_sd_oper_reentrant() diff --git a/Editeur/composimp.py b/Editeur/composimp.py index d7ec659b..57e7c505 100644 --- a/Editeur/composimp.py +++ b/Editeur/composimp.py @@ -1,17 +1,32 @@ -#@ MODIF composimp Editeur DATE 05/09/2001 AUTEUR DURAND C.DURAND # CONFIGURATION MANAGEMENT OF EDF VERSION # ====================================================================== -# COPYRIGHT (C) 1991 - 2001 EDF R&D WWW.CODE-ASTER.ORG -# SEE THE FILE "LICENSE.TERMS" FOR INFORMATION ON USAGE AND -# REDISTRIBUTION OF THIS FILE. +# COPYRIGHT (C) 1991 - 2002 EDF R&D WWW.CODE-ASTER.ORG +# THIS PROGRAM IS FREE SOFTWARE; YOU CAN REDISTRIBUTE IT AND/OR MODIFY +# IT UNDER THE TERMS OF THE GNU GENERAL PUBLIC LICENSE AS PUBLISHED BY +# THE FREE SOFTWARE FOUNDATION; EITHER VERSION 2 OF THE LICENSE, OR +# (AT YOUR OPTION) ANY LATER VERSION. +# +# THIS PROGRAM IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL, BUT +# WITHOUT ANY WARRANTY; WITHOUT EVEN THE IMPLIED WARRANTY OF +# MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. SEE THE GNU +# GENERAL PUBLIC LICENSE FOR MORE DETAILS. +# +# YOU SHOULD HAVE RECEIVED A COPY OF THE GNU GENERAL PUBLIC LICENSE +# ALONG WITH THIS PROGRAM; IF NOT, WRITE TO EDF R&D CODE_ASTER, +# 1 AVENUE DU GENERAL DE GAULLE, 92141 CLAMART CEDEX, FRANCE. +# +# # ====================================================================== +# Modules Python import string,types,os from Tkinter import * import Pmw from tkFileDialog import * from tkMessageBox import showinfo from copy import copy,deepcopy +import traceback +# Modules Eficas import Objecttreeitem import prefs import panels @@ -51,7 +66,8 @@ class newSIMPPanel(panels.OngletPanel): def record_valeur(self,name=None,mess='Valeur du mot-clé enregistrée'): """ - Enregistre val comme valeur de self.node.item.object SANS faire de test de validité + Enregistre val comme valeur de self.node.item.object SANS + faire de test de validité """ if self.parent.modified == 'n' : self.parent.init_modif() if name != None: @@ -67,9 +83,9 @@ class newSIMPPanel(panels.OngletPanel): self.node.racine.verif_all() else : self.node.parent.verif() + self.node.update() if self.node.item.isvalid(): self.node.parent.select() - self.node.update() # ---------------------------------------------------------------------------------------- # Méthodes utlisées pour la manipulation des items dans les listes de choix # ---------------------------------------------------------------------------------------- @@ -196,18 +212,18 @@ class PLUSIEURS_Panel(newSIMPPanel): self.record_valeur(valeur) if self.node.item.isvalid(): self.node.parent.select() - # fermeture de la fenêtre de sélection - if self.ajout_valeurs: - self.ajout_valeurs.quit() + # fermeture de la fenêtre de sélection + if self.ajout_valeurs: + self.ajout_valeurs.quit() def annule_modifs_valeur(self): """ RAZ de la liste des valeurs (annule toutes les valeurs saisies par l'utilisateur) """ self.node.select() - # fermeture de la fenêtre de sélection - if self.ajout_valeurs: - self.ajout_valeurs.quit() + # fermeture de la fenêtre de sélection + if self.ajout_valeurs: + self.ajout_valeurs.quit() def traite_reel(self,valeur): """ @@ -305,7 +321,7 @@ class PLUSIEURS_INTO_Panel(PLUSIEURS_Panel): """ Génère la page de saisie de plusieurs valeurs parmi un ensemble discret de possibles - """ + """ self.ajout_valeurs = None # On récupère la bulle d'aide du panneau, l'objet, min et max (cardinalité de la liste), # la liste des choix et la liste des valeurs @@ -424,12 +440,12 @@ class PLUSIEURS_BASE_Panel(PLUSIEURS_Panel): # Création de l'entry ou de la liste des SD self.label = Label(self.frame_choix,text="Valeur :") self.make_entry(frame = self.frame_choix,command = self.add_valeur_sans_into) - self.label.place(relx=0.05,rely=0.5) - # Création d'un bouton "Importer ..." sur le panel. - bouton_valeurs_fichier = Button(self.frame_choix, - text="Importer ...", - command=self.select_in_file) - bouton_valeurs_fichier.place(relx=0.28,rely=0.7,relwidth=0.6) + self.label.place(relx=0.05,rely=0.5) + # Création d'un bouton "Importer ..." sur le panel. + bouton_valeurs_fichier = Button(self.frame_choix, + text="Importer ...", + command=self.select_in_file) + bouton_valeurs_fichier.place(relx=0.28,rely=0.7,relwidth=0.6) self.ajout_valeurs = None # boutons Ajouter et Supprimer bouton_add = Button(self.frame_boutons_fleches, @@ -441,10 +457,12 @@ class PLUSIEURS_BASE_Panel(PLUSIEURS_Panel): bouton_add.place(relx=0.3,rely=0.35) bouton_sup.place(relx=0.3,rely=0.65) # affichage de l'aide + self.frame_aide.update() self.aide = Label(self.frame_aide, text = aide, justify='center', - anchor='center') + anchor='center', + wraplength=int(self.frame_aide.winfo_width()*0.8)) self.aide.place(relx=0.5,rely=0.5,anchor='center',relwidth=1) self.Liste_valeurs.affiche_liste() # boutons Accepter et Annuler @@ -456,21 +474,24 @@ class PLUSIEURS_BASE_Panel(PLUSIEURS_Panel): command = self.annule_modifs_valeur) for but in (bouton_accepter,bouton_annuler): but.pack(side='left',padx=5) - - def select_in_file(self): - """ Permet d'ouvrir un fichier choisi par l'utilisateur. """ - nom_fichier = askopenfilename(title="Choix fichier :") - if nom_fichier == "": - return - try: - f = open(nom_fichier, "rb") - selection_texte = f.read() - f.close() - self.ajout_valeurs = FenetreDeSelection(self, self.node.item, - titre="Sélection de valeurs", - texte=selection_texte) - except: - showinfo("Erreur de fichier","impossible d'ouvir le fichier "+nom_fichier) + + def select_in_file(self): + """ Permet d'ouvrir un fichier choisi par l'utilisateur. """ + nom_fichier = askopenfilename(title="Choix fichier :") + if nom_fichier == "": + return + try: + f = open(nom_fichier, "rb") + selection_texte = f.read() + f.close() + self.ajout_valeurs = FenetreDeSelection(self, + self.node.item, + self.parent.appli, + titre="Sélection de valeurs", + texte=selection_texte) + except: + traceback.print_exc() + showinfo("Erreur de fichier","impossible d'ouvir le fichier "+nom_fichier) def get_bulle_aide(self): """ @@ -700,22 +721,20 @@ class UNIQUE_Panel(newSIMPPanel): if not test : mess = "impossible d'évaluer : %s " %`valeur` self.parent.appli.affiche_infos("Valeur du mot-clé non autorisée :"+mess) - return elif self.node.item.isvalid() : self.parent.appli.affiche_infos('Valeur du mot-clé enregistrée') + if self.node.item.get_position()=='global': + self.node.etape.verif_all() + elif self.node.item.get_position()=='global_jdc': + self.node.racine.verif_all() + else : + self.node.parent.verif() + self.node.update() self.node.parent.select() else : cr = self.node.item.get_cr() mess = "Valeur du mot-clé non autorisée :"+cr.get_mess_fatal() self.record_valeur(anc_val,mess=mess) - return - if self.node.item.get_position()=='global': - self.node.etape.verif_all() - elif self.node.item.get_position()=='global_jdc': - self.node.racine.verif_all() - else : - self.node.parent.verif() - self.node.update() class UNIQUE_INTO_Panel(UNIQUE_Panel): """ @@ -878,7 +897,7 @@ class UNIQUE_SDCO_Panel(UNIQUE_ASSD_Panel): self.listbox.place(relx=0.5,rely=0.3,relheight=0.4,anchor='center') # affichage du bouton 'Nouveau concept' self.b_co = Pmw.OptionMenu(self.frame_valeur,labelpos='w',label_text = "Nouveau concept : ", - items = ('OUI','NON'),menubutton_width=10) + items = ('NON','OUI'),menubutton_width=10) self.b_co.configure(command = lambda e,s=self : s.ask_new_concept()) self.b_co.place(relx=0.05,rely=0.6,anchor='w') self.label_co = Label(self.frame_valeur,text='Nom du nouveau concept :') @@ -888,9 +907,12 @@ class UNIQUE_SDCO_Panel(UNIQUE_ASSD_Panel): self.l_resu = Label(self.frame_valeur,text='Structure de donnée choisie :') self.valeur_choisie = StringVar() self.label_valeur = Label(self.frame_valeur,textvariable=self.valeur_choisie) - self.aide = Label(self.frame_valeur, text = aide) + self.frame_valeur.update() + self.aide = Label(self.frame_valeur, + text = aide, + wraplength=int(self.frame_valeur.winfo_width()*0.8), + justify='center') self.aide.place(relx=0.5,rely=0.85,anchor='n') - self.b_co.invoke('NON') # affichage de la valeur courante self.display_valeur() @@ -902,13 +924,66 @@ class UNIQUE_SDCO_Panel(UNIQUE_ASSD_Panel): pour valoriser le mot-clé simple courant ou cliquez sur NOUVEAU CONCEPT pour entrer le nom d'un concept non encore existant""" + def valid_valeur(self): + """ + Teste si la valeur fournie par l'utilisateur est une valeur permise : + - si oui, l'enregistre + - si non, restaure l'ancienne valeur + """ + if self.parent.modified == 'n' : self.parent.init_modif() + valeur = self.get_valeur() + self.erase_valeur() + anc_val = self.node.item.get_valeur() + test_CO=self.node.item.is_CO(anc_val) + test = self.node.item.set_valeur(valeur) + if not test : + mess = "impossible d'évaluer : %s " %`valeur` + self.parent.appli.affiche_infos("Valeur du mot-clé non autorisée :"+mess) + return + elif self.node.item.isvalid() : + self.parent.appli.affiche_infos('Valeur du mot-clé enregistrée') + if test_CO: + # il faut egalement propager la destruction de l'ancien concept + self.node.item.delete_valeur_co(valeur=anc_val) + # et on force le recalcul des concepts de sortie de l'etape + self.node.item.object.etape.get_type_produit(force=1) + # et le recalcul du contexte + self.node.item.object.etape.parent.reset_context() + self.node.parent.select() + else : + cr = self.node.item.get_cr() + mess = "Valeur du mot-clé non autorisée :"+cr.get_mess_fatal() + self.record_valeur(anc_val,mess=mess) + return + if self.node.item.get_position()=='global': + self.node.etape.verif_all() + elif self.node.item.get_position()=='global_jdc': + self.node.racine.verif_all() + else : + self.node.parent.verif() + self.node.update() + def valid_nom_concept_co(self,event=None): """ Lit le nom donné par l'utilisateur au concept de type CO qui doit être la valeur du MCS courant et stocke cette valeur """ + if self.parent.modified == 'n' : self.parent.init_modif() + anc_val = self.node.item.get_valeur() nom_concept = self.entry_co.get() - self.node.item.set_valeur_co(nom_concept) + test,mess=self.node.item.set_valeur_co(nom_concept) + if not test: + # On n'a pas pu créer le concept + self.parent.appli.affiche_infos(mess) + return + elif self.node.item.isvalid() : + self.parent.appli.affiche_infos('Valeur du mot-clé enregistrée') + self.node.parent.select() + else : + cr = self.node.item.get_cr() + mess = "Valeur du mot-clé non autorisée :"+cr.get_mess_fatal() + self.record_valeur(anc_val,mess=mess) + return if self.node.item.get_position()=='global': self.node.etape.verif_all() elif self.node.item.get_position()=='global_jdc': @@ -932,6 +1007,9 @@ class UNIQUE_SDCO_Panel(UNIQUE_ASSD_Panel): self.label_valeur.place_forget() self.entry_co.focus() elif new_concept == 'NON': + # On est passe de OUI à NON, on supprime la valeur + self.node.item.delete_valeur_co() + self.record_valeur(name=None,mess="Suppression CO enregistrée") self.label_co.place_forget() self.entry_co.place_forget() self.l_resu.place(relx=0.05,rely=0.7) @@ -942,14 +1020,40 @@ class UNIQUE_SDCO_Panel(UNIQUE_ASSD_Panel): Affiche la valeur de l'objet pointé par self """ valeur = self.node.item.get_valeur() - if valeur == None : return # pas de valeur à afficher ... + if valeur == None or valeur == '': + self.valeur_choisie.set('') + return # pas de valeur à afficher ... # il faut configurer le bouton si la valeur est un objet CO # sinon afficher le nom du concept dans self.valeur_choisie - if valeur.__class__.__name__ != 'CO': - self.valeur_choisie.set(valeur.nom) - else: + if self.node.item.is_CO(): self.b_co.invoke('OUI') self.entry_co.insert(0,valeur.nom) + else: + self.valeur_choisie.set(valeur.nom) + + def record_valeur(self,name=None,mess='Valeur du mot-clé enregistrée'): + """ + Enregistre val comme valeur de self.node.item.object SANS faire de test de validité + """ + if self.parent.modified == 'n' : self.parent.init_modif() + if name != None: + valeur =name + else : + self.entry_co.delete(0,END) + valeur= self.entry_co.get() + self.node.item.set_valeur_co(valeur) + self.parent.appli.affiche_infos(mess) + # On met a jour le display dans le panneau + self.display_valeur() + if self.node.item.get_position()=='global': + self.node.etape.verif_all() + elif self.node.item.get_position()=='global_jdc': + self.node.racine.verif_all() + else : + self.node.parent.verif() + if self.node.item.isvalid(): + self.node.parent.select() + self.node.update() class UNIQUE_BASE_Panel(UNIQUE_Panel): @@ -980,7 +1084,11 @@ class UNIQUE_BASE_Panel(UNIQUE_Panel): self.entry.bind("",lambda e,c=self.valid_valeur:c()) self.entry.focus() # aide associée au panneau - self.aide = Label(self.frame_valeur, text = aide) + self.frame_valeur.update() + self.aide = Label(self.frame_valeur, + text = aide, + wraplength=int(self.frame_valeur.winfo_width()*0.8), + justify='center') self.aide.place(relx=0.5,rely=0.7,anchor='n') # affichage de la valeur du MCS self.display_valeur() @@ -1047,7 +1155,11 @@ class UNIQUE_COMP_Panel(UNIQUE_Panel): self.entry1.place(relx=0.27,rely = 0.5,relwidth=0.35) self.entry2.place(relx=0.65,rely = 0.5,relwidth=0.35) self.entry1.focus() - self.aide = Label(self.frame_valeur, text = aide) + self.frame_valeur.update() + self.aide = Label(self.frame_valeur, + text = aide, + wraplength=int(self.frame_valeur.winfo_width()*0.8), + justify='center') self.aide.place(relx=0.5,rely=0.7,anchor='n') def get_bulle_aide(self): @@ -1135,7 +1247,6 @@ class SIMPTreeItem(Objecttreeitem.AtomicObjectTreeItem): else: # on attend un entier, un réel ou une string self.panel = UNIQUE_BASE_Panel - def SetText(self, text): try: @@ -1158,7 +1269,8 @@ class SIMPTreeItem(Objecttreeitem.AtomicObjectTreeItem): Retourne le texte à afficher dans l'arbre représentant la valeur de l'objet pointé par self """ - return self.object.GetText() + text= self.object.GetText() + return text def wait_co(self): """ @@ -1218,42 +1330,47 @@ class SIMPTreeItem(Objecttreeitem.AtomicObjectTreeItem): def GetMinMax(self): """ Retourne les valeurs min et max de la définition de object """ return self.object.get_min_max() - - def GetMultiplicite(self): - """ A préciser. - Retourne la multiplicité des valeurs affectées à l'objet - représenté par l'item. Pour le moment retourne invariablement 1. - """ - return 1 - - def GetType(self): - """ Retourne le type de valeur attendu par l'objet représenté par l'item. - """ - return self.object.get_type() - - def GetIntervalle(self): - """ Retourne le domaine de valeur attendu par l'objet représenté par l'item. - """ - return self.object.getintervalle() - - def IsInIntervalle(self,valeur): - """ Retourne 1 si la valeur est dans l'intervalle permis par - l'objet représenté par l'item. - """ - return self.object.isinintervalle(valeur) + + def GetMultiplicite(self): + """ A préciser. + Retourne la multiplicité des valeurs affectées à l'objet + représenté par l'item. Pour le moment retourne invariablement 1. + """ + return 1 + + def GetType(self): + """ + Retourne le type de valeur attendu par l'objet représenté par l'item. + """ + return self.object.get_type() + + def GetIntervalle(self): + """ + Retourne le domaine de valeur attendu par l'objet représenté + par l'item. + """ + return self.object.getintervalle() + + def IsInIntervalle(self,valeur): + """ + Retourne 1 si la valeur est dans l'intervalle permis par + l'objet représenté par l'item. + """ + return self.object.isinintervalle(valeur) def set_valeur_co(self,nom_co): """ Affecte au MCS pointé par self l'objet de type CO et de nom nom_co """ - self.object.set_valeur_co(nom_co) + return self.object.set_valeur_co(nom_co) def get_sd_avant_du_bon_type(self): """ Retourne la liste des noms des SD présentes avant l'étape qui contient le MCS pointé par self et du type requis par ce MCS """ - return self.object.jdc.get_sd_avant_du_bon_type(self.object.etape,self.object.definition.type) + return self.object.etape.parent.get_sd_avant_du_bon_type(self.object.etape, + self.object.definition.type) def GetListeValeurs(self) : """ Retourne la liste des valeurs de object """ @@ -1272,6 +1389,34 @@ class SIMPTreeItem(Objecttreeitem.AtomicObjectTreeItem): - retourne 'valeur' (chaîne de caractères) sinon """ return self.object.eval_valeur(valeur) + def is_CO(self,valeur=None): + """ + Indique si valeur est un concept produit de la macro + Cette méthode n'a de sens que pour un MCSIMP d'une MACRO + Si valeur vaut None on teste la valeur du mot cle + """ + # Pour savoir si un concept est un nouveau concept de macro + # on regarde s'il est présent dans l'attribut sdprods de l'étape + # ou si son nom de classe est CO. + # Il faut faire les 2 tests car une macro non valide peut etre + # dans un etat pas tres catholique avec des CO pas encore types + # et donc pas dans sdprods (resultat d'une exception dans type_sdprod) + if not valeur:valeur=self.object.valeur + if valeur in self.object.etape.sdprods:return 1 + if type(valeur) is not types.ClassType:return 0 + if valeur.__class__.__name__ == 'CO':return 1 + return 0 + + def delete_valeur_co(self,valeur=None): + """ + Supprime la valeur du mot cle (de type CO) + il faut propager la destruction aux autres etapes + """ + if not valeur : valeur=self.object.valeur + # XXX faut il vraiment appeler del_sdprod ??? + #self.object.etape.parent.del_sdprod(valeur) + self.object.etape.parent.delete_concept(valeur) + import Accas treeitem = SIMPTreeItem objet = Accas.MCSIMP diff --git a/Editeur/configuration.py b/Editeur/configuration.py index 7a191d57..703ec6d4 100644 --- a/Editeur/configuration.py +++ b/Editeur/configuration.py @@ -1,3 +1,22 @@ +# CONFIGURATION MANAGEMENT OF EDF VERSION +# ====================================================================== +# COPYRIGHT (C) 1991 - 2002 EDF R&D WWW.CODE-ASTER.ORG +# THIS PROGRAM IS FREE SOFTWARE; YOU CAN REDISTRIBUTE IT AND/OR MODIFY +# IT UNDER THE TERMS OF THE GNU GENERAL PUBLIC LICENSE AS PUBLISHED BY +# THE FREE SOFTWARE FOUNDATION; EITHER VERSION 2 OF THE LICENSE, OR +# (AT YOUR OPTION) ANY LATER VERSION. +# +# THIS PROGRAM IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL, BUT +# WITHOUT ANY WARRANTY; WITHOUT EVEN THE IMPLIED WARRANTY OF +# MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. SEE THE GNU +# GENERAL PUBLIC LICENSE FOR MORE DETAILS. +# +# YOU SHOULD HAVE RECEIVED A COPY OF THE GNU GENERAL PUBLIC LICENSE +# ALONG WITH THIS PROGRAM; IF NOT, WRITE TO EDF R&D CODE_ASTER, +# 1 AVENUE DU GENERAL DE GAULLE, 92141 CLAMART CEDEX, FRANCE. +# +# +# ====================================================================== """ Ce module sert pour charger les paramètres de configuration d'EFICAS """ @@ -55,8 +74,9 @@ class CONFIG: print string.join(l[2:]) sys.exit() for attr in self.l_nom_param: - nom_attr,statut = attr - valeur = d.get(nom_attr,None) + nom_attr,statut,defaut = attr + #valeur = d.get(nom_attr,None) + valeur = d.get(nom_attr,defaut) if not valeur and statut=='o': showerror("Erreur","Une erreur s'est produite dans la relecture du fichier de configuration : " + self.fic_ini+"\n EFICAS va vous demander les nouveaux paramètres") @@ -81,7 +101,7 @@ class CONFIG: traceback.print_exc() return for attr in self.l_nom_param: - nom_attr,statut = attr + nom_attr,statut,defaut = attr valeur = d.get(nom_attr,None) if valeur : setattr(self,nom_attr,valeur) @@ -94,6 +114,14 @@ class CONFIG: (label,nature,nom_var,defaut) """ self.l_param=[] + # répertoire initial pour OPEN/SAVE des fichiers de commande + # Par defaut, EFICAS utilise le repertoire utilisateur $HOME/Eficas_install + # Il est possible de specifier dans editeur.ini ou eficas.ini un autre chemin + # Ce peut etre un chemin absolu ou le repertoire courant (os.curdir) + if hasattr(self,'initialdir'): + self.l_param.append(("Répertoire initial pour Open/save des fichiers de commande",'rep','initialdir',self.initialdir)) + else: + self.l_param.append(("Répertoire initial pour Open/save des fichiers de commande",'rep','initialdir',self.rep_user)) # répertoire de travail if hasattr(self,'rep_travail'): self.l_param.append(("Répertoire de travail",'rep','rep_travail',self.rep_travail)) @@ -135,11 +163,10 @@ class CONFIG: self.l_nom_param=[] statut='o' for tup in self.l_param: - #self.l_nom_param.append((tup[2],statut)) if tup[1] == 'YesNo': # les paramètres suivant tup sont facultatifs ... statut='f' - self.l_nom_param.append((tup[2],statut)) + self.l_nom_param.append((tup[2],statut,tup[3])) # nom,statut,defaut def affichage_fichier_ini(self): """ diff --git a/Editeur/definition_cata.py b/Editeur/definition_cata.py index d4842980..eeed1410 100644 --- a/Editeur/definition_cata.py +++ b/Editeur/definition_cata.py @@ -1,9 +1,21 @@ -#@ MODIF definition_cata Accas DATE 02/07/2001 AUTEUR D6BHHJP J.P.LEFEBVRE # CONFIGURATION MANAGEMENT OF EDF VERSION # ====================================================================== -# COPYRIGHT (C) 1991 - 2001 EDF R&D WWW.CODE-ASTER.ORG -# SEE THE FILE "LICENSE.TERMS" FOR INFORMATION ON USAGE AND -# REDISTRIBUTION OF THIS FILE. +# COPYRIGHT (C) 1991 - 2002 EDF R&D WWW.CODE-ASTER.ORG +# THIS PROGRAM IS FREE SOFTWARE; YOU CAN REDISTRIBUTE IT AND/OR MODIFY +# IT UNDER THE TERMS OF THE GNU GENERAL PUBLIC LICENSE AS PUBLISHED BY +# THE FREE SOFTWARE FOUNDATION; EITHER VERSION 2 OF THE LICENSE, OR +# (AT YOUR OPTION) ANY LATER VERSION. +# +# THIS PROGRAM IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL, BUT +# WITHOUT ANY WARRANTY; WITHOUT EVEN THE IMPLIED WARRANTY OF +# MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. SEE THE GNU +# GENERAL PUBLIC LICENSE FOR MORE DETAILS. +# +# YOU SHOULD HAVE RECEIVED A COPY OF THE GNU GENERAL PUBLIC LICENSE +# ALONG WITH THIS PROGRAM; IF NOT, WRITE TO EDF R&D CODE_ASTER, +# 1 AVENUE DU GENERAL DE GAULLE, 92141 CLAMART CEDEX, FRANCE. +# +# # ====================================================================== # Modules Python import types diff --git a/Editeur/eficas.py b/Editeur/eficas.py index c1d683c1..14419aae 100644 --- a/Editeur/eficas.py +++ b/Editeur/eficas.py @@ -1,3 +1,22 @@ +# CONFIGURATION MANAGEMENT OF EDF VERSION +# ====================================================================== +# COPYRIGHT (C) 1991 - 2002 EDF R&D WWW.CODE-ASTER.ORG +# THIS PROGRAM IS FREE SOFTWARE; YOU CAN REDISTRIBUTE IT AND/OR MODIFY +# IT UNDER THE TERMS OF THE GNU GENERAL PUBLIC LICENSE AS PUBLISHED BY +# THE FREE SOFTWARE FOUNDATION; EITHER VERSION 2 OF THE LICENSE, OR +# (AT YOUR OPTION) ANY LATER VERSION. +# +# THIS PROGRAM IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL, BUT +# WITHOUT ANY WARRANTY; WITHOUT EVEN THE IMPLIED WARRANTY OF +# MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. SEE THE GNU +# GENERAL PUBLIC LICENSE FOR MORE DETAILS. +# +# YOU SHOULD HAVE RECEIVED A COPY OF THE GNU GENERAL PUBLIC LICENSE +# ALONG WITH THIS PROGRAM; IF NOT, WRITE TO EDF R&D CODE_ASTER, +# 1 AVENUE DU GENERAL DE GAULLE, 92141 CLAMART CEDEX, FRANCE. +# +# +# ====================================================================== """ Ce module contient la classe EFICAS qui est l'application proprement dite. Elle est dérivée de la classe APPLI @@ -17,7 +36,10 @@ from widgets import Fenetre class EFICAS(appli.APPLI): - extensions=['readercata','bureau','browser','options'] + try: + from prefs import appli_composants + except: + appli_composants=['readercata','bureau','browser','options'] def get_texte_infos(self): texte=appli.APPLI.get_texte_infos(self) diff --git a/Editeur/eficas_go.py b/Editeur/eficas_go.py index 71f4bd09..3f4df08b 100644 --- a/Editeur/eficas_go.py +++ b/Editeur/eficas_go.py @@ -1,3 +1,22 @@ +# CONFIGURATION MANAGEMENT OF EDF VERSION +# ====================================================================== +# COPYRIGHT (C) 1991 - 2002 EDF R&D WWW.CODE-ASTER.ORG +# THIS PROGRAM IS FREE SOFTWARE; YOU CAN REDISTRIBUTE IT AND/OR MODIFY +# IT UNDER THE TERMS OF THE GNU GENERAL PUBLIC LICENSE AS PUBLISHED BY +# THE FREE SOFTWARE FOUNDATION; EITHER VERSION 2 OF THE LICENSE, OR +# (AT YOUR OPTION) ANY LATER VERSION. +# +# THIS PROGRAM IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL, BUT +# WITHOUT ANY WARRANTY; WITHOUT EVEN THE IMPLIED WARRANTY OF +# MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. SEE THE GNU +# GENERAL PUBLIC LICENSE FOR MORE DETAILS. +# +# YOU SHOULD HAVE RECEIVED A COPY OF THE GNU GENERAL PUBLIC LICENSE +# ALONG WITH THIS PROGRAM; IF NOT, WRITE TO EDF R&D CODE_ASTER, +# 1 AVENUE DU GENERAL DE GAULLE, 92141 CLAMART CEDEX, FRANCE. +# +# +# ====================================================================== """ Ce module permet de lancer l'application EFICAS en affichant un ecran Splash pour faire patentier l'utilisateur diff --git a/Editeur/faq.py b/Editeur/faq.py index 8caa7ef9..d480fe22 100644 --- a/Editeur/faq.py +++ b/Editeur/faq.py @@ -1,3 +1,22 @@ +# CONFIGURATION MANAGEMENT OF EDF VERSION +# ====================================================================== +# COPYRIGHT (C) 1991 - 2002 EDF R&D WWW.CODE-ASTER.ORG +# THIS PROGRAM IS FREE SOFTWARE; YOU CAN REDISTRIBUTE IT AND/OR MODIFY +# IT UNDER THE TERMS OF THE GNU GENERAL PUBLIC LICENSE AS PUBLISHED BY +# THE FREE SOFTWARE FOUNDATION; EITHER VERSION 2 OF THE LICENSE, OR +# (AT YOUR OPTION) ANY LATER VERSION. +# +# THIS PROGRAM IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL, BUT +# WITHOUT ANY WARRANTY; WITHOUT EVEN THE IMPLIED WARRANTY OF +# MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. SEE THE GNU +# GENERAL PUBLIC LICENSE FOR MORE DETAILS. +# +# YOU SHOULD HAVE RECEIVED A COPY OF THE GNU GENERAL PUBLIC LICENSE +# ALONG WITH THIS PROGRAM; IF NOT, WRITE TO EDF R&D CODE_ASTER, +# 1 AVENUE DU GENERAL DE GAULLE, 92141 CLAMART CEDEX, FRANCE. +# +# +# ====================================================================== """ Ce module sert a afficher le texte du FAQ EFICAS et à attendre l'acquittement par l'utilisateur diff --git a/Editeur/fenetre_mc_inconnus.py b/Editeur/fenetre_mc_inconnus.py index 113ec4e4..e2b4cf78 100644 --- a/Editeur/fenetre_mc_inconnus.py +++ b/Editeur/fenetre_mc_inconnus.py @@ -1,3 +1,22 @@ +# CONFIGURATION MANAGEMENT OF EDF VERSION +# ====================================================================== +# COPYRIGHT (C) 1991 - 2002 EDF R&D WWW.CODE-ASTER.ORG +# THIS PROGRAM IS FREE SOFTWARE; YOU CAN REDISTRIBUTE IT AND/OR MODIFY +# IT UNDER THE TERMS OF THE GNU GENERAL PUBLIC LICENSE AS PUBLISHED BY +# THE FREE SOFTWARE FOUNDATION; EITHER VERSION 2 OF THE LICENSE, OR +# (AT YOUR OPTION) ANY LATER VERSION. +# +# THIS PROGRAM IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL, BUT +# WITHOUT ANY WARRANTY; WITHOUT EVEN THE IMPLIED WARRANTY OF +# MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. SEE THE GNU +# GENERAL PUBLIC LICENSE FOR MORE DETAILS. +# +# YOU SHOULD HAVE RECEIVED A COPY OF THE GNU GENERAL PUBLIC LICENSE +# ALONG WITH THIS PROGRAM; IF NOT, WRITE TO EDF R&D CODE_ASTER, +# 1 AVENUE DU GENERAL DE GAULLE, 92141 CLAMART CEDEX, FRANCE. +# +# +# ====================================================================== """ """ # Modules Python @@ -46,17 +65,13 @@ class fenetre_mc_inconnus : self.frame1.place(relx=0,rely=0,relheight=0.2,relwidth=1) self.frame2.place(relx=0,rely=0.2,relheight=0.6,relwidth=1) self.frame3.place(relx=0,rely=0.8,relheight=0.2,relwidth=1) - self.frame21 = Frame(self.frame2) - self.frame22 = Frame(self.frame2) - self.frame21.place(relx=0,rely=0,relwidth=0.6,relheight=1) - self.frame22.place(relx=0.6,rely=0,relwidth=0.4,relheight=1) def init_label(self): """ Affichage du label dans la zone concernée """ txt = " Un ou plusieurs mots-clés inconnus ont été trouvés dans le fichier de commandes." - txt = txt + "En cliquant sur leur nom, vous pourrez soit corriger l'orthographe soit supprimer ce mot-clé" + #txt = txt + "En cliquant sur leur nom, vous pourrez soit corriger l'orthographe soit supprimer ce mot-clé" self.fenetre.update_idletasks() Label(self.frame1, text = txt, @@ -68,19 +83,24 @@ class fenetre_mc_inconnus : """ Affiche les mots-clés à modifier ou supprimer """ + i=0 + self.widgets=[] for mc in self.l_mc : # mc est une liste : # mc contient comme premiers arguments l'étape et éventuellement les blocs, mcfact ... # et contient comme 2 derniers éléments le nom du mot-clé et sa valeur path_mc = self.get_path(mc[0:-2]) nom_mc = mc[-2] - Label(self.frame21,text = path_mc).pack(side='left') - e = Entry(self.frame22) - e.pack(side='left') + lab=Label(self.frame2,text = path_mc) + lab.grid(row=i,column=1,sticky=W) + e = Entry(self.frame2) + e.grid(row=i,column=0,sticky=W) e.insert(END,nom_mc) - e.bind("",lambda event,en=e,m=mc,s=self : s.select_mc(m,en)) - e.bind("",lambda e,s=self : s.modifie_mc()) + #e.bind("",lambda event,en=e,m=mc,s=self : s.select_mc(m,en)) + #e.bind("",lambda e,s=self : s.modifie_mc()) e.configure(relief='flat',state='disabled') + self.widgets.append((e,lab)) + i=i+1 def init_boutons(self): """ @@ -100,9 +120,10 @@ class fenetre_mc_inconnus : self.b_quit = Button(self.frame3, text = "Fermer", command = self.quit) - self.b_mod.place(relx=0.25,rely=0.5,anchor='center') - self.b_sup.place(relx=0.50,rely=0.5,anchor='center') - self.b_quit.place(relx=0.75,rely=0.5,anchor='center') + #self.b_mod.place(relx=0.25,rely=0.5,anchor='center') + #self.b_sup.place(relx=0.50,rely=0.5,anchor='center') + #self.b_quit.place(relx=0.75,rely=0.5,anchor='center') + self.b_quit.place(relx=0.50,rely=0.5,anchor='center') def wait_new_list(self): """ @@ -120,7 +141,6 @@ class fenetre_mc_inconnus : """ txt = '' for o in l_o : - print o txt = txt + o.nom+'/' # on enlève le dernier slash en trop txt = txt[0:-1] @@ -156,6 +176,9 @@ class fenetre_mc_inconnus : """ index = self.l_mc.index(self.mc_courant) self.new_l_mc[index] = None + e,lab=self.widgets[index] + e.grid_remove() + lab.grid_remove() self.desactive_boutons() self.desactive_entry() diff --git a/Editeur/fontes.py b/Editeur/fontes.py index 013f6d2e..997e77fe 100644 --- a/Editeur/fontes.py +++ b/Editeur/fontes.py @@ -1,3 +1,22 @@ +# CONFIGURATION MANAGEMENT OF EDF VERSION +# ====================================================================== +# COPYRIGHT (C) 1991 - 2002 EDF R&D WWW.CODE-ASTER.ORG +# THIS PROGRAM IS FREE SOFTWARE; YOU CAN REDISTRIBUTE IT AND/OR MODIFY +# IT UNDER THE TERMS OF THE GNU GENERAL PUBLIC LICENSE AS PUBLISHED BY +# THE FREE SOFTWARE FOUNDATION; EITHER VERSION 2 OF THE LICENSE, OR +# (AT YOUR OPTION) ANY LATER VERSION. +# +# THIS PROGRAM IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL, BUT +# WITHOUT ANY WARRANTY; WITHOUT EVEN THE IMPLIED WARRANTY OF +# MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. SEE THE GNU +# GENERAL PUBLIC LICENSE FOR MORE DETAILS. +# +# YOU SHOULD HAVE RECEIVED A COPY OF THE GNU GENERAL PUBLIC LICENSE +# ALONG WITH THIS PROGRAM; IF NOT, WRITE TO EDF R&D CODE_ASTER, +# 1 AVENUE DU GENERAL DE GAULLE, 92141 CLAMART CEDEX, FRANCE. +# +# +# ====================================================================== standard = ("Times",10) standard_italique = ("Times",10,'italic') standard_gras = ("Times",10,'bold') diff --git a/Editeur/images.py b/Editeur/images.py index 31f8e2e2..e586d5ba 100644 --- a/Editeur/images.py +++ b/Editeur/images.py @@ -1,3 +1,22 @@ +# CONFIGURATION MANAGEMENT OF EDF VERSION +# ====================================================================== +# COPYRIGHT (C) 1991 - 2002 EDF R&D WWW.CODE-ASTER.ORG +# THIS PROGRAM IS FREE SOFTWARE; YOU CAN REDISTRIBUTE IT AND/OR MODIFY +# IT UNDER THE TERMS OF THE GNU GENERAL PUBLIC LICENSE AS PUBLISHED BY +# THE FREE SOFTWARE FOUNDATION; EITHER VERSION 2 OF THE LICENSE, OR +# (AT YOUR OPTION) ANY LATER VERSION. +# +# THIS PROGRAM IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL, BUT +# WITHOUT ANY WARRANTY; WITHOUT EVEN THE IMPLIED WARRANTY OF +# MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. SEE THE GNU +# GENERAL PUBLIC LICENSE FOR MORE DETAILS. +# +# YOU SHOULD HAVE RECEIVED A COPY OF THE GNU GENERAL PUBLIC LICENSE +# ALONG WITH THIS PROGRAM; IF NOT, WRITE TO EDF R&D CODE_ASTER, +# 1 AVENUE DU GENERAL DE GAULLE, 92141 CLAMART CEDEX, FRANCE. +# +# +# ====================================================================== """ Ce module joue le role de cache pour les images stockées dans le repertoire ICONDIR diff --git a/Editeur/import_code.py b/Editeur/import_code.py index 1152f1b7..4d05e343 100644 --- a/Editeur/import_code.py +++ b/Editeur/import_code.py @@ -1,3 +1,22 @@ +# CONFIGURATION MANAGEMENT OF EDF VERSION +# ====================================================================== +# COPYRIGHT (C) 1991 - 2002 EDF R&D WWW.CODE-ASTER.ORG +# THIS PROGRAM IS FREE SOFTWARE; YOU CAN REDISTRIBUTE IT AND/OR MODIFY +# IT UNDER THE TERMS OF THE GNU GENERAL PUBLIC LICENSE AS PUBLISHED BY +# THE FREE SOFTWARE FOUNDATION; EITHER VERSION 2 OF THE LICENSE, OR +# (AT YOUR OPTION) ANY LATER VERSION. +# +# THIS PROGRAM IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL, BUT +# WITHOUT ANY WARRANTY; WITHOUT EVEN THE IMPLIED WARRANTY OF +# MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. SEE THE GNU +# GENERAL PUBLIC LICENSE FOR MORE DETAILS. +# +# YOU SHOULD HAVE RECEIVED A COPY OF THE GNU GENERAL PUBLIC LICENSE +# ALONG WITH THIS PROGRAM; IF NOT, WRITE TO EDF R&D CODE_ASTER, +# 1 AVENUE DU GENERAL DE GAULLE, 92141 CLAMART CEDEX, FRANCE. +# +# +# ====================================================================== """ Ce module réalise toutes les mises à jour du chemin pour les imports de modules Python diff --git a/Editeur/jdcdisplay.py b/Editeur/jdcdisplay.py index d85ab06a..0dba7773 100644 --- a/Editeur/jdcdisplay.py +++ b/Editeur/jdcdisplay.py @@ -1,3 +1,22 @@ +# CONFIGURATION MANAGEMENT OF EDF VERSION +# ====================================================================== +# COPYRIGHT (C) 1991 - 2002 EDF R&D WWW.CODE-ASTER.ORG +# THIS PROGRAM IS FREE SOFTWARE; YOU CAN REDISTRIBUTE IT AND/OR MODIFY +# IT UNDER THE TERMS OF THE GNU GENERAL PUBLIC LICENSE AS PUBLISHED BY +# THE FREE SOFTWARE FOUNDATION; EITHER VERSION 2 OF THE LICENSE, OR +# (AT YOUR OPTION) ANY LATER VERSION. +# +# THIS PROGRAM IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL, BUT +# WITHOUT ANY WARRANTY; WITHOUT EVEN THE IMPLIED WARRANTY OF +# MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. SEE THE GNU +# GENERAL PUBLIC LICENSE FOR MORE DETAILS. +# +# YOU SHOULD HAVE RECEIVED A COPY OF THE GNU GENERAL PUBLIC LICENSE +# ALONG WITH THIS PROGRAM; IF NOT, WRITE TO EDF R&D CODE_ASTER, +# 1 AVENUE DU GENERAL DE GAULLE, 92141 CLAMART CEDEX, FRANCE. +# +# +# ====================================================================== """ Ce module contient la classe JDCDISPLAY qui réalise l'affichage du jeu de commandes sous la forme d'un arbre et de panneaux qui portent @@ -25,6 +44,7 @@ class JDCDISPLAY: self.jdc=jdc self.nom_jdc=nom_jdc self.fichier=None + self.panel_courant=None if not appli: class Appli: @@ -52,8 +72,8 @@ class JDCDISPLAY: self.modified='n' self.pane=Pmw.PanedWidget(self.parent,orient='horizontal') - self.pane.add('treebrowser',min=0.5) - self.pane.add('selected',min=0.5) + self.pane.add('treebrowser',min=0.4) + self.pane.add('selected',min=0.4) self.pane.pack(expand=1,fill='both') self.tree=TREEITEMINCANVAS(jdc,nom_jdc,self.pane.pane('treebrowser'), self.appli,self.select_node) @@ -78,13 +98,32 @@ class JDCDISPLAY: Lance la génération du panneau contextuel de l'objet sélectionné dans l'arbre """ + if self.panel_courant: + # On detruit le panneau + self.panel_courant.destroy() + o=self.panel_courant + self.panel_courant=None + # Mettre à 1 pour verifier les cycles entre objets + # pour les panneaux + withCyclops=0 + if withCyclops: + from Misc import Cyclops + z = Cyclops.CycleFinder() + z.register(o) + del o + z.find_cycles() + z.show_stats() + z.show_cycles() + + if node.item.isactif(): if hasattr(node.item,"panel"): - return node.item.panel(self,self.pane.pane('selected'),node) + self.panel_courant=node.item.panel(self,self.pane.pane('selected'),node) else: raise Exception("Le noeud sélectionné n'a pas de panel associé") else: - return panels.Panel_Inactif(self,self.pane.pane('selected'),node) + self.panel_courant = panels.Panel_Inactif(self,self.pane.pane('selected'),node) + return self.panel_courant def init_modif(self): """ @@ -148,7 +187,7 @@ class JDCDISPLAY: Ne permet que la copie d'objets de type Commande ou MCF """ objet_a_copier = self.appli.noeud_a_editer.item.get_copie_objet() - if objet_a_copier.__class__.__name__ in ('ETAPE','PROC_ETAPE','MACRO_ETAPE'): + if objet_a_copier.__class__.__name__ in ('ETAPE','PROC_ETAPE','MACRO_ETAPE','FORM_ETAPE'): self.doPaste_Commande(objet_a_copier) elif objet_a_copier.__class__.__name__ == "MCFACT": self.doPaste_MCF(objet_a_copier) @@ -159,14 +198,16 @@ class JDCDISPLAY: def doPaste_Commande(self,objet_a_copier): """ - Réalise la copie de l'objet passé en argument qui est nécessairement une commande + Réalise la copie de l'objet passé en argument qui est nécessairement + une commande """ # il faut vérifier que le noeud sélectionné (noeud courant) est bien # une commande ou un JDC sinon la copie est impossible ... if self.node_selected.item.isCommande() : child = self.node_selected.append_brother(objet_a_copier,retour='oui') elif self.node_selected.item.isJdc() : - child = self.node_selected.append_child(objet_a_copier,retour='oui') + child = self.node_selected.append_child(objet_a_copier,pos='first', + retour='oui') else: showinfo("Copie impossible", "Vous ne pouvez coller la commande copiée à ce niveau de l'arborescence !") @@ -195,10 +236,17 @@ class JDCDISPLAY: child = self.node_selected.append_child(objet_a_copier,retour='oui') elif self.node_selected.item.isMCList() : # le noeud courant est une MCList - child = self.node_selected.parent.append_child(objet_a_copier,retour='oui') + child = self.node_selected.parent.append_child(objet_a_copier,pos='first',retour='oui') elif self.node_selected.item.isMCFact(): # le noeud courant est un MCFACT - child = self.node_selected.parent.append_child(objet_a_copier,retour='oui') + if self.node_selected.parent.item.isMCList(): + # le noeud selectionne est un MCFACT dans une MCList + child = self.node_selected.parent.append_child(objet_a_copier, + pos=self.node_selected.item, + retour='oui') + else: + # le noeud MCFACT selectionne n'est pas dans une MCList + child = self.node_selected.parent.append_child(objet_a_copier,retour='oui') else: showinfo("Copie impossible", "Vous ne pouvez coller le mot-clé facteur copié à ce niveau de l'arborescence !") diff --git a/Editeur/menubar.py b/Editeur/menubar.py index ad2366e8..89c74406 100644 --- a/Editeur/menubar.py +++ b/Editeur/menubar.py @@ -1,3 +1,22 @@ +# CONFIGURATION MANAGEMENT OF EDF VERSION +# ====================================================================== +# COPYRIGHT (C) 1991 - 2002 EDF R&D WWW.CODE-ASTER.ORG +# THIS PROGRAM IS FREE SOFTWARE; YOU CAN REDISTRIBUTE IT AND/OR MODIFY +# IT UNDER THE TERMS OF THE GNU GENERAL PUBLIC LICENSE AS PUBLISHED BY +# THE FREE SOFTWARE FOUNDATION; EITHER VERSION 2 OF THE LICENSE, OR +# (AT YOUR OPTION) ANY LATER VERSION. +# +# THIS PROGRAM IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL, BUT +# WITHOUT ANY WARRANTY; WITHOUT EVEN THE IMPLIED WARRANTY OF +# MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. SEE THE GNU +# GENERAL PUBLIC LICENSE FOR MORE DETAILS. +# +# YOU SHOULD HAVE RECEIVED A COPY OF THE GNU GENERAL PUBLIC LICENSE +# ALONG WITH THIS PROGRAM; IF NOT, WRITE TO EDF R&D CODE_ASTER, +# 1 AVENUE DU GENERAL DE GAULLE, 92141 CLAMART CEDEX, FRANCE. +# +# +# ====================================================================== """ """ from Tkinter import Menu @@ -12,7 +31,10 @@ class MENUBAR: self.parent.configure(menu=self.menubar) self.init() - labels= ('Fichier','Edition','Jeu de commandes','Catalogue','Browsers','Options') + try: + from prefs import labels + except: + labels= ('Fichier','Edition','Jeu de commandes','Catalogue','Browsers','Options') def init(self): self.menudict={} @@ -21,11 +43,3 @@ class MENUBAR: self.menudict[label]=menu self.menubar.add_cascade(label=label,menu=menu) - #self.optionmenu.add_command(label='Catalogue développeur',command=self.choix_cata_developpeur) - - #self.browsermenu.add_command(label='Browser catalogue',command = self.browser_catalogue) - #self.browsermenu.add_command(label='Shell',command = self.shell) - #self.browsermenu.add_command(label='Editeur catalogue',command = self.edite_catalogue) - - - diff --git a/Editeur/options.py b/Editeur/options.py index 0101dd05..d08c6c2e 100644 --- a/Editeur/options.py +++ b/Editeur/options.py @@ -1,3 +1,22 @@ +# CONFIGURATION MANAGEMENT OF EDF VERSION +# ====================================================================== +# COPYRIGHT (C) 1991 - 2002 EDF R&D WWW.CODE-ASTER.ORG +# THIS PROGRAM IS FREE SOFTWARE; YOU CAN REDISTRIBUTE IT AND/OR MODIFY +# IT UNDER THE TERMS OF THE GNU GENERAL PUBLIC LICENSE AS PUBLISHED BY +# THE FREE SOFTWARE FOUNDATION; EITHER VERSION 2 OF THE LICENSE, OR +# (AT YOUR OPTION) ANY LATER VERSION. +# +# THIS PROGRAM IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL, BUT +# WITHOUT ANY WARRANTY; WITHOUT EVEN THE IMPLIED WARRANTY OF +# MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. SEE THE GNU +# GENERAL PUBLIC LICENSE FOR MORE DETAILS. +# +# YOU SHOULD HAVE RECEIVED A COPY OF THE GNU GENERAL PUBLIC LICENSE +# ALONG WITH THIS PROGRAM; IF NOT, WRITE TO EDF R&D CODE_ASTER, +# 1 AVENUE DU GENERAL DE GAULLE, 92141 CLAMART CEDEX, FRANCE. +# +# +# ====================================================================== """ """ # Modules Python diff --git a/Editeur/panels.py b/Editeur/panels.py index 8338308a..5999c6c9 100644 --- a/Editeur/panels.py +++ b/Editeur/panels.py @@ -1,9 +1,21 @@ -#@ MODIF panels Editeur DATE 02/07/2001 AUTEUR D6BHHJP J.P.LEFEBVRE # CONFIGURATION MANAGEMENT OF EDF VERSION # ====================================================================== -# COPYRIGHT (C) 1991 - 2001 EDF R&D WWW.CODE-ASTER.ORG -# SEE THE FILE "LICENSE.TERMS" FOR INFORMATION ON USAGE AND -# REDISTRIBUTION OF THIS FILE. +# COPYRIGHT (C) 1991 - 2002 EDF R&D WWW.CODE-ASTER.ORG +# THIS PROGRAM IS FREE SOFTWARE; YOU CAN REDISTRIBUTE IT AND/OR MODIFY +# IT UNDER THE TERMS OF THE GNU GENERAL PUBLIC LICENSE AS PUBLISHED BY +# THE FREE SOFTWARE FOUNDATION; EITHER VERSION 2 OF THE LICENSE, OR +# (AT YOUR OPTION) ANY LATER VERSION. +# +# THIS PROGRAM IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL, BUT +# WITHOUT ANY WARRANTY; WITHOUT EVEN THE IMPLIED WARRANTY OF +# MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. SEE THE GNU +# GENERAL PUBLIC LICENSE FOR MORE DETAILS. +# +# YOU SHOULD HAVE RECEIVED A COPY OF THE GNU GENERAL PUBLIC LICENSE +# ALONG WITH THIS PROGRAM; IF NOT, WRITE TO EDF R&D CODE_ASTER, +# 1 AVENUE DU GENERAL DE GAULLE, 92141 CLAMART CEDEX, FRANCE. +# +# # ====================================================================== import string import os @@ -29,6 +41,32 @@ class Panel(Frame) : self.creer_boutons() self.init() + def destroy(self): + Frame.destroy(self) + self.panneau=None + self.parent=None + # Because on herite de Frame + self.master=None + # On supprime explicitement les references aux objets Tk + self.nb=None + self.fr_but=None + self.bouton_cata=None + self.bouton_doc=None + self.bouton_com=None + self.bouton_sup=None + self.frame_eval=None + self.label=None + self.frame_boutons=None + self.frame_comment=None + self.frame_param=None + # On termine la suppression de facon brutale (objets Tk et non Tk) + for k in self.__dict__.keys(): + # il est plus prudent de ne pas détruire le lien sur le Node + # si on voulait mettre l'attribut node à None, il faudrait + # que tous les appels à node.parent.select() apparaissent après + # toutes les autres actions liées au panel (node.item.isglobal(), ...) + if k != 'node' : setattr(self,k,None) + def creer_boutons(self): """ Méthode créant les boutons se trouvant dans la partie contextuelle d'EFICAS @@ -152,7 +190,6 @@ class Panel(Frame) : if self.parent.modified == 'n' : self.parent.init_modif() pere = self.node.parent self.node.delete() - pere.select() def affiche(self): """ Force l'affichage des fenêtres en cours """ diff --git a/Editeur/readercata.py b/Editeur/readercata.py index 47667a09..81423762 100644 --- a/Editeur/readercata.py +++ b/Editeur/readercata.py @@ -1,9 +1,29 @@ +# CONFIGURATION MANAGEMENT OF EDF VERSION +# ====================================================================== +# COPYRIGHT (C) 1991 - 2002 EDF R&D WWW.CODE-ASTER.ORG +# THIS PROGRAM IS FREE SOFTWARE; YOU CAN REDISTRIBUTE IT AND/OR MODIFY +# IT UNDER THE TERMS OF THE GNU GENERAL PUBLIC LICENSE AS PUBLISHED BY +# THE FREE SOFTWARE FOUNDATION; EITHER VERSION 2 OF THE LICENSE, OR +# (AT YOUR OPTION) ANY LATER VERSION. +# +# THIS PROGRAM IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL, BUT +# WITHOUT ANY WARRANTY; WITHOUT EVEN THE IMPLIED WARRANTY OF +# MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. SEE THE GNU +# GENERAL PUBLIC LICENSE FOR MORE DETAILS. +# +# YOU SHOULD HAVE RECEIVED A COPY OF THE GNU GENERAL PUBLIC LICENSE +# ALONG WITH THIS PROGRAM; IF NOT, WRITE TO EDF R&D CODE_ASTER, +# 1 AVENUE DU GENERAL DE GAULLE, 92141 CLAMART CEDEX, FRANCE. +# +# +# ====================================================================== """ Ce module sert à lire un catalogue et à construire un objet CataItem pour Eficas. Il s'appuie sur la classe READERCATA """ # Modules Python +import time import os,sys,py_compile import traceback import cPickle @@ -17,6 +37,7 @@ import fontes import analyse_catalogue from Noyau.N_CR import CR from widgets import Fenetre +from utils import init_rep_cata_dev #import catabrowser @@ -77,17 +98,23 @@ class READERCATA: # détermination de fic_cata_c et fic_cata_p self.fic_cata_c = self.fic_cata + 'c' self.fic_cata_p = os.path.splitext(self.fic_cata)[0]+'_pickled.py' + print "Debut compil cata: ",time.clock() # compilation éventuelle du catalogue test = self.compile_cata(self.fic_cata,self.fic_cata_c) + print "Fin compil cata: ",time.clock() if not test : showerror("Compilation catalogue","Impossible de compiler le catalogue %s" %self.fic_cata) # import du catalogue + print "Debut import_cata: ",time.clock() self.cata = self.import_cata(self.fic_cata) + print "Fin import_cata: ",time.clock() if not self.cata : showerror("Import du catalogue","Impossible d'importer le catalogue %s" %self.fic_cata) # analyse du catalogue (ordre des mots-clés) #XXX A priori ceci fait double emploi. Il faut d'abord calculer l'ordre # puis fabriquer le CATAItem #CCAR :self.catalo = catabrowser.CATAItem(self,"Catalogue",self.cata) + print "Debut Retrouve_Ordre: ",time.clock() self.Retrouve_Ordre_Cata_Standard() + print "Fin Retrouve_Ordre: ",time.clock() # chargement et analyse des catalogues développeur (le cas échéant) if self.appli.CONFIGURATION.isdeveloppeur == 'OUI' : init_rep_cata_dev(self.fic_cata,self.appli.CONFIGURATION.path_cata_dev) diff --git a/Editeur/splash.py b/Editeur/splash.py index c3e5339d..3002d375 100644 --- a/Editeur/splash.py +++ b/Editeur/splash.py @@ -1,3 +1,22 @@ +# CONFIGURATION MANAGEMENT OF EDF VERSION +# ====================================================================== +# COPYRIGHT (C) 1991 - 2002 EDF R&D WWW.CODE-ASTER.ORG +# THIS PROGRAM IS FREE SOFTWARE; YOU CAN REDISTRIBUTE IT AND/OR MODIFY +# IT UNDER THE TERMS OF THE GNU GENERAL PUBLIC LICENSE AS PUBLISHED BY +# THE FREE SOFTWARE FOUNDATION; EITHER VERSION 2 OF THE LICENSE, OR +# (AT YOUR OPTION) ANY LATER VERSION. +# +# THIS PROGRAM IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL, BUT +# WITHOUT ANY WARRANTY; WITHOUT EVEN THE IMPLIED WARRANTY OF +# MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. SEE THE GNU +# GENERAL PUBLIC LICENSE FOR MORE DETAILS. +# +# YOU SHOULD HAVE RECEIVED A COPY OF THE GNU GENERAL PUBLIC LICENSE +# ALONG WITH THIS PROGRAM; IF NOT, WRITE TO EDF R&D CODE_ASTER, +# 1 AVENUE DU GENERAL DE GAULLE, 92141 CLAMART CEDEX, FRANCE. +# +# +# ====================================================================== """ Ce module permet de créer, mettre à jour et détruire un écran Splash diff --git a/Editeur/statusbar.py b/Editeur/statusbar.py index 6c0687a1..604025a8 100644 --- a/Editeur/statusbar.py +++ b/Editeur/statusbar.py @@ -1,3 +1,22 @@ +# CONFIGURATION MANAGEMENT OF EDF VERSION +# ====================================================================== +# COPYRIGHT (C) 1991 - 2002 EDF R&D WWW.CODE-ASTER.ORG +# THIS PROGRAM IS FREE SOFTWARE; YOU CAN REDISTRIBUTE IT AND/OR MODIFY +# IT UNDER THE TERMS OF THE GNU GENERAL PUBLIC LICENSE AS PUBLISHED BY +# THE FREE SOFTWARE FOUNDATION; EITHER VERSION 2 OF THE LICENSE, OR +# (AT YOUR OPTION) ANY LATER VERSION. +# +# THIS PROGRAM IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL, BUT +# WITHOUT ANY WARRANTY; WITHOUT EVEN THE IMPLIED WARRANTY OF +# MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. SEE THE GNU +# GENERAL PUBLIC LICENSE FOR MORE DETAILS. +# +# YOU SHOULD HAVE RECEIVED A COPY OF THE GNU GENERAL PUBLIC LICENSE +# ALONG WITH THIS PROGRAM; IF NOT, WRITE TO EDF R&D CODE_ASTER, +# 1 AVENUE DU GENERAL DE GAULLE, 92141 CLAMART CEDEX, FRANCE. +# +# +# ====================================================================== """ """ # Modules Python diff --git a/Editeur/toolbar.py b/Editeur/toolbar.py index e99a56de..938d47fa 100644 --- a/Editeur/toolbar.py +++ b/Editeur/toolbar.py @@ -1,3 +1,22 @@ +# CONFIGURATION MANAGEMENT OF EDF VERSION +# ====================================================================== +# COPYRIGHT (C) 1991 - 2002 EDF R&D WWW.CODE-ASTER.ORG +# THIS PROGRAM IS FREE SOFTWARE; YOU CAN REDISTRIBUTE IT AND/OR MODIFY +# IT UNDER THE TERMS OF THE GNU GENERAL PUBLIC LICENSE AS PUBLISHED BY +# THE FREE SOFTWARE FOUNDATION; EITHER VERSION 2 OF THE LICENSE, OR +# (AT YOUR OPTION) ANY LATER VERSION. +# +# THIS PROGRAM IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL, BUT +# WITHOUT ANY WARRANTY; WITHOUT EVEN THE IMPLIED WARRANTY OF +# MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. SEE THE GNU +# GENERAL PUBLIC LICENSE FOR MORE DETAILS. +# +# YOU SHOULD HAVE RECEIVED A COPY OF THE GNU GENERAL PUBLIC LICENSE +# ALONG WITH THIS PROGRAM; IF NOT, WRITE TO EDF R&D CODE_ASTER, +# 1 AVENUE DU GENERAL DE GAULLE, 92141 CLAMART CEDEX, FRANCE. +# +# +# ====================================================================== """ """ # Modules Python @@ -137,7 +156,7 @@ class TOOLBAR: """ self.fen_infos.destroy() - def creer_boutons_extension(self,l_boutons,extension): + def creer_boutons_appli_composant(self,l_boutons,appli_composant): for bouton in l_boutons : if not bouton : # on veut afficher un bouton vide (=espace entre boutons) @@ -146,7 +165,7 @@ class TOOLBAR: relief = 'flat').pack(side='left') continue nom_fic,commande,texte,statut = bouton - commande=getattr(extension,commande) + commande=getattr(appli_composant,commande) b = Button(self.barreboutons, image = images.get_image(nom_fic), command = commande, diff --git a/Editeur/tooltip.py b/Editeur/tooltip.py index d43992c9..752a57b7 100644 --- a/Editeur/tooltip.py +++ b/Editeur/tooltip.py @@ -1,9 +1,50 @@ +# CONFIGURATION MANAGEMENT OF EDF VERSION +# ====================================================================== +# COPYRIGHT (C) 1991 - 2002 EDF R&D WWW.CODE-ASTER.ORG +# THIS PROGRAM IS FREE SOFTWARE; YOU CAN REDISTRIBUTE IT AND/OR MODIFY +# IT UNDER THE TERMS OF THE GNU GENERAL PUBLIC LICENSE AS PUBLISHED BY +# THE FREE SOFTWARE FOUNDATION; EITHER VERSION 2 OF THE LICENSE, OR +# (AT YOUR OPTION) ANY LATER VERSION. +# +# THIS PROGRAM IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL, BUT +# WITHOUT ANY WARRANTY; WITHOUT EVEN THE IMPLIED WARRANTY OF +# MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. SEE THE GNU +# GENERAL PUBLIC LICENSE FOR MORE DETAILS. +# +# YOU SHOULD HAVE RECEIVED A COPY OF THE GNU GENERAL PUBLIC LICENSE +# ALONG WITH THIS PROGRAM; IF NOT, WRITE TO EDF R&D CODE_ASTER, +# 1 AVENUE DU GENERAL DE GAULLE, 92141 CLAMART CEDEX, FRANCE. +# +# +# ====================================================================== """ Ce module propose la classe TOOLTIP pour mettre en oeuvre les bulles d'aide """ import Tkinter +import types + +def destruct(obj): + # assist in breaking circular references + if obj is not None: + assert type(obj) is types.InstanceType + for k in obj.__dict__.keys(): + obj.__dict__[k] = None + ##del obj.__dict__[k] + +def after(widget, ms, func, *args): + timer = apply(widget.after, (ms, func) + args) + command = widget._tclCommands[-1] + return (timer, command, widget) + +def after_cancel(t): + if t is not None: + t[2].after_cancel(t[0]) + try: + t[2].deletecommand(t[1]) + except Tkinter.TclError: + pass class TOOLTIP: def __init__(self,widget): @@ -76,3 +117,16 @@ class TOOLTIP: self.tooltip.wm_geometry("%+d%+d" % (x, y)) self.tooltip.wm_deiconify() +if __name__ == "__main__": + root=Tkinter.Tk() + + def aide(event): + tp=TOOLTIP(root) + tp.setText("texte d'aide") + tp._showTip() + + label = Tkinter.Label(root, text="coucou") + label.bind("", aide) + label.pack() + root.mainloop() + diff --git a/Editeur/treeitemincanvas.py b/Editeur/treeitemincanvas.py index 5ec26438..2a1c45ac 100644 --- a/Editeur/treeitemincanvas.py +++ b/Editeur/treeitemincanvas.py @@ -1,3 +1,22 @@ +# CONFIGURATION MANAGEMENT OF EDF VERSION +# ====================================================================== +# COPYRIGHT (C) 1991 - 2002 EDF R&D WWW.CODE-ASTER.ORG +# THIS PROGRAM IS FREE SOFTWARE; YOU CAN REDISTRIBUTE IT AND/OR MODIFY +# IT UNDER THE TERMS OF THE GNU GENERAL PUBLIC LICENSE AS PUBLISHED BY +# THE FREE SOFTWARE FOUNDATION; EITHER VERSION 2 OF THE LICENSE, OR +# (AT YOUR OPTION) ANY LATER VERSION. +# +# THIS PROGRAM IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL, BUT +# WITHOUT ANY WARRANTY; WITHOUT EVEN THE IMPLIED WARRANTY OF +# MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. SEE THE GNU +# GENERAL PUBLIC LICENSE FOR MORE DETAILS. +# +# YOU SHOULD HAVE RECEIVED A COPY OF THE GNU GENERAL PUBLIC LICENSE +# ALONG WITH THIS PROGRAM; IF NOT, WRITE TO EDF R&D CODE_ASTER, +# 1 AVENUE DU GENERAL DE GAULLE, 92141 CLAMART CEDEX, FRANCE. +# +# +# ====================================================================== """ """ # Modules Python @@ -25,7 +44,7 @@ class TREEITEMINCANVAS: self.parent=parent self.item=Objecttreeitem.make_objecttreeitem(self.appli,self.nom,self.object) - self.canvas=Pmw.ScrolledCanvas(self.parent,borderframe=1) + self.canvas=Pmw.ScrolledCanvas(self.parent,borderframe=1,canvas_background='gray95') self.canvas.pack(padx=10,pady=10,fill = 'both', expand = 1) if not sel: def sel(event=None): diff --git a/Editeur/treewidget.py b/Editeur/treewidget.py index a0d6554e..60a4c63a 100644 --- a/Editeur/treewidget.py +++ b/Editeur/treewidget.py @@ -1,11 +1,23 @@ -#@ MODIF treewidget Editeur DATE 02/07/2001 AUTEUR D6BHHJP J.P.LEFEBVRE # CONFIGURATION MANAGEMENT OF EDF VERSION # ====================================================================== -# COPYRIGHT (C) 1991 - 2001 EDF R&D WWW.CODE-ASTER.ORG -# SEE THE FILE "LICENSE.TERMS" FOR INFORMATION ON USAGE AND -# REDISTRIBUTION OF THIS FILE. +# COPYRIGHT (C) 1991 - 2002 EDF R&D WWW.CODE-ASTER.ORG +# THIS PROGRAM IS FREE SOFTWARE; YOU CAN REDISTRIBUTE IT AND/OR MODIFY +# IT UNDER THE TERMS OF THE GNU GENERAL PUBLIC LICENSE AS PUBLISHED BY +# THE FREE SOFTWARE FOUNDATION; EITHER VERSION 2 OF THE LICENSE, OR +# (AT YOUR OPTION) ANY LATER VERSION. +# +# THIS PROGRAM IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL, BUT +# WITHOUT ANY WARRANTY; WITHOUT EVEN THE IMPLIED WARRANTY OF +# MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. SEE THE GNU +# GENERAL PUBLIC LICENSE FOR MORE DETAILS. +# +# YOU SHOULD HAVE RECEIVED A COPY OF THE GNU GENERAL PUBLIC LICENSE +# ALONG WITH THIS PROGRAM; IF NOT, WRITE TO EDF R&D CODE_ASTER, +# 1 AVENUE DU GENERAL DE GAULLE, 92141 CLAMART CEDEX, FRANCE. +# +# # ====================================================================== -import os,sys,string,re,types +import os,sys,string,re,types,traceback from Tkinter import * @@ -13,8 +25,8 @@ import fontes import images # -__version__="$Name: V1_1p1 $" -__Id__="$Id: treewidget.py,v 1.1.1.1 2001/12/04 15:38:23 eficas Exp $" +__version__="$Name: $" +__Id__="$Id: treewidget.py,v 1.5 2002/05/15 15:31:59 eficas Exp $" # Fonte_Standard = fontes.standard @@ -330,6 +342,8 @@ class Node : self.dehighlight() self.text_id = self.canvas.create_window(textx, texty,anchor="w", window=self.text) self.id.append(self.text_id) + # Redefinit la region de scroll du canvas pour inclure tous les items créés + self.tree.scrolledcanvas.resizescrollregion() def highlight(self,event=None): """ Met en surbrillance self""" @@ -468,6 +482,7 @@ class Node : try: self.canvas.addtag_overlapping('move',bbox1[0],self.y +10,bbox1[2],bbox1[3]) except: + print "Erreur dans move :" print self print self.item print self.item.object @@ -493,6 +508,7 @@ class Node : try: child.trace_ligne() except: + print "Erreur dans trace_ligne :" print child print child.item.object @@ -521,21 +537,23 @@ class Node : def full_creation(self,name,pos=None): """ - Interface avec ACCAS : création de l'objet de nom name et - du noeud associé. Retourne le noeud fils ainsi créé + Interface avec ACCAS : création de l'objet de nom name et + du noeud associé. Retourne le noeud fils ainsi créé """ item = self.item.additem(name,pos) if item == None or item == 0: # impossible d'ajouter le noeud de nom : name return 0 nature = item.get_nature() - #if nature =="COMMANDE" or nature == "OPERATEUR" or nature == "PROCEDURE": if nature in ("COMMANDE","OPERATEUR","PROCEDURE","COMMENTAIRE", "PARAMETRE","COMMANDE_COMMENTARISEE","PARAMETRE_EVAL"): # on veut ajouter une commande ou un commentaire ou un paramètre # il ne faut pas rechercher un même objet déjà existant # à modifier : il faut tester l'attribut 'repetable' enfant = None + elif self.item.object.isMCList(): + # Dans ce cas on ne fait pas de remplacement. On ne cherche pas un objet de meme nom + enfant=None else : enfant = self.get_node_fils(item.get_nom()) if enfant : @@ -611,6 +629,9 @@ class Node : # on donne la position depuis l'extérieur # (appel de append_child par append_brother par exemple) index = pos + elif type(pos) == types.InstanceType: + # pos est un item. Il faut inserer name apres pos + index = self.item.get_index(pos) +1 else : if type(name) == types.InstanceType: index = self.item.get_index_child(name.nom) @@ -676,6 +697,7 @@ class Node : print 'Erreur dans la destruction de ',self.item.get_nom(),' dans delete' nbnew = pere.get_nb_children() pere.redraw(nbnew-nbold) + pere.select() def copynode(self,node,pos) : """ node est le noeud à copier à la position pos de self ( = parent de node) """ @@ -690,15 +712,16 @@ class Node : try : child.item.object.mc_liste = objet_copie.mc_liste except: - pass + traceback.print_exc() #-------------------------------------------------------------- # Méthodes de vérification du contexte et de validité du noeud #-------------------------------------------------------------- - def traite_mclist(self): + def traite_mclist_OLD(self): """ Dans le cas d'une MCList il faut vérifier qu'elle n'est pas vide ou réduite à un seul élément suite à une destruction """ # self représente une MCList + print "on passe par traite_mclist ",len(self.item) if len(self.item) == 0 : # la liste est vide : il faut la supprimer self.delete() @@ -709,6 +732,8 @@ class Node : noeud = self.children[0] if self.parent.delete_child(self): self.parent.append_node_child(noeud.item,pos=index,verif='non') + else: + print "destruction de self impossible !" #if self.parent.delete_child(self): # self.parent.copynode(self.children[0],index) #else : @@ -716,6 +741,26 @@ class Node : else : return + def traite_mclist(self): + """ Dans le cas d'une MCList il faut vérifier qu'elle n'est pas vide + ou réduite à un seul élément suite à une destruction + """ + # self représente une MCList + if len(self.item) == 0 : + # la liste est vide : il faut la supprimer + self.delete() + elif len(self.item) == 1: + # il ne reste plus qu'un élément dans la liste + # il faut supprimer la liste et créer directement l'objet + index = self.parent.children.index(self) + noeud = self.children[0] + noeud.parent = self.parent + self.parent.delete_node_child(self) + self.parent.item.replace_child(self.item,noeud.item) + self.parent.children.insert(index,noeud) + else : + return + def verif_all(self): self.verif_all_children() diff --git a/Editeur/utils.py b/Editeur/utils.py index 9f09ecd4..50a4797f 100644 --- a/Editeur/utils.py +++ b/Editeur/utils.py @@ -1,7 +1,28 @@ +# CONFIGURATION MANAGEMENT OF EDF VERSION +# ====================================================================== +# COPYRIGHT (C) 1991 - 2002 EDF R&D WWW.CODE-ASTER.ORG +# THIS PROGRAM IS FREE SOFTWARE; YOU CAN REDISTRIBUTE IT AND/OR MODIFY +# IT UNDER THE TERMS OF THE GNU GENERAL PUBLIC LICENSE AS PUBLISHED BY +# THE FREE SOFTWARE FOUNDATION; EITHER VERSION 2 OF THE LICENSE, OR +# (AT YOUR OPTION) ANY LATER VERSION. +# +# THIS PROGRAM IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL, BUT +# WITHOUT ANY WARRANTY; WITHOUT EVEN THE IMPLIED WARRANTY OF +# MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. SEE THE GNU +# GENERAL PUBLIC LICENSE FOR MORE DETAILS. +# +# YOU SHOULD HAVE RECEIVED A COPY OF THE GNU GENERAL PUBLIC LICENSE +# ALONG WITH THIS PROGRAM; IF NOT, WRITE TO EDF R&D CODE_ASTER, +# 1 AVENUE DU GENERAL DE GAULLE, 92141 CLAMART CEDEX, FRANCE. +# +# +# ====================================================================== """ Ce module contient des utilitaires divers """ -import os +import os,re +import glob +import traceback def substract_list(liste1,liste2): """ @@ -69,7 +90,7 @@ def save_in_file(file,text): except: return 0 -def extension(pathAndFile): +def extension_fichier(pathAndFile): """ Return ext if path/filename.ext is given """ return os.path.splitext(pathAndFile)[1][1:] @@ -77,3 +98,47 @@ def stripPath(pathAndFile): """ Return filename.ext if path/filename.ext is given """ return os.path.split(pathAndFile)[1] +def init_rep_cata_dev(fic_cata,rep_goal): + """ initialise le répertoire des catalogues développeurs (chemin d'accès donné + dans le fichier eficas.ini cad : + - le crée s'il n'existe pas encore + - copie dedans les 3 fichiers nécessaires : + * __init__.py (pour que ce répertoire puisse être interprété comme un package) + * entete.py (pour réaliser les import nécessaires à l'interprétation des catalogues) + * declaration_concepts.py (idem) + - crée le fichier cata_developpeur.py qui sera par la suite importé""" + try : + if not os.path.isdir(rep_goal) : + os.mkdir(rep_goal) + texte_entete = get_entete_cata(fic_cata) + # rep_goal doit contenir les catalogues du développeur sous la forme *.capy + # il faut créer le catalogue développeur par concaténation de entete,declaration_concepts + # et de tous ces fichiers + cur_dir = os.getcwd() + os.chdir(rep_goal) + l_cata_dev = glob.glob('*.capy') + if os.path.isfile('cata_developpeur.py') : os.remove('cata_developpeur.py') + if len(l_cata_dev) : + # des catalogues développeurs sont effectivement présents : on crée cata_dev.py dans rep_goal + str = '' + str = str + texte_entete+'\n' + for file in l_cata_dev : + str = str + open(file,'r').read() +'\n' + open('cata_developpeur.py','w+').write(str) + os.chdir(cur_dir) + except: + traceback.print_exc() + print "Impossible de transférer les fichiers requis dans :",rep_goal + +def get_entete_cata(fic_cata): + """ Retrouve l'entete du catalogue """ + l_lignes = open(fic_cata,'r').readlines() + txt = '' + flag = 0 + for ligne in l_lignes : + if re.match("# debut entete",ligne) : flag = 1 + if re.match("# fin entete",ligne) : break + if not flag : continue + txt = txt + ligne + return txt + diff --git a/Editeur/widgets.py b/Editeur/widgets.py index 5b5d4ea2..bcdbdc3d 100644 --- a/Editeur/widgets.py +++ b/Editeur/widgets.py @@ -1,9 +1,21 @@ -#@ MODIF widgets Editeur DATE 05/09/2001 AUTEUR DURAND C.DURAND # CONFIGURATION MANAGEMENT OF EDF VERSION # ====================================================================== -# COPYRIGHT (C) 1991 - 2001 EDF R&D WWW.CODE-ASTER.ORG -# SEE THE FILE "LICENSE.TERMS" FOR INFORMATION ON USAGE AND -# REDISTRIBUTION OF THIS FILE. +# COPYRIGHT (C) 1991 - 2002 EDF R&D WWW.CODE-ASTER.ORG +# THIS PROGRAM IS FREE SOFTWARE; YOU CAN REDISTRIBUTE IT AND/OR MODIFY +# IT UNDER THE TERMS OF THE GNU GENERAL PUBLIC LICENSE AS PUBLISHED BY +# THE FREE SOFTWARE FOUNDATION; EITHER VERSION 2 OF THE LICENSE, OR +# (AT YOUR OPTION) ANY LATER VERSION. +# +# THIS PROGRAM IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL, BUT +# WITHOUT ANY WARRANTY; WITHOUT EVEN THE IMPLIED WARRANTY OF +# MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. SEE THE GNU +# GENERAL PUBLIC LICENSE FOR MORE DETAILS. +# +# YOU SHOULD HAVE RECEIVED A COPY OF THE GNU GENERAL PUBLIC LICENSE +# ALONG WITH THIS PROGRAM; IF NOT, WRITE TO EDF R&D CODE_ASTER, +# 1 AVENUE DU GENERAL DE GAULLE, 92141 CLAMART CEDEX, FRANCE. +# +# # ====================================================================== # ---------------------------------------------------------- # Cette classe sert à définir les widgets utilisés par @@ -98,7 +110,8 @@ class Fenetre : """ Permet de sauvegarder le texte dans un fichier dont on a demandé le nom à l'utilisateur """ file = asksaveasfilename(defaultextension = '.comm', - initialdir = self.appli.CONFIGURATION.rep_user, + #initialdir = self.appli.CONFIGURATION.rep_user, + initialdir = self.appli.CONFIGURATION.initialdir, title="Sauvegarde du "+self.titre) if file != '': if not save_in_file(file,self.texte) : diff --git a/Exemples/ex11/main.py b/Exemples/ex11/main.py index 08352a34..942472b5 100644 --- a/Exemples/ex11/main.py +++ b/Exemples/ex11/main.py @@ -28,6 +28,16 @@ class concept: """ Retourne 1 si sd est du bon type par rapport à la classe """ return 0 +class cata: + def __init__(self): + CONTEXT.unset_current_cata() + CONTEXT.set_current_cata(self) + + def enregistre(self,commande): + return + +c=cata() + OP1 = OPER(nom='OP1',op=1,sd_prod=concept,reentrant='f', a=SIMP(typ='I'), c=SIMP(typ='I',position='global'), diff --git a/Extensions/__init__.py b/Extensions/__init__.py index e69de29b..427090e6 100644 --- a/Extensions/__init__.py +++ b/Extensions/__init__.py @@ -0,0 +1,19 @@ +# CONFIGURATION MANAGEMENT OF EDF VERSION +# ====================================================================== +# COPYRIGHT (C) 1991 - 2002 EDF R&D WWW.CODE-ASTER.ORG +# THIS PROGRAM IS FREE SOFTWARE; YOU CAN REDISTRIBUTE IT AND/OR MODIFY +# IT UNDER THE TERMS OF THE GNU GENERAL PUBLIC LICENSE AS PUBLISHED BY +# THE FREE SOFTWARE FOUNDATION; EITHER VERSION 2 OF THE LICENSE, OR +# (AT YOUR OPTION) ANY LATER VERSION. +# +# THIS PROGRAM IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL, BUT +# WITHOUT ANY WARRANTY; WITHOUT EVEN THE IMPLIED WARRANTY OF +# MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. SEE THE GNU +# GENERAL PUBLIC LICENSE FOR MORE DETAILS. +# +# YOU SHOULD HAVE RECEIVED A COPY OF THE GNU GENERAL PUBLIC LICENSE +# ALONG WITH THIS PROGRAM; IF NOT, WRITE TO EDF R&D CODE_ASTER, +# 1 AVENUE DU GENERAL DE GAULLE, 92141 CLAMART CEDEX, FRANCE. +# +# +# ====================================================================== diff --git a/Extensions/commande_comm.py b/Extensions/commande_comm.py index 68bd102d..28b91a3b 100644 --- a/Extensions/commande_comm.py +++ b/Extensions/commande_comm.py @@ -1,9 +1,21 @@ -#@ MODIF commande_comm Accas DATE 02/07/2001 AUTEUR D6BHHJP J.P.LEFEBVRE # CONFIGURATION MANAGEMENT OF EDF VERSION # ====================================================================== -# COPYRIGHT (C) 1991 - 2001 EDF R&D WWW.CODE-ASTER.ORG -# SEE THE FILE "LICENSE.TERMS" FOR INFORMATION ON USAGE AND -# REDISTRIBUTION OF THIS FILE. +# COPYRIGHT (C) 1991 - 2002 EDF R&D WWW.CODE-ASTER.ORG +# THIS PROGRAM IS FREE SOFTWARE; YOU CAN REDISTRIBUTE IT AND/OR MODIFY +# IT UNDER THE TERMS OF THE GNU GENERAL PUBLIC LICENSE AS PUBLISHED BY +# THE FREE SOFTWARE FOUNDATION; EITHER VERSION 2 OF THE LICENSE, OR +# (AT YOUR OPTION) ANY LATER VERSION. +# +# THIS PROGRAM IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL, BUT +# WITHOUT ANY WARRANTY; WITHOUT EVEN THE IMPLIED WARRANTY OF +# MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. SEE THE GNU +# GENERAL PUBLIC LICENSE FOR MORE DETAILS. +# +# YOU SHOULD HAVE RECEIVED A COPY OF THE GNU GENERAL PUBLIC LICENSE +# ALONG WITH THIS PROGRAM; IF NOT, WRITE TO EDF R&D CODE_ASTER, +# 1 AVENUE DU GENERAL DE GAULLE, 92141 CLAMART CEDEX, FRANCE. +# +# # ====================================================================== import os,traceback,string @@ -30,6 +42,7 @@ class COMMANDE_COMM: self.definition=self self.nom = '' self.niveau = self.parent.niveau + self.actif=1 #self.appel = N_utils.callee_where(niveau=2) if reg=='oui' : self.register() @@ -216,3 +229,19 @@ class COMMANDE_COMM: """ return [] + def reparent(self,parent): + """ + Cette methode sert a reinitialiser la parente de l'objet + """ + self.parent=parent + self.jdc=parent.get_jdc_root() + self.etape=self + + def verif_existence_sd(self): + """ + Vérifie que les structures de données utilisées dans self existent bien dans le contexte + avant étape, sinon enlève la référence à ces concepts + --> sans objet pour les commandes commentarisées + """ + pass + diff --git a/Extensions/commentaire.py b/Extensions/commentaire.py index 733a2016..6bcb8842 100644 --- a/Extensions/commentaire.py +++ b/Extensions/commentaire.py @@ -1,3 +1,22 @@ +# CONFIGURATION MANAGEMENT OF EDF VERSION +# ====================================================================== +# COPYRIGHT (C) 1991 - 2002 EDF R&D WWW.CODE-ASTER.ORG +# THIS PROGRAM IS FREE SOFTWARE; YOU CAN REDISTRIBUTE IT AND/OR MODIFY +# IT UNDER THE TERMS OF THE GNU GENERAL PUBLIC LICENSE AS PUBLISHED BY +# THE FREE SOFTWARE FOUNDATION; EITHER VERSION 2 OF THE LICENSE, OR +# (AT YOUR OPTION) ANY LATER VERSION. +# +# THIS PROGRAM IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL, BUT +# WITHOUT ANY WARRANTY; WITHOUT EVEN THE IMPLIED WARRANTY OF +# MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. SEE THE GNU +# GENERAL PUBLIC LICENSE FOR MORE DETAILS. +# +# YOU SHOULD HAVE RECEIVED A COPY OF THE GNU GENERAL PUBLIC LICENSE +# ALONG WITH THIS PROGRAM; IF NOT, WRITE TO EDF R&D CODE_ASTER, +# 1 AVENUE DU GENERAL DE GAULLE, 92141 CLAMART CEDEX, FRANCE. +# +# +# ====================================================================== """ Ce module contient la classe COMMENTAIRE qui sert dans EFICAS pour gérer les commentaires dans un JDC @@ -145,5 +164,18 @@ class COMMENTAIRE : """ return [] + def get_sdprods(self,nom_sd): + """ + Retourne les concepts produits par la commande + """ + return None + def verif_existence_sd(self): + pass + + def get_fr(self): + """ + Retourne le commentaire lui meme + """ + return self.valeur diff --git a/Extensions/etape_niveau.py b/Extensions/etape_niveau.py index 31c7c20a..dbd72fea 100644 --- a/Extensions/etape_niveau.py +++ b/Extensions/etape_niveau.py @@ -1,3 +1,22 @@ +# CONFIGURATION MANAGEMENT OF EDF VERSION +# ====================================================================== +# COPYRIGHT (C) 1991 - 2002 EDF R&D WWW.CODE-ASTER.ORG +# THIS PROGRAM IS FREE SOFTWARE; YOU CAN REDISTRIBUTE IT AND/OR MODIFY +# IT UNDER THE TERMS OF THE GNU GENERAL PUBLIC LICENSE AS PUBLISHED BY +# THE FREE SOFTWARE FOUNDATION; EITHER VERSION 2 OF THE LICENSE, OR +# (AT YOUR OPTION) ANY LATER VERSION. +# +# THIS PROGRAM IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL, BUT +# WITHOUT ANY WARRANTY; WITHOUT EVEN THE IMPLIED WARRANTY OF +# MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. SEE THE GNU +# GENERAL PUBLIC LICENSE FOR MORE DETAILS. +# +# YOU SHOULD HAVE RECEIVED A COPY OF THE GNU GENERAL PUBLIC LICENSE +# ALONG WITH THIS PROGRAM; IF NOT, WRITE TO EDF R&D CODE_ASTER, +# 1 AVENUE DU GENERAL DE GAULLE, 92141 CLAMART CEDEX, FRANCE. +# +# +# ====================================================================== """ Ce module contient la classe ETAPE_NIVEAU qui sert à concrétiser les niveaux au sein d'un JDC diff --git a/Extensions/interpreteur_formule.py b/Extensions/interpreteur_formule.py index 7e2dbdf9..4d1b93d4 100644 --- a/Extensions/interpreteur_formule.py +++ b/Extensions/interpreteur_formule.py @@ -1,9 +1,21 @@ -#@ MODIF interpreteur_formule Accas DATE 02/07/2001 AUTEUR D6BHHJP J.P.LEFEBVRE # CONFIGURATION MANAGEMENT OF EDF VERSION # ====================================================================== -# COPYRIGHT (C) 1991 - 2001 EDF R&D WWW.CODE-ASTER.ORG -# SEE THE FILE "LICENSE.TERMS" FOR INFORMATION ON USAGE AND -# REDISTRIBUTION OF THIS FILE. +# COPYRIGHT (C) 1991 - 2002 EDF R&D WWW.CODE-ASTER.ORG +# THIS PROGRAM IS FREE SOFTWARE; YOU CAN REDISTRIBUTE IT AND/OR MODIFY +# IT UNDER THE TERMS OF THE GNU GENERAL PUBLIC LICENSE AS PUBLISHED BY +# THE FREE SOFTWARE FOUNDATION; EITHER VERSION 2 OF THE LICENSE, OR +# (AT YOUR OPTION) ANY LATER VERSION. +# +# THIS PROGRAM IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL, BUT +# WITHOUT ANY WARRANTY; WITHOUT EVEN THE IMPLIED WARRANTY OF +# MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. SEE THE GNU +# GENERAL PUBLIC LICENSE FOR MORE DETAILS. +# +# YOU SHOULD HAVE RECEIVED A COPY OF THE GNU GENERAL PUBLIC LICENSE +# ALONG WITH THIS PROGRAM; IF NOT, WRITE TO EDF R&D CODE_ASTER, +# 1 AVENUE DU GENERAL DE GAULLE, 92141 CLAMART CEDEX, FRANCE. +# +# # ====================================================================== import string,re,sys,exceptions,types @@ -145,6 +157,8 @@ class Interpreteur_Formule: texte = [texte,] for text_arg in texte: text_arg = string.replace(text_arg,'\n','') + # Enleve les espaces + text_arg = string.replace(text_arg,' ','') try: self.l_operateurs.append(self.split_operateurs(text_arg)) except InterpreteurException,e: diff --git a/Extensions/jdc.py b/Extensions/jdc.py index 8b7cdf29..313ec043 100644 --- a/Extensions/jdc.py +++ b/Extensions/jdc.py @@ -1,3 +1,22 @@ +# CONFIGURATION MANAGEMENT OF EDF VERSION +# ====================================================================== +# COPYRIGHT (C) 1991 - 2002 EDF R&D WWW.CODE-ASTER.ORG +# THIS PROGRAM IS FREE SOFTWARE; YOU CAN REDISTRIBUTE IT AND/OR MODIFY +# IT UNDER THE TERMS OF THE GNU GENERAL PUBLIC LICENSE AS PUBLISHED BY +# THE FREE SOFTWARE FOUNDATION; EITHER VERSION 2 OF THE LICENSE, OR +# (AT YOUR OPTION) ANY LATER VERSION. +# +# THIS PROGRAM IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL, BUT +# WITHOUT ANY WARRANTY; WITHOUT EVEN THE IMPLIED WARRANTY OF +# MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. SEE THE GNU +# GENERAL PUBLIC LICENSE FOR MORE DETAILS. +# +# YOU SHOULD HAVE RECEIVED A COPY OF THE GNU GENERAL PUBLIC LICENSE +# ALONG WITH THIS PROGRAM; IF NOT, WRITE TO EDF R&D CODE_ASTER, +# 1 AVENUE DU GENERAL DE GAULLE, 92141 CLAMART CEDEX, FRANCE. +# +# +# ====================================================================== """ Ce module contient la classe mixin qui porte les méthodes pour traiter les niveaux au sein d'un JDC diff --git a/Extensions/mcnuplet.py b/Extensions/mcnuplet.py index da997b6d..c11d0cb7 100644 --- a/Extensions/mcnuplet.py +++ b/Extensions/mcnuplet.py @@ -1,3 +1,22 @@ +# CONFIGURATION MANAGEMENT OF EDF VERSION +# ====================================================================== +# COPYRIGHT (C) 1991 - 2002 EDF R&D WWW.CODE-ASTER.ORG +# THIS PROGRAM IS FREE SOFTWARE; YOU CAN REDISTRIBUTE IT AND/OR MODIFY +# IT UNDER THE TERMS OF THE GNU GENERAL PUBLIC LICENSE AS PUBLISHED BY +# THE FREE SOFTWARE FOUNDATION; EITHER VERSION 2 OF THE LICENSE, OR +# (AT YOUR OPTION) ANY LATER VERSION. +# +# THIS PROGRAM IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL, BUT +# WITHOUT ANY WARRANTY; WITHOUT EVEN THE IMPLIED WARRANTY OF +# MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. SEE THE GNU +# GENERAL PUBLIC LICENSE FOR MORE DETAILS. +# +# YOU SHOULD HAVE RECEIVED A COPY OF THE GNU GENERAL PUBLIC LICENSE +# ALONG WITH THIS PROGRAM; IF NOT, WRITE TO EDF R&D CODE_ASTER, +# 1 AVENUE DU GENERAL DE GAULLE, 92141 CLAMART CEDEX, FRANCE. +# +# +# ====================================================================== """ """ # Modules Python @@ -32,6 +51,7 @@ class MCNUPLET(V_MCCOMPO.MCCOMPO,N_MCCOMPO.MCCOMPO): self.niveau = None self.etape = None self.state = 'undetermined' + self.actif=1 self.mc_liste=self.build_mc() def build_mc(self): @@ -168,5 +188,14 @@ class MCNUPLET(V_MCCOMPO.MCCOMPO,N_MCCOMPO.MCCOMPO): def isoblig(self): return self.definition.statut=='o' + def get_fr(self): + """ + Retourne le texte d'aide dans la langue choisie + """ + try : + return getattr(self.definition,prefs.lang) + except: + return '' + diff --git a/Extensions/niveau.py b/Extensions/niveau.py index b5df8fdf..8b6f0822 100644 --- a/Extensions/niveau.py +++ b/Extensions/niveau.py @@ -1,3 +1,22 @@ +# CONFIGURATION MANAGEMENT OF EDF VERSION +# ====================================================================== +# COPYRIGHT (C) 1991 - 2002 EDF R&D WWW.CODE-ASTER.ORG +# THIS PROGRAM IS FREE SOFTWARE; YOU CAN REDISTRIBUTE IT AND/OR MODIFY +# IT UNDER THE TERMS OF THE GNU GENERAL PUBLIC LICENSE AS PUBLISHED BY +# THE FREE SOFTWARE FOUNDATION; EITHER VERSION 2 OF THE LICENSE, OR +# (AT YOUR OPTION) ANY LATER VERSION. +# +# THIS PROGRAM IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL, BUT +# WITHOUT ANY WARRANTY; WITHOUT EVEN THE IMPLIED WARRANTY OF +# MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. SEE THE GNU +# GENERAL PUBLIC LICENSE FOR MORE DETAILS. +# +# YOU SHOULD HAVE RECEIVED A COPY OF THE GNU GENERAL PUBLIC LICENSE +# ALONG WITH THIS PROGRAM; IF NOT, WRITE TO EDF R&D CODE_ASTER, +# 1 AVENUE DU GENERAL DE GAULLE, 92141 CLAMART CEDEX, FRANCE. +# +# +# ====================================================================== """ Ce module contient la classe NIVEAU qui sert à définir des groupes de commandes dans le catalogue diff --git a/Extensions/nuplet.py b/Extensions/nuplet.py index 63da3689..0ec02ba6 100644 --- a/Extensions/nuplet.py +++ b/Extensions/nuplet.py @@ -1,3 +1,22 @@ +# CONFIGURATION MANAGEMENT OF EDF VERSION +# ====================================================================== +# COPYRIGHT (C) 1991 - 2002 EDF R&D WWW.CODE-ASTER.ORG +# THIS PROGRAM IS FREE SOFTWARE; YOU CAN REDISTRIBUTE IT AND/OR MODIFY +# IT UNDER THE TERMS OF THE GNU GENERAL PUBLIC LICENSE AS PUBLISHED BY +# THE FREE SOFTWARE FOUNDATION; EITHER VERSION 2 OF THE LICENSE, OR +# (AT YOUR OPTION) ANY LATER VERSION. +# +# THIS PROGRAM IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL, BUT +# WITHOUT ANY WARRANTY; WITHOUT EVEN THE IMPLIED WARRANTY OF +# MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. SEE THE GNU +# GENERAL PUBLIC LICENSE FOR MORE DETAILS. +# +# YOU SHOULD HAVE RECEIVED A COPY OF THE GNU GENERAL PUBLIC LICENSE +# ALONG WITH THIS PROGRAM; IF NOT, WRITE TO EDF R&D CODE_ASTER, +# 1 AVENUE DU GENERAL DE GAULLE, 92141 CLAMART CEDEX, FRANCE. +# +# +# ====================================================================== """ Ce module contient la classe de définition pour les nuplets NUPL """ diff --git a/Extensions/parametre.py b/Extensions/parametre.py index 94f028f0..20455bfe 100644 --- a/Extensions/parametre.py +++ b/Extensions/parametre.py @@ -1,3 +1,22 @@ +# CONFIGURATION MANAGEMENT OF EDF VERSION +# ====================================================================== +# COPYRIGHT (C) 1991 - 2002 EDF R&D WWW.CODE-ASTER.ORG +# THIS PROGRAM IS FREE SOFTWARE; YOU CAN REDISTRIBUTE IT AND/OR MODIFY +# IT UNDER THE TERMS OF THE GNU GENERAL PUBLIC LICENSE AS PUBLISHED BY +# THE FREE SOFTWARE FOUNDATION; EITHER VERSION 2 OF THE LICENSE, OR +# (AT YOUR OPTION) ANY LATER VERSION. +# +# THIS PROGRAM IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL, BUT +# WITHOUT ANY WARRANTY; WITHOUT EVEN THE IMPLIED WARRANTY OF +# MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. SEE THE GNU +# GENERAL PUBLIC LICENSE FOR MORE DETAILS. +# +# YOU SHOULD HAVE RECEIVED A COPY OF THE GNU GENERAL PUBLIC LICENSE +# ALONG WITH THIS PROGRAM; IF NOT, WRITE TO EDF R&D CODE_ASTER, +# 1 AVENUE DU GENERAL DE GAULLE, 92141 CLAMART CEDEX, FRANCE. +# +# +# ====================================================================== """ Ce module contient la classe PARAMETRE qui sert à définir des objets paramètres qui sont compréhensibles et donc affichables @@ -33,6 +52,7 @@ class PARAMETRE : self.definition=self self.jdc = self.parent = CONTEXT.get_current_step() self.niveau=self.parent.niveau + self.actif=1 self.register() def interprete_valeur(self,val): @@ -249,7 +269,8 @@ class PARAMETRE : """ return [] - + def verif_existence_sd(self): + pass diff --git a/Extensions/parametre_eval.py b/Extensions/parametre_eval.py index 73bf9bd6..b45546d9 100644 --- a/Extensions/parametre_eval.py +++ b/Extensions/parametre_eval.py @@ -1,3 +1,22 @@ +# CONFIGURATION MANAGEMENT OF EDF VERSION +# ====================================================================== +# COPYRIGHT (C) 1991 - 2002 EDF R&D WWW.CODE-ASTER.ORG +# THIS PROGRAM IS FREE SOFTWARE; YOU CAN REDISTRIBUTE IT AND/OR MODIFY +# IT UNDER THE TERMS OF THE GNU GENERAL PUBLIC LICENSE AS PUBLISHED BY +# THE FREE SOFTWARE FOUNDATION; EITHER VERSION 2 OF THE LICENSE, OR +# (AT YOUR OPTION) ANY LATER VERSION. +# +# THIS PROGRAM IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL, BUT +# WITHOUT ANY WARRANTY; WITHOUT EVEN THE IMPLIED WARRANTY OF +# MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. SEE THE GNU +# GENERAL PUBLIC LICENSE FOR MORE DETAILS. +# +# YOU SHOULD HAVE RECEIVED A COPY OF THE GNU GENERAL PUBLIC LICENSE +# ALONG WITH THIS PROGRAM; IF NOT, WRITE TO EDF R&D CODE_ASTER, +# 1 AVENUE DU GENERAL DE GAULLE, 92141 CLAMART CEDEX, FRANCE. +# +# +# ====================================================================== """ Ce module contient la classe PARAMETRE_EVAL qui sert à définir des objets paramètres qui sont compréhensibles et donc affichables @@ -36,6 +55,7 @@ class PARAMETRE_EVAL(parametre.PARAMETRE) : self.jdc = self.parent = CONTEXT.get_current_step() self.definition=self self.niveau = self.parent.niveau + self.actif=1 # Ceci est-il indispensable ??? #self.appel = N_utils.callee_where(niveau=2) self.register() @@ -60,6 +80,8 @@ class PARAMETRE_EVAL(parametre.PARAMETRE) : """ if not val : return None d={} + val = string.strip(val) + if val[-1] == ';' : val = val[0:-1] d['EVAL'] = Accas.EVAL try: valeur = eval(val,{},d) diff --git a/Extensions/pluginloader.py b/Extensions/pluginloader.py index 659027d2..378500c0 100644 --- a/Extensions/pluginloader.py +++ b/Extensions/pluginloader.py @@ -1,3 +1,22 @@ +# CONFIGURATION MANAGEMENT OF EDF VERSION +# ====================================================================== +# COPYRIGHT (C) 1991 - 2002 EDF R&D WWW.CODE-ASTER.ORG +# THIS PROGRAM IS FREE SOFTWARE; YOU CAN REDISTRIBUTE IT AND/OR MODIFY +# IT UNDER THE TERMS OF THE GNU GENERAL PUBLIC LICENSE AS PUBLISHED BY +# THE FREE SOFTWARE FOUNDATION; EITHER VERSION 2 OF THE LICENSE, OR +# (AT YOUR OPTION) ANY LATER VERSION. +# +# THIS PROGRAM IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL, BUT +# WITHOUT ANY WARRANTY; WITHOUT EVEN THE IMPLIED WARRANTY OF +# MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. SEE THE GNU +# GENERAL PUBLIC LICENSE FOR MORE DETAILS. +# +# YOU SHOULD HAVE RECEIVED A COPY OF THE GNU GENERAL PUBLIC LICENSE +# ALONG WITH THIS PROGRAM; IF NOT, WRITE TO EDF R&D CODE_ASTER, +# 1 AVENUE DU GENERAL DE GAULLE, 92141 CLAMART CEDEX, FRANCE. +# +# +# ====================================================================== """ Ce module contient le chargeur dynamique de plugins (emprunté à HappyDoc) """ diff --git a/Ihm/I_ASSD.py b/Ihm/I_ASSD.py new file mode 100644 index 00000000..004d0b86 --- /dev/null +++ b/Ihm/I_ASSD.py @@ -0,0 +1,23 @@ +# CONFIGURATION MANAGEMENT OF EDF VERSION +# ====================================================================== +# COPYRIGHT (C) 1991 - 2002 EDF R&D WWW.CODE-ASTER.ORG +# THIS PROGRAM IS FREE SOFTWARE; YOU CAN REDISTRIBUTE IT AND/OR MODIFY +# IT UNDER THE TERMS OF THE GNU GENERAL PUBLIC LICENSE AS PUBLISHED BY +# THE FREE SOFTWARE FOUNDATION; EITHER VERSION 2 OF THE LICENSE, OR +# (AT YOUR OPTION) ANY LATER VERSION. +# +# THIS PROGRAM IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL, BUT +# WITHOUT ANY WARRANTY; WITHOUT EVEN THE IMPLIED WARRANTY OF +# MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. SEE THE GNU +# GENERAL PUBLIC LICENSE FOR MORE DETAILS. +# +# YOU SHOULD HAVE RECEIVED A COPY OF THE GNU GENERAL PUBLIC LICENSE +# ALONG WITH THIS PROGRAM; IF NOT, WRITE TO EDF R&D CODE_ASTER, +# 1 AVENUE DU GENERAL DE GAULLE, 92141 CLAMART CEDEX, FRANCE. +# +# +# ====================================================================== + +class ASSD: + def __repr__(self): + return "concept %s de type %s" % (self.get_name(),self.__class__.__name__) diff --git a/Ihm/I_A_CLASSER.py b/Ihm/I_A_CLASSER.py index 16853f5f..e1f19ca5 100644 --- a/Ihm/I_A_CLASSER.py +++ b/Ihm/I_A_CLASSER.py @@ -1,3 +1,22 @@ +# CONFIGURATION MANAGEMENT OF EDF VERSION +# ====================================================================== +# COPYRIGHT (C) 1991 - 2002 EDF R&D WWW.CODE-ASTER.ORG +# THIS PROGRAM IS FREE SOFTWARE; YOU CAN REDISTRIBUTE IT AND/OR MODIFY +# IT UNDER THE TERMS OF THE GNU GENERAL PUBLIC LICENSE AS PUBLISHED BY +# THE FREE SOFTWARE FOUNDATION; EITHER VERSION 2 OF THE LICENSE, OR +# (AT YOUR OPTION) ANY LATER VERSION. +# +# THIS PROGRAM IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL, BUT +# WITHOUT ANY WARRANTY; WITHOUT EVEN THE IMPLIED WARRANTY OF +# MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. SEE THE GNU +# GENERAL PUBLIC LICENSE FOR MORE DETAILS. +# +# YOU SHOULD HAVE RECEIVED A COPY OF THE GNU GENERAL PUBLIC LICENSE +# ALONG WITH THIS PROGRAM; IF NOT, WRITE TO EDF R&D CODE_ASTER, +# 1 AVENUE DU GENERAL DE GAULLE, 92141 CLAMART CEDEX, FRANCE. +# +# +# ====================================================================== """ """ diff --git a/Ihm/I_ENTITE.py b/Ihm/I_ENTITE.py index 3a070e1c..4a2ac465 100644 --- a/Ihm/I_ENTITE.py +++ b/Ihm/I_ENTITE.py @@ -1,3 +1,22 @@ +# CONFIGURATION MANAGEMENT OF EDF VERSION +# ====================================================================== +# COPYRIGHT (C) 1991 - 2002 EDF R&D WWW.CODE-ASTER.ORG +# THIS PROGRAM IS FREE SOFTWARE; YOU CAN REDISTRIBUTE IT AND/OR MODIFY +# IT UNDER THE TERMS OF THE GNU GENERAL PUBLIC LICENSE AS PUBLISHED BY +# THE FREE SOFTWARE FOUNDATION; EITHER VERSION 2 OF THE LICENSE, OR +# (AT YOUR OPTION) ANY LATER VERSION. +# +# THIS PROGRAM IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL, BUT +# WITHOUT ANY WARRANTY; WITHOUT EVEN THE IMPLIED WARRANTY OF +# MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. SEE THE GNU +# GENERAL PUBLIC LICENSE FOR MORE DETAILS. +# +# YOU SHOULD HAVE RECEIVED A COPY OF THE GNU GENERAL PUBLIC LICENSE +# ALONG WITH THIS PROGRAM; IF NOT, WRITE TO EDF R&D CODE_ASTER, +# 1 AVENUE DU GENERAL DE GAULLE, 92141 CLAMART CEDEX, FRANCE. +# +# +# ====================================================================== class ENTITE: def get_docu(self): if hasattr(self,'docu') : diff --git a/Ihm/I_ETAPE.py b/Ihm/I_ETAPE.py index 8937c110..d902f6c0 100644 --- a/Ihm/I_ETAPE.py +++ b/Ihm/I_ETAPE.py @@ -1,9 +1,35 @@ +# CONFIGURATION MANAGEMENT OF EDF VERSION +# ====================================================================== +# COPYRIGHT (C) 1991 - 2002 EDF R&D WWW.CODE-ASTER.ORG +# THIS PROGRAM IS FREE SOFTWARE; YOU CAN REDISTRIBUTE IT AND/OR MODIFY +# IT UNDER THE TERMS OF THE GNU GENERAL PUBLIC LICENSE AS PUBLISHED BY +# THE FREE SOFTWARE FOUNDATION; EITHER VERSION 2 OF THE LICENSE, OR +# (AT YOUR OPTION) ANY LATER VERSION. +# +# THIS PROGRAM IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL, BUT +# WITHOUT ANY WARRANTY; WITHOUT EVEN THE IMPLIED WARRANTY OF +# MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. SEE THE GNU +# GENERAL PUBLIC LICENSE FOR MORE DETAILS. +# +# YOU SHOULD HAVE RECEIVED A COPY OF THE GNU GENERAL PUBLIC LICENSE +# ALONG WITH THIS PROGRAM; IF NOT, WRITE TO EDF R&D CODE_ASTER, +# 1 AVENUE DU GENERAL DE GAULLE, 92141 CLAMART CEDEX, FRANCE. +# +# +# ====================================================================== """ """ # Modules Python import string,types from copy import copy +# import rajoutés suite à l'ajout de Build_sd --> à résorber +import traceback +import Noyau +from Noyau import N_Exception +from Noyau.N_Exception import AsException +# fin import à résorber + # Modules EFICAS import I_MCCOMPO @@ -15,15 +41,6 @@ class ETAPE(I_MCCOMPO.MCCOMPO): def ident(self): return self.nom - def get_fr(self): - """ - Retourne l'attribut fr de self.definition - """ - try: - return self.definition.fr - except: - return '' - def get_sdname(self): if CONTEXT.debug : print "SDNAME ",self.reuse,self.sd,self.sd.get_name() if self.reuse != None: @@ -63,7 +80,8 @@ class ETAPE(I_MCCOMPO.MCCOMPO): """ if self.isvalid() : if type(self.definition.op_init) == types.FunctionType : - apply(self.definition.op_init,(self,self.master.g_context)) + # XXX Normalement en mode editeur g_context ne peut pas etre utilisé + apply(self.definition.op_init,(self,self.parent.g_context)) self.state = 'modified' def nomme_sd(self,nom) : @@ -79,59 +97,87 @@ class ETAPE(I_MCCOMPO.MCCOMPO): if len(nom) > 8 and self.jdc.definition.code == 'ASTER': return 0,"Nom de concept trop long (maxi 8 caractères)" self.init_modif() - # Cas particulier des opérateurs réentrants if not self.isvalid(sd='non') : return 0,"Nommage du concept refusé : l'opérateur n'est pas valide" + # + # Cas particulier des opérateurs obligatoirement réentrants + # if self.definition.reentrant == 'o': - self.sd = self.reuse = self.jdc.get_sdprod(nom) + # FR : appel à get_sdprod incorrect : il faut appeler get_sd_avant_etape + #self.sd = self.reuse = self.jdc.get_sdprod(nom) + self.sd = self.reuse = self.jdc.get_sd_avant_etape(nom,self) if self.sd != None : + self.sdnom=self.sd.nom return 1,"Concept existant" else: return 0,"Opérateur réentrant mais concept non existant" + # + # Cas particulier des opérateurs facultativement réentrants + # + old_reuse=None if self.definition.reentrant == 'f' : sd = self.jdc.get_sd_avant_etape(nom,self) if sd != None : - self.sd = self.reuse = sd - return 1,"Opérateur facultativement réentrant et concept existant trouvé" + # FR : il faut tester que la sd trouvée est du bon type !!!!!!!!!!!!!!!!! + if isinstance(sd,self.get_type_produit()) : + self.sd = self.reuse = sd + self.sdnom = sd.nom + return 1,"Opérateur facultativement réentrant et concept existant trouvé" + else: + return 0,"Concept déjà existant et de mauvais type" else : - # il faut éventuellement enlever le lien vers une SD existante car si on passe ici + # il faut enlever le lien vers une SD existante car si on passe ici # cela signifie que l'opérateur n'est pas utilisé en mode réentrant. - # Si on ne fait pas cela, le nom de l'opérateur réutilisé est aussi modifié - # et on ne peut plus modifier la SD de l'opérateur + # Si on ne fait pas cela, on risque de modifier une SD produite par un autre opérateur if self.reuse : - self.sd = self.reuse = None - # l'opérateur n'est pas réentrant ou facultativement reentrant mais pas dans ce cas + old_reuse=self.reuse + self.sd = self.reuse = self.sdnom = None + # + # On est dans le cas ou l'opérateur n'est pas réentrant ou est facultativement reentrant + # mais est utilisé en mode non réentrant + # if self.sd == None : if self.parent.get_sd_autour_etape(nom,self): + # Un concept de ce nom existe dans le voisinage de l'etape courante # On force self.valid a 0 car l appel a isvalid precedent l a mis a 1 # mais ceci indique seulement une validité partielle # isvalid ne devrait peut etre pas mettre l attribut valid à 1 si sd == 'non' self.valid=0 - return 0,"Nommage du concept refuse : un concept de meme nom existe deja" - # Il n'existe pas de sd de nom sdnom. On peut donc créer le concept retourné. - # Il est créé sans nom mais enregistré dans la liste des concepts existants - self.get_sd_prod() - self.sd.nom = nom - return 1,"Nommage du concept effectué" - else : - old_nom=self.sd.nom - if string.find(old_nom,'sansnom') : - # Dans le cas où old_nom == sansnom, isvalid retourne 0 alors que ... - # par contre si le concept existe et qu'il s'appelle sansnom c'est que l'étape est valide - # on peut donc le nommer sans test préalable - self.sd.nom=nom - return 1,"Nommage du concept effectué" - if self.isvalid() : - # Normalement l appel de isvalid a mis a jour le concept produit (son type) - # Il suffit de spécifier l attribut nom de sd pour le nommer si le nom n est pas - # deja attribué - if self.parent.get_sd_autour_etape(nom,self): + # On retablit l'ancien concept reentrant s'il existait + if old_reuse: + self.sd=self.reuse=old_reuse + self.sdnom=old_reuse.nom return 0,"Nommage du concept refuse : un concept de meme nom existe deja" else: - self.sd.nom=nom + # Il n'existe pas de concept de ce nom dans le voisinage de l'etape courante + # On peut donc créer le concept retourné. + # Il est créé sans nom mais enregistré dans la liste des concepts existants + self.get_sd_prod() + # Il suffit de changer son attribut nom pour le nommer + self.sd.nom = nom + self.sdnom=nom return 1,"Nommage du concept effectué" - else: - # Normalement on ne devrait pas passer ici - return 0,'Normalement on ne devrait pas passer ici' + else : + old_nom=self.sd.nom + if string.find(old_nom,'sansnom') : + # Dans le cas où old_nom == sansnom, isvalid retourne 0 alors que ... + # par contre si le concept existe et qu'il s'appelle sansnom c'est que l'étape est valide + # on peut donc le nommer sans test préalable + self.sd.nom=nom + self.sdnom=nom + return 1,"Nommage du concept effectué" + if self.isvalid() : + # Normalement l appel de isvalid a mis a jour le concept produit (son type) + # Il suffit de spécifier l attribut nom de sd pour le nommer si le nom n est pas + # deja attribué + if self.parent.get_sd_autour_etape(nom,self): + return 0,"Nommage du concept refuse : un concept de meme nom existe deja" + else: + self.sd.nom=nom + self.sdnom=nom + return 1,"Nommage du concept effectué" + else: + # Normalement on ne devrait pas passer ici + return 0,'Normalement on ne devrait pas passer ici' def get_sdprods(self,nom_sd): """ @@ -234,9 +280,11 @@ class ETAPE(I_MCCOMPO.MCCOMPO): etape.state = 'modified' etape.reuse = None etape.sdnom = None + etape.etape=etape etape.mc_liste=[] for objet in self.mc_liste: new_obj = objet.copy() + new_obj.reparent(etape) etape.mc_liste.append(new_obj) return etape @@ -270,3 +318,104 @@ class ETAPE(I_MCCOMPO.MCCOMPO): l.extend(child.get_sd_utilisees()) return l + def get_genealogie(self): + """ + Retourne la liste des noms des ascendants de l'objet self + en s'arretant à la première ETAPE rencontrée + """ + return [self.nom] + + def reparent(self,parent): + """ + Cette methode sert a reinitialiser la parente de l'objet + """ + self.parent=parent + self.jdc=parent.get_jdc_root() + self.etape=self + for mocle in self.mc_liste: + mocle.reparent(self) + + def verif_existence_sd(self): + """ + Vérifie que les structures de données utilisées dans self existent bien dans le contexte + avant étape, sinon enlève la référence à ces concepts + """ + for motcle in self.mc_liste : + motcle.verif_existence_sd() + + def Build_sd(self,nom): + """ + Construit le concept produit de l'opérateur. Deux cas + peuvent se présenter : + + - le parent n'est pas défini. Dans ce cas, l'étape prend en charge la création + et le nommage du concept. + + - le parent est défini. Dans ce cas, l'étape demande au parent la création et + le nommage du concept. + + """ + if not self.isactif():return + # FR : attention cette méthode ne devrait pas se trouver là car elle surcharge celle qui + # se trouve dans N_ETAPE.py et elle est partie intégrante du noyau, mais, suite à l'absence de + # test de validité de l'opérateur avant d'essayer de déterminer la sd produite, on n'arrivait + # pas à relire avec EFICAS un fichier contenant une étape encore incomplète du style : + # sansnom = AFFE_CHAR_CINE(MODELE=None) + # Suite à la stabilisation du noyau d'Aster, je n'ai pas eu d'autre solution que de surcharger + # cette méthode ici en rajoutant le test manquant ... + # CCAR : cette modification ne corrige le probleme qu'en partie. Il faudrait probablement + # supprimer les erreurs fatales (exception ) et retourner systematiquement un objet produit + # meme en cas d'erreur et reporter l'emission du message d'erreur a la phase de validation + if not self.isvalid(sd='non') : return + else:self.state='undetermined' + self.sdnom=nom + try: + if self.parent: + sd= self.parent.create_sdprod(self,nom) + if type(self.definition.op_init) == types.FunctionType: + apply(self.definition.op_init,(self,self.parent.g_context)) + else: + sd=self.get_sd_prod() + # On n'utilise pas self.definition.op_init car self.parent + # n'existe pas + if sd != None and self.reuse == None: + # On ne nomme le concept que dans le cas de non reutilisation + # d un concept + sd.nom=nom + if self.jdc and self.jdc.par_lot == "NON" : + self.Execute() + return sd + except AsException,e: + raise AsException("Etape ",self.nom,'ligne : ',self.appel[0], + 'fichier : ',self.appel[1],e) + except EOFError: + # XXX Normalement le contexte courant doit etre le parent. + # Il n'y a pas de raison de remettre le contexte au parent + #self.reset_current_step() + raise + except : + l=traceback.format_exception(sys.exc_info()[0],sys.exc_info()[1],sys.exc_info()[2]) + raise AsException("Etape ",self.nom,'ligne : ',self.appel[0], + 'fichier : ',self.appel[1]+'\n', + string.join(l)) + + + + + + + + + + + + + + + + + + + + + diff --git a/Ihm/I_EXCLUS.py b/Ihm/I_EXCLUS.py index e53ead8e..844d61f0 100644 --- a/Ihm/I_EXCLUS.py +++ b/Ihm/I_EXCLUS.py @@ -1,3 +1,22 @@ +# CONFIGURATION MANAGEMENT OF EDF VERSION +# ====================================================================== +# COPYRIGHT (C) 1991 - 2002 EDF R&D WWW.CODE-ASTER.ORG +# THIS PROGRAM IS FREE SOFTWARE; YOU CAN REDISTRIBUTE IT AND/OR MODIFY +# IT UNDER THE TERMS OF THE GNU GENERAL PUBLIC LICENSE AS PUBLISHED BY +# THE FREE SOFTWARE FOUNDATION; EITHER VERSION 2 OF THE LICENSE, OR +# (AT YOUR OPTION) ANY LATER VERSION. +# +# THIS PROGRAM IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL, BUT +# WITHOUT ANY WARRANTY; WITHOUT EVEN THE IMPLIED WARRANTY OF +# MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. SEE THE GNU +# GENERAL PUBLIC LICENSE FOR MORE DETAILS. +# +# YOU SHOULD HAVE RECEIVED A COPY OF THE GNU GENERAL PUBLIC LICENSE +# ALONG WITH THIS PROGRAM; IF NOT, WRITE TO EDF R&D CODE_ASTER, +# 1 AVENUE DU GENERAL DE GAULLE, 92141 CLAMART CEDEX, FRANCE. +# +# +# ====================================================================== """ """ @@ -13,7 +32,8 @@ class EXCLUS(I_REGLE.REGLE): if not regle_active : return liste_a_purger for mc in self.mcs: - if mc in liste_a_purger: + # Il ne faut pas purger un mot cle present. Sa cardinalite est verifiee par ailleurs + if mc in liste_a_purger and mc not in liste_mc_presents: liste_a_purger.remove(mc) return liste_a_purger diff --git a/Ihm/I_FONCTION.py b/Ihm/I_FONCTION.py new file mode 100644 index 00000000..b708dee6 --- /dev/null +++ b/Ihm/I_FONCTION.py @@ -0,0 +1,41 @@ +# CONFIGURATION MANAGEMENT OF EDF VERSION +# ====================================================================== +# COPYRIGHT (C) 1991 - 2002 EDF R&D WWW.CODE-ASTER.ORG +# THIS PROGRAM IS FREE SOFTWARE; YOU CAN REDISTRIBUTE IT AND/OR MODIFY +# IT UNDER THE TERMS OF THE GNU GENERAL PUBLIC LICENSE AS PUBLISHED BY +# THE FREE SOFTWARE FOUNDATION; EITHER VERSION 2 OF THE LICENSE, OR +# (AT YOUR OPTION) ANY LATER VERSION. +# +# THIS PROGRAM IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL, BUT +# WITHOUT ANY WARRANTY; WITHOUT EVEN THE IMPLIED WARRANTY OF +# MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. SEE THE GNU +# GENERAL PUBLIC LICENSE FOR MORE DETAILS. +# +# YOU SHOULD HAVE RECEIVED A COPY OF THE GNU GENERAL PUBLIC LICENSE +# ALONG WITH THIS PROGRAM; IF NOT, WRITE TO EDF R&D CODE_ASTER, +# 1 AVENUE DU GENERAL DE GAULLE, 92141 CLAMART CEDEX, FRANCE. +# +# +# ====================================================================== +from I_ASSD import ASSD + +class FONCTION(ASSD): + def __init__(self,etape=None,sd=None,reg='oui'): + #ASSD.__init__(self,etape=etape,sd=sd,reg=reg) + if reg=='oui': + self.jdc.register_fonction(self) + + def get_formule(self): + """ + Retourne une formule décrivant self sous la forme d'un tuple : + (nom,type_retourne,arguments,corps) + """ + if hasattr(self.etape,'get_formule'): + # on est dans le cas d'une formule Aster + return self.etape.get_formule() + else: + # on est dans le cas d'une fonction + return (self.nom,'REEL','(REEL:x)','''bidon''') + +class fonction(FONCTION) : pass + diff --git a/Ihm/I_FORM_ETAPE.py b/Ihm/I_FORM_ETAPE.py index 51100165..80689be4 100644 --- a/Ihm/I_FORM_ETAPE.py +++ b/Ihm/I_FORM_ETAPE.py @@ -1,3 +1,22 @@ +# CONFIGURATION MANAGEMENT OF EDF VERSION +# ====================================================================== +# COPYRIGHT (C) 1991 - 2002 EDF R&D WWW.CODE-ASTER.ORG +# THIS PROGRAM IS FREE SOFTWARE; YOU CAN REDISTRIBUTE IT AND/OR MODIFY +# IT UNDER THE TERMS OF THE GNU GENERAL PUBLIC LICENSE AS PUBLISHED BY +# THE FREE SOFTWARE FOUNDATION; EITHER VERSION 2 OF THE LICENSE, OR +# (AT YOUR OPTION) ANY LATER VERSION. +# +# THIS PROGRAM IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL, BUT +# WITHOUT ANY WARRANTY; WITHOUT EVEN THE IMPLIED WARRANTY OF +# MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. SEE THE GNU +# GENERAL PUBLIC LICENSE FOR MORE DETAILS. +# +# YOU SHOULD HAVE RECEIVED A COPY OF THE GNU GENERAL PUBLIC LICENSE +# ALONG WITH THIS PROGRAM; IF NOT, WRITE TO EDF R&D CODE_ASTER, +# 1 AVENUE DU GENERAL DE GAULLE, 92141 CLAMART CEDEX, FRANCE. +# +# +# ====================================================================== """ """ import string,traceback @@ -56,6 +75,15 @@ class FORM_ETAPE(MACRO_ETAPE): else: return '' + def get_formule(self): + """ + Retourne un tuple décrivant la formule : + (nom,type_retourne,arguments,corps) + """ + t,a,c = self.analyse_formule() + n = self.get_nom() + return (n,t,a,c) + def verif_arguments(self,arguments = None): """ Vérifie si les arguments passés en argument (si aucun prend les arguments courants) diff --git a/Ihm/I_JDC.py b/Ihm/I_JDC.py index 2c26ab8e..125fb617 100644 --- a/Ihm/I_JDC.py +++ b/Ihm/I_JDC.py @@ -1,3 +1,22 @@ +# CONFIGURATION MANAGEMENT OF EDF VERSION +# ====================================================================== +# COPYRIGHT (C) 1991 - 2002 EDF R&D WWW.CODE-ASTER.ORG +# THIS PROGRAM IS FREE SOFTWARE; YOU CAN REDISTRIBUTE IT AND/OR MODIFY +# IT UNDER THE TERMS OF THE GNU GENERAL PUBLIC LICENSE AS PUBLISHED BY +# THE FREE SOFTWARE FOUNDATION; EITHER VERSION 2 OF THE LICENSE, OR +# (AT YOUR OPTION) ANY LATER VERSION. +# +# THIS PROGRAM IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL, BUT +# WITHOUT ANY WARRANTY; WITHOUT EVEN THE IMPLIED WARRANTY OF +# MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. SEE THE GNU +# GENERAL PUBLIC LICENSE FOR MORE DETAILS. +# +# YOU SHOULD HAVE RECEIVED A COPY OF THE GNU GENERAL PUBLIC LICENSE +# ALONG WITH THIS PROGRAM; IF NOT, WRITE TO EDF R&D CODE_ASTER, +# 1 AVENUE DU GENERAL DE GAULLE, 92141 CLAMART CEDEX, FRANCE. +# +# +# ====================================================================== """ """ # Modules Python @@ -6,9 +25,8 @@ import string,linecache # Modules Eficas import I_OBJECT -from Noyau.N_ASSD import assd +from Noyau.N_ASSD import ASSD from Noyau.N_ETAPE import ETAPE -from Noyau.N_CO import CO from Noyau.N_Exception import AsException from Extensions import commentaire,parametre,parametre_eval @@ -21,6 +39,7 @@ class JDC(I_OBJECT.OBJECT): self.niveau=self self.params=[] self.fonctions=[] + self._etape_context=None def get_cmd(self,nomcmd): """ @@ -38,20 +57,32 @@ class JDC(I_OBJECT.OBJECT): l=[] for k,v in d.items(): if type(v) != types.InstanceType : continue - if assd in types_permis or CO in types_permis : - l.append(k) - continue - for type_ok in types_permis: - if type_ok in ('R','I','C','TXM') and v in self.params : l.append(k) - elif type_ok == 'R' and v.__class__.__name__ == 'reel' : l.append(k) - elif type_ok == 'I' and v.__class__.__name__ == 'entier' : l.append(k) - elif type_ok == 'C' and v.__class__.__name__ == 'complexe' : l.append(k) - elif type_ok == 'TXM' and v.__class__.__name__ == 'chaine' : l.append(k) - elif type(type_ok) != types.ClassType : continue - elif v.__class__ == type_ok or issubclass(v.__class__,type_ok): l.append(k) + # On considère que seul assd indique un type quelconque pas CO + elif self.assd in types_permis : + l.append(k) + elif self.est_permis(v,types_permis): + l.append(k) l.sort() return l + def est_permis(self,v,types_permis): + for type_ok in types_permis: + if type_ok in ('R','I','C','TXM') and v in self.params : + return 1 + elif type_ok == 'R' and v.__class__.__name__ == 'reel' : + return 1 + elif type_ok == 'I' and v.__class__.__name__ == 'entier' : + return 1 + elif type_ok == 'C' and v.__class__.__name__ == 'complexe' : + return 1 + elif type_ok == 'TXM' and v.__class__.__name__ == 'chaine' : + return 1 + elif type(type_ok) != types.ClassType : + continue + elif v.__class__ == type_ok or issubclass(v.__class__,type_ok): + return 1 + return 0 + def addentite(self,name,pos): """ Ajoute une entite : @@ -83,6 +114,7 @@ class JDC(I_OBJECT.OBJECT): if pos == None : pos = 0 self.etapes.insert(pos,objet) self.editmode=0 + self.reset_context() self.active_etapes() return objet elif name == "PARAMETRE_EVAL": @@ -93,6 +125,7 @@ class JDC(I_OBJECT.OBJECT): if pos == None : pos = 0 self.etapes.insert(pos,objet) self.editmode=0 + self.reset_context() self.active_etapes() return objet elif type(name)==types.InstanceType: @@ -100,10 +133,8 @@ class JDC(I_OBJECT.OBJECT): # existante (par copie donc) # on est donc nécessairement en mode editeur ... objet = name - objet.jdc = objet.parent = self - #XXX current_step n'existe plus. A priori le parent devrait etre self - # ainsi que le step courant. - #objet.parent = self.current_step + # Il ne faut pas oublier de reaffecter le parent d'obj (si copie) + objet.reparent(self) self.set_current_step() if isinstance(objet,ETAPE): if objet.nom_niveau_definition == 'JDC': @@ -115,8 +146,12 @@ class JDC(I_OBJECT.OBJECT): objet.parent.dict_niveaux[objet.nom_niveau_definition].register(objet) objet.niveau = objet.parent.dict_niveaux[objet.nom_niveau_definition] self.etapes.insert(pos,objet) + # il faut vérifier que les concepts utilisés par objet existent bien + # à ce niveau d'arborescence + objet.verif_existence_sd() self.active_etapes() self.editmode=0 + self.reset_context() return objet else : # On veut ajouter une nouvelle commande @@ -125,11 +160,13 @@ class JDC(I_OBJECT.OBJECT): cmd=self.get_cmd(name) # L'appel a make_objet n'a pas pour effet d'enregistrer l'étape # auprès du step courant car editmode vaut 1 + # Par contre elle a le bon parent grace a set_current_step e=cmd.make_objet() if pos == None : pos = 0 self.etapes.insert(pos,e) self.reset_current_step() self.editmode=0 + self.reset_context() self.active_etapes() return e except: @@ -151,13 +188,15 @@ class JDC(I_OBJECT.OBJECT): def get_sd_avant_etape(self,nom_sd,etape): return self.get_contexte_avant(etape).get(nom_sd,None) - def get_sd_apres_etape(self,nom_sd,etape): + def get_sd_apres_etape(self,nom_sd,etape,avec='non'): """ Cette méthode retourne la SD de nom nom_sd qui est éventuellement - définie apres etape + définie apres etape + Si avec vaut 'non' exclut etape de la recherche """ ietap=self.etapes.index(etape) - for e in self.etapes[ietap+1:]: + if avec == 'non':ietap=ietap+1 + for e in self.etapes[ietap:]: sd=e.get_sdprods(nom_sd) if sd: if hasattr(e,'reuse'): @@ -165,16 +204,17 @@ class JDC(I_OBJECT.OBJECT): return sd return None - def get_sd_autour_etape(self,nom_sd,etape): + def get_sd_autour_etape(self,nom_sd,etape,avec='non'): """ Fonction: retourne la SD de nom nom_sd qui est éventuellement définie avant ou apres etape Permet de vérifier si un concept de meme nom existe dans le périmètre d'une étape + Si avec vaut 'non' exclut etape de la recherche """ sd=self.get_sd_avant_etape(nom_sd,etape) if sd:return sd - return self.get_sd_apres_etape(nom_sd,etape) + return self.get_sd_apres_etape(nom_sd,etape,avec) def active_etapes(self): """ @@ -267,6 +307,12 @@ class JDC(I_OBJECT.OBJECT): """ self.params.append(param) + def register_fonction(self,fonction): + """ + Cette méthode sert à ajouter une fonction dans la liste des fonctions + """ + self.fonctions.append(fonction) + def delete_param(self,param): """ Supprime le paramètre param de la liste des paramètres @@ -297,6 +343,14 @@ class JDC(I_OBJECT.OBJECT): nom = form.nom if not nom : continue if d.has_key(nom): l_fonctions.append(form.get_formule()) + + # on ajoute les concepts produits par DEFI_VALEUR + # XXX On pourrait peut etre faire plutot le test sur le type + # de concept : entier, reel, complexe, etc. + for k,v in d.items(): + if hasattr(v,'etape') and v.etape.nom in ('DEFI_VALEUR',): + l_constantes.append(k) + # on retourne les deux listes return l_constantes,l_fonctions @@ -373,3 +427,69 @@ class JDC(I_OBJECT.OBJECT): linecache.cache[file]=0,0,string.split(text,'\n'),file return file,text + + def get_genealogie(self): + """ + Retourne la liste des noms des ascendants de l'objet self + jusqu'à la première ETAPE parent. + """ + return [] + + def NommerSdprod(self,sd,sdnom): + """ + Nomme la SD apres avoir verifie que le nommage est possible : nom + non utilise + Si le nom est deja utilise, leve une exception + Met le concept créé dans le concept global g_context + """ + # XXX En mode editeur dans EFICAS, le nommage doit etre géré différemment + # Le dictionnaire g_context ne représente pas le contexte + # effectif avant une étape. + # Il faut utiliser get_contexte_avant avec une indication de l'étape + # traitée. Pour le moment, il n'y a pas de moyen de le faire : ajouter + # un attribut dans le JDC ??? + if CONTEXT.debug : print "JDC.NommerSdprod ",sd,sdnom + if self._etape_context: + o=self.get_contexte_avant(self._etape_context).get(sdnom,None) + else: + o=self.g_context.get(sdnom,None) + if isinstance(o,ASSD): + raise AsException("Nom de concept deja defini : %s" % sdnom) + + # ATTENTION : Il ne faut pas ajouter sd dans sds car il s y trouve deja. + # Ajoute a la creation (appel de reg_sd). + self.g_context[sdnom]=sd + sd.nom=sdnom + + def set_etape_context(self,etape): + """ + Positionne l'etape qui sera utilisee dans NommerSdProd pour + decider si le concept passé pourra etre nommé + """ + self._etape_context=etape + + def reset_context(self): + """ + Cette methode reinitialise le contexte glissant pour pouvoir + tenir compte des modifications de l'utilisateur : création + de commandes, nommage de concepts, etc. + """ + self.current_context={} + self.index_etape_courante=0 + + def del_param(self,param): + """ + Supprime le paramètre param de la liste des paramètres + et du contexte gobal + """ + if param in self.params : self.params.remove(param) + if self.g_context.has_key(param.nom) : del self.g_context[param.nom] + + def del_fonction(self,fonction): + """ + Supprime la fonction fonction de la liste des fonctions + et du contexte gobal + """ + if fonction in self.fonctions : self.fonctions.remove(fonction) + if self.g_context.has_key(fonction.nom) : del self.g_context[fonction.nom] + diff --git a/Ihm/I_JDC_CATA.py b/Ihm/I_JDC_CATA.py index 945ced80..751cacda 100644 --- a/Ihm/I_JDC_CATA.py +++ b/Ihm/I_JDC_CATA.py @@ -1,3 +1,22 @@ +# CONFIGURATION MANAGEMENT OF EDF VERSION +# ====================================================================== +# COPYRIGHT (C) 1991 - 2002 EDF R&D WWW.CODE-ASTER.ORG +# THIS PROGRAM IS FREE SOFTWARE; YOU CAN REDISTRIBUTE IT AND/OR MODIFY +# IT UNDER THE TERMS OF THE GNU GENERAL PUBLIC LICENSE AS PUBLISHED BY +# THE FREE SOFTWARE FOUNDATION; EITHER VERSION 2 OF THE LICENSE, OR +# (AT YOUR OPTION) ANY LATER VERSION. +# +# THIS PROGRAM IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL, BUT +# WITHOUT ANY WARRANTY; WITHOUT EVEN THE IMPLIED WARRANTY OF +# MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. SEE THE GNU +# GENERAL PUBLIC LICENSE FOR MORE DETAILS. +# +# YOU SHOULD HAVE RECEIVED A COPY OF THE GNU GENERAL PUBLIC LICENSE +# ALONG WITH THIS PROGRAM; IF NOT, WRITE TO EDF R&D CODE_ASTER, +# 1 AVENUE DU GENERAL DE GAULLE, 92141 CLAMART CEDEX, FRANCE. +# +# +# ====================================================================== from Noyau import N_JDC_CATA class JDC_CATA: diff --git a/Ihm/I_MACRO_ETAPE.py b/Ihm/I_MACRO_ETAPE.py index be318d25..e2aa3f89 100644 --- a/Ihm/I_MACRO_ETAPE.py +++ b/Ihm/I_MACRO_ETAPE.py @@ -1,3 +1,22 @@ +# CONFIGURATION MANAGEMENT OF EDF VERSION +# ====================================================================== +# COPYRIGHT (C) 1991 - 2002 EDF R&D WWW.CODE-ASTER.ORG +# THIS PROGRAM IS FREE SOFTWARE; YOU CAN REDISTRIBUTE IT AND/OR MODIFY +# IT UNDER THE TERMS OF THE GNU GENERAL PUBLIC LICENSE AS PUBLISHED BY +# THE FREE SOFTWARE FOUNDATION; EITHER VERSION 2 OF THE LICENSE, OR +# (AT YOUR OPTION) ANY LATER VERSION. +# +# THIS PROGRAM IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL, BUT +# WITHOUT ANY WARRANTY; WITHOUT EVEN THE IMPLIED WARRANTY OF +# MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. SEE THE GNU +# GENERAL PUBLIC LICENSE FOR MORE DETAILS. +# +# YOU SHOULD HAVE RECEIVED A COPY OF THE GNU GENERAL PUBLIC LICENSE +# ALONG WITH THIS PROGRAM; IF NOT, WRITE TO EDF R&D CODE_ASTER, +# 1 AVENUE DU GENERAL DE GAULLE, 92141 CLAMART CEDEX, FRANCE. +# +# +# ====================================================================== """ """ # Modules Python @@ -7,10 +26,19 @@ import traceback,types,string import I_ETAPE from Noyau.N_ASSD import ASSD +# import rajoutés suite à l'ajout de Build_sd --> à résorber +import Noyau +from Noyau import N_Exception +from Noyau.N_Exception import AsException +# fin import à résorber + class MACRO_ETAPE(I_ETAPE.ETAPE): def __init__(self): I_ETAPE.ETAPE.__init__(self) + # XXX CCAR : ne suis pas certain que typret doive etre + # initialise à None (a verifier) + self.typret=None def get_sdprods(self,nom_sd): """ @@ -61,6 +89,10 @@ class MACRO_ETAPE(I_ETAPE.ETAPE): context_ini = context_ini, appli=self.jdc.appli) j.analyse() + # XXX en passant par un jdc auxiliaire, on risque de rendre les etapes inactives + # on les force dans l'etat actif + for etape in j.etapes: + etape.active() except: traceback.print_exc() return None @@ -146,3 +178,52 @@ class MACRO_ETAPE(I_ETAPE.ETAPE): # On met g_context à blanc self.g_context={} + def Build_sd(self,nom): + """ + Construit le concept produit de l'opérateur. Deux cas + peuvent se présenter : + + - le parent n'est pas défini. Dans ce cas, l'étape prend en charge + la création et le nommage du concept. + + - le parent est défini. Dans ce cas, l'étape demande au parent la + création et le nommage du concept. + + """ + if not self.isactif():return + # CCAR : meme modification que dans I_ETAPE + if not self.isvalid(sd='non') : return + else:self.state='undetermined' + self.sdnom=nom + try: + # On positionne la macro self en tant que current_step pour que les + # étapes créées lors de l'appel à sd_prod et à op_init aient la macro + # comme parent + self.set_current_step() + if self.parent: + sd= self.parent.create_sdprod(self,nom) + if type(self.definition.op_init) == types.FunctionType: + apply(self.definition.op_init,(self,self.parent.g_context)) + else: + sd=self.get_sd_prod() + if sd != None and self.reuse == None: + # On ne nomme le concept que dans le cas de non reutilisation + # d un concept + sd.nom=nom + self.reset_current_step() + if self.jdc and self.jdc.par_lot == "NON" : + self.Execute() + return sd + except AsException,e: + self.reset_current_step() + raise AsException("Etape ",self.nom,'ligne : ',self.appel[0], + 'fichier : ',self.appel[1],e) + except EOFError: + #self.reset_current_step() + raise + except : + self.reset_current_step() + l=traceback.format_exception(sys.exc_info()[0],sys.exc_info()[1],sys.exc_info()[2]) + raise AsException("Etape ",self.nom,'ligne : ',self.appel[0], + 'fichier : ',self.appel[1]+'\n', + string.join(l)) diff --git a/Ihm/I_MCBLOC.py b/Ihm/I_MCBLOC.py index 7b8281d8..7b548225 100644 --- a/Ihm/I_MCBLOC.py +++ b/Ihm/I_MCBLOC.py @@ -1,3 +1,22 @@ +# CONFIGURATION MANAGEMENT OF EDF VERSION +# ====================================================================== +# COPYRIGHT (C) 1991 - 2002 EDF R&D WWW.CODE-ASTER.ORG +# THIS PROGRAM IS FREE SOFTWARE; YOU CAN REDISTRIBUTE IT AND/OR MODIFY +# IT UNDER THE TERMS OF THE GNU GENERAL PUBLIC LICENSE AS PUBLISHED BY +# THE FREE SOFTWARE FOUNDATION; EITHER VERSION 2 OF THE LICENSE, OR +# (AT YOUR OPTION) ANY LATER VERSION. +# +# THIS PROGRAM IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL, BUT +# WITHOUT ANY WARRANTY; WITHOUT EVEN THE IMPLIED WARRANTY OF +# MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. SEE THE GNU +# GENERAL PUBLIC LICENSE FOR MORE DETAILS. +# +# YOU SHOULD HAVE RECEIVED A COPY OF THE GNU GENERAL PUBLIC LICENSE +# ALONG WITH THIS PROGRAM; IF NOT, WRITE TO EDF R&D CODE_ASTER, +# 1 AVENUE DU GENERAL DE GAULLE, 92141 CLAMART CEDEX, FRANCE. +# +# +# ====================================================================== import I_MCCOMPO class MCBLOC(I_MCCOMPO.MCCOMPO): def makeobjet(self): diff --git a/Ihm/I_MCCOMPO.py b/Ihm/I_MCCOMPO.py index 24f71cca..3c6e8c9e 100644 --- a/Ihm/I_MCCOMPO.py +++ b/Ihm/I_MCCOMPO.py @@ -1,3 +1,22 @@ +# CONFIGURATION MANAGEMENT OF EDF VERSION +# ====================================================================== +# COPYRIGHT (C) 1991 - 2002 EDF R&D WWW.CODE-ASTER.ORG +# THIS PROGRAM IS FREE SOFTWARE; YOU CAN REDISTRIBUTE IT AND/OR MODIFY +# IT UNDER THE TERMS OF THE GNU GENERAL PUBLIC LICENSE AS PUBLISHED BY +# THE FREE SOFTWARE FOUNDATION; EITHER VERSION 2 OF THE LICENSE, OR +# (AT YOUR OPTION) ANY LATER VERSION. +# +# THIS PROGRAM IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL, BUT +# WITHOUT ANY WARRANTY; WITHOUT EVEN THE IMPLIED WARRANTY OF +# MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. SEE THE GNU +# GENERAL PUBLIC LICENSE FOR MORE DETAILS. +# +# YOU SHOULD HAVE RECEIVED A COPY OF THE GNU GENERAL PUBLIC LICENSE +# ALONG WITH THIS PROGRAM; IF NOT, WRITE TO EDF R&D CODE_ASTER, +# 1 AVENUE DU GENERAL DE GAULLE, 92141 CLAMART CEDEX, FRANCE. +# +# +# ====================================================================== """ """ import string,types @@ -25,24 +44,6 @@ class MCCOMPO(I_OBJECT.OBJECT): else: return self.nom - def get_genealogie(self): - """ - Retourne la liste des noms des ascendants (noms de MCSIMP,MCFACT,MCBLOC - ou ETAPE) de self jusqu'au premier objet etape rencontré - """ - l=[] - objet = self - while objet.definition.label != 'JDC' : - if not objet.isMCList() : - l.append(string.strip(objet.nom)) - else : - pass - # Si objet.etape == etape c'est que objet est l'étape origine de la généalogie - if objet.etape == objet: break - objet = objet.parent - l.reverse() - return l - def get_liste_mc_ordonnee(self,liste,dico): """ Retourne la liste ordonnée (suivant le catalogue) des mots-clés @@ -113,6 +114,20 @@ class MCCOMPO(I_OBJECT.OBJECT): liste.remove(k) if self.definition.entites[k].label=='BLOC': liste.remove(k) + # Pour corriger les exces qui pourraient etre commis dans la methode purge_liste + # des regles, on essaie de compenser comme suit : + # on ajoute les mots cles facteurs presents dont l'occurence n'est pas atteinte + for k in liste_mc_presents: + if k in liste:continue + objet = self.get_child(k,restreint = 'oui') + if isinstance(objet,MCFACT): + # un mot-clé facteur ne peut pas être répété plus de self.max fois + if objet.definition.max > 1: + liste.append(k) + elif isinstance(objet,MCList): + nb_occur_maxi = objet[0].definition.max + if len(objet) < nb_occur_maxi: + liste.append(k) return liste def liste_mc_presents(self): @@ -178,6 +193,7 @@ class MCCOMPO(I_OBJECT.OBJECT): """ self.init_modif() if type(name)==types.StringType : + # on est en mode création d'un motcle if self.ispermis(name) == 0 : return 0 objet=self.definition.entites[name](val=None,nom=name,parent=self) if hasattr(objet.definition,'position'): @@ -186,7 +202,9 @@ class MCCOMPO(I_OBJECT.OBJECT): elif objet.definition.position == 'global_jdc' : self.append_mc_global_jdc(objet) else : + # dans ce cas on est en mode copie d'un motcle objet = name + objet.verif_existence_sd() # si un objet de même nom est déjà présent dans la liste # et si l'objet est répétable # il faut créer une MCList et remplacer l'objet de la liste @@ -219,6 +237,8 @@ class MCCOMPO(I_OBJECT.OBJECT): new_obj.init(objet.nom,self) new_obj.append(old_obj) new_obj.append(objet) + # Il ne faut pas oublier de reaffecter le parent d'obj + objet.reparent(self) self.mc_liste.remove(old_obj) self.mc_liste.insert(index,new_obj) self.fin_modif() @@ -227,12 +247,16 @@ class MCCOMPO(I_OBJECT.OBJECT): # une liste d'objets de même type existe déjà #print "une liste d'objets de même type existe déjà" old_obj.append(objet) + # Il ne faut pas oublier de reaffecter le parent d'obj + objet.reparent(self) self.fin_modif() return old_obj if pos == None : self.mc_liste.append(objet) else : self.mc_liste.insert(pos,objet) + # Il ne faut pas oublier de reaffecter le parent d'obj (si copie) + objet.reparent(self) self.fin_modif() return objet @@ -304,11 +328,18 @@ class MCCOMPO(I_OBJECT.OBJECT): def copy(self): """ Retourne une copie de self """ objet = self.makeobjet() + # FR : attention !!! avec makeobjet, objet a le même parent que self + # ce qui n'est pas du tout bon dans le cas d'une copie !!!!!!! + # FR : peut-on passer par là autrement que dans le cas d'une copie ??? + # FR --> je suppose que non + # XXX CCAR : le pb c'est qu'on vérifie ensuite quel parent avait l'objet + # Il me semble preferable de changer le parent a la fin quand la copie est acceptee objet.valeur = copy(self.valeur) objet.val = copy(self.val) objet.mc_liste=[] for obj in self.mc_liste: new_obj = obj.copy() + new_obj.reparent(objet) objet.mc_liste.append(new_obj) return objet @@ -333,9 +364,9 @@ class MCCOMPO(I_OBJECT.OBJECT): for child in self.mc_liste : if child.isvalid() : continue l_child = child.get_liste_mc_inconnus() - if l_child : + for mc in l_child: l = [self] - l.extend(l_child) + l.extend(mc) l_mc.append(l) return l_mc @@ -351,9 +382,9 @@ class MCCOMPO(I_OBJECT.OBJECT): liste_retraits = [] dict = self.cree_dict_valeurs(self.mc_liste) for k,v in self.definition.entites.items(): - #dict = self.cree_dict_valeurs(self.mc_liste) if v.label=='BLOC' : - if v.verif_presence(dict) : + globs= self.jdc and self.jdc.condition_context or {} + if v.verif_presence(dict,globs): # le bloc doit être présent if not self.get_child(k,restreint = 'oui'): # le bloc n'est pas présent et il doit être créé @@ -365,3 +396,20 @@ class MCCOMPO(I_OBJECT.OBJECT): liste_retraits.append(k) return liste_ajouts,liste_retraits + def reparent(self,parent): + """ + Cette methode sert a reinitialiser la parente de l'objet + """ + self.parent=parent + self.jdc=parent.get_jdc_root() + self.etape=parent.etape + for mocle in self.mc_liste: + mocle.reparent(self) + + def verif_existence_sd(self): + """ + Vérifie que les structures de données utilisées dans self existent bien dans le contexte + avant étape, sinon enlève la référence à ces concepts + """ + for motcle in self.mc_liste : + motcle.verif_existence_sd() diff --git a/Ihm/I_MCFACT.py b/Ihm/I_MCFACT.py index 08ab1f16..39670364 100644 --- a/Ihm/I_MCFACT.py +++ b/Ihm/I_MCFACT.py @@ -1,3 +1,22 @@ +# CONFIGURATION MANAGEMENT OF EDF VERSION +# ====================================================================== +# COPYRIGHT (C) 1991 - 2002 EDF R&D WWW.CODE-ASTER.ORG +# THIS PROGRAM IS FREE SOFTWARE; YOU CAN REDISTRIBUTE IT AND/OR MODIFY +# IT UNDER THE TERMS OF THE GNU GENERAL PUBLIC LICENSE AS PUBLISHED BY +# THE FREE SOFTWARE FOUNDATION; EITHER VERSION 2 OF THE LICENSE, OR +# (AT YOUR OPTION) ANY LATER VERSION. +# +# THIS PROGRAM IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL, BUT +# WITHOUT ANY WARRANTY; WITHOUT EVEN THE IMPLIED WARRANTY OF +# MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. SEE THE GNU +# GENERAL PUBLIC LICENSE FOR MORE DETAILS. +# +# YOU SHOULD HAVE RECEIVED A COPY OF THE GNU GENERAL PUBLIC LICENSE +# ALONG WITH THIS PROGRAM; IF NOT, WRITE TO EDF R&D CODE_ASTER, +# 1 AVENUE DU GENERAL DE GAULLE, 92141 CLAMART CEDEX, FRANCE. +# +# +# ====================================================================== import I_MCCOMPO class MCFACT(I_MCCOMPO.MCCOMPO): def isrepetable(self): diff --git a/Ihm/I_MCLIST.py b/Ihm/I_MCLIST.py index c08a3834..4da0f20f 100644 --- a/Ihm/I_MCLIST.py +++ b/Ihm/I_MCLIST.py @@ -1,3 +1,22 @@ +# CONFIGURATION MANAGEMENT OF EDF VERSION +# ====================================================================== +# COPYRIGHT (C) 1991 - 2002 EDF R&D WWW.CODE-ASTER.ORG +# THIS PROGRAM IS FREE SOFTWARE; YOU CAN REDISTRIBUTE IT AND/OR MODIFY +# IT UNDER THE TERMS OF THE GNU GENERAL PUBLIC LICENSE AS PUBLISHED BY +# THE FREE SOFTWARE FOUNDATION; EITHER VERSION 2 OF THE LICENSE, OR +# (AT YOUR OPTION) ANY LATER VERSION. +# +# THIS PROGRAM IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL, BUT +# WITHOUT ANY WARRANTY; WITHOUT EVEN THE IMPLIED WARRANTY OF +# MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. SEE THE GNU +# GENERAL PUBLIC LICENSE FOR MORE DETAILS. +# +# YOU SHOULD HAVE RECEIVED A COPY OF THE GNU GENERAL PUBLIC LICENSE +# ALONG WITH THIS PROGRAM; IF NOT, WRITE TO EDF R&D CODE_ASTER, +# 1 AVENUE DU GENERAL DE GAULLE, 92141 CLAMART CEDEX, FRANCE. +# +# +# ====================================================================== from copy import copy class MCList: @@ -28,9 +47,13 @@ class MCList: return 0 def isoblig(self): - for i in self.data: - if i.isoblig():return 1 - return 0 + """ + Une MCList n'est jamais obligatoire (même si le MCFACT qu'elle représente l'est + """ + return 0 + #for i in self.data: + # if i.isoblig():return 1 + #return 0 def liste_mc_presents(self): return [] @@ -49,11 +72,17 @@ class MCList: child.delete_concept(sd) def copy(self): + """ + Réalise la copie d'une MCList + """ liste = self.data[0].definition.list_instance() - # XXX Pas de parent ?? - liste.init(self.nom) + # FR -->Il faut spécifier un parent pour la méthode init qui attend 2 arguments ... + liste.init(self.nom,self.parent) for objet in self: new_obj = objet.copy() + # Pour etre coherent avec le constructeur de mots cles facteurs N_FACT.__call__ + # dans lequel le parent de l'element d'une MCList est le parent de la MCList + new_obj.reparent(self.parent) liste.append(new_obj) return liste @@ -68,10 +97,10 @@ class MCList: for mcfact in self.data : if mcfact.isvalid() : continue l_child = mcfact.get_liste_mc_inconnus() - if l_child : - l = [self] - l.extend(l_child) - l_mc.append(l) + for mc in l_child: + l = [self] + l.extend(mc) + l_mc.append(l) return l_mc def verif_condition_regles(self,liste_presents): @@ -93,3 +122,82 @@ class MCList: # Sans objet pour une liste de mots clés facteurs return [],[] + def init_modif(self): + """ + Met l'état de l'objet à modified et propage au parent + qui vaut None s'il n'existe pas + """ + self.state = 'modified' + if self.parent: + self.parent.init_modif() + + def get_etape(self): + """ + Retourne l'étape à laquelle appartient self + Un objet de la catégorie etape doit retourner self pour indiquer que + l'étape a été trouvée + XXX double emploi avec self.etape ??? + """ + if self.parent == None: return None + return self.parent.get_etape() + + def get_genealogie(self): + """ + Retourne la liste des noms des ascendants. + Un objet MCList n'est pas enregistré dans la genealogie. + XXX Meme si le MCFACT fils ne l'est pas lui non plus ???? + """ + if self.parent: + return self.parent.get_genealogie() + else: + return [] + + def get_liste_mc_ordonnee_brute(self,liste,dico): + """ + Retourne la liste ordonnée (suivant le catalogue) BRUTE des mots-clés + d'une entité composée dont le chemin complet est donné sous forme + d'une liste du type :ETAPE + MCFACT ou MCBLOC + ... + """ + for arg in liste: + objet_cata = dico[arg] + dico=objet_cata.dico + return objet_cata.liste + + def reparent(self,parent): + """ + Cette methode sert a reinitialiser la parente de l'objet + """ + self.parent=parent + self.jdc=parent.jdc + self.etape=parent.etape + for mcfact in self.data: + mcfact.reparent(parent) + + def verif_existence_sd(self): + """ + Vérifie que les structures de données utilisées dans self existent bien dans le contexte + avant étape, sinon enlève la référence à ces concepts + """ + for motcle in self.data : + motcle.verif_existence_sd() + + def get_sd_utilisees(self): + """ + Retourne la liste des concepts qui sont utilisés à l'intérieur de self + ( comme valorisation d'un MCS) + """ + l=[] + for motcle in self.data: + l.extend(motcle.get_sd_utilisees()) + return l + + def get_fr(self): + """ + Retourne la chaine d'aide contenue dans le catalogue + en tenant compte de la langue + """ + try : + return self.data[0].get_fr() + except: + return '' + diff --git a/Ihm/I_MCSIMP.py b/Ihm/I_MCSIMP.py index 96fe6ccd..ca1bafa3 100644 --- a/Ihm/I_MCSIMP.py +++ b/Ihm/I_MCSIMP.py @@ -1,3 +1,22 @@ +# CONFIGURATION MANAGEMENT OF EDF VERSION +# ====================================================================== +# COPYRIGHT (C) 1991 - 2002 EDF R&D WWW.CODE-ASTER.ORG +# THIS PROGRAM IS FREE SOFTWARE; YOU CAN REDISTRIBUTE IT AND/OR MODIFY +# IT UNDER THE TERMS OF THE GNU GENERAL PUBLIC LICENSE AS PUBLISHED BY +# THE FREE SOFTWARE FOUNDATION; EITHER VERSION 2 OF THE LICENSE, OR +# (AT YOUR OPTION) ANY LATER VERSION. +# +# THIS PROGRAM IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL, BUT +# WITHOUT ANY WARRANTY; WITHOUT EVEN THE IMPLIED WARRANTY OF +# MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. SEE THE GNU +# GENERAL PUBLIC LICENSE FOR MORE DETAILS. +# +# YOU SHOULD HAVE RECEIVED A COPY OF THE GNU GENERAL PUBLIC LICENSE +# ALONG WITH THIS PROGRAM; IF NOT, WRITE TO EDF R&D CODE_ASTER, +# 1 AVENUE DU GENERAL DE GAULLE, 92141 CLAMART CEDEX, FRANCE. +# +# +# ====================================================================== import types,string import traceback from copy import copy @@ -7,10 +26,21 @@ myrepr.maxstring = 100 myrepr.maxother = 100 from Noyau.N_utils import repr_float + +# Attention : les classes ASSD,.... peuvent etre surchargées +# dans le package Accas. Il faut donc prendre des précautions si +# on utilise les classes du Noyau pour faire des tests (isxxxx, ...) +# Si on veut créer des objets comme des CO avec les classes du noyau +# ils n'auront pas les conportements des autres packages (pb!!!) +# Il vaut mieux les importer d'Accas mais problème d'import circulaire, +# on ne peut pas les importer au début. +# On fait donc un import local quand c'est nécessaire (peut occasionner +# des pbs de prformance). from Noyau.N_ASSD import ASSD,assd from Noyau.N_GEOM import GEOM,geom from Noyau.N_CO import CO -from Noyau.N_EVAL import EVAL +# fin attention + from Extensions import parametre import I_OBJECT @@ -23,13 +53,17 @@ class MCSIMP(I_OBJECT.OBJECT): if self.valeur == None : return None elif type(self.valeur) == types.FloatType : - txt = repr_float(self.valeur) + #txt = repr_float(self.valeur) + # Normalement str fait un travail correct + txt = str(self.valeur) elif type(self.valeur) in (types.ListType,types.TupleType) : txt='(' i=0 for val in self.valeur: if type(val) == types.FloatType : - txt=txt + i*',' + repr_float(val) + # Normalement str fait un travail correct + #txt=txt + i*',' + repr_float(val) + txt=txt + i*',' + str(val) elif type(val) == types.InstanceType and isinstance(val,ASSD): txt = txt + i*',' + val.get_name() else: @@ -43,8 +77,16 @@ class MCSIMP(I_OBJECT.OBJECT): if isinstance(txt,parametre.PARAMETRE): return str(txt) return repr(txt) - # il faut tronquer txt au delà d'un certain nombre de caractères - # et avant tout retour chariot (txt peut être une chaîne de caractères + # txt peut etre une longue chaine sur plusieurs lignes. + # Il est possible de tronquer cette chaine au premier \n et + # de limiter la longueur de la chaine a 30 caracteres. Cependant + # ceci provoque une perte d'information pour l'utilisateur + # Pour le moment on retourne la chaine telle que + return txt + + # Partie de code inaccessible (pour memoire) + # txt est tronquee au dela d'un certain nombre de caractères + # et avant tout retour chariot (txt peut etre une chaine de caractères # sur plusieurs lignes (ex:shell) txt = string.split(txt,'\n')[0] if len(txt) < 30 : @@ -82,7 +124,8 @@ class MCSIMP(I_OBJECT.OBJECT): """ for typ in self.definition.type: if type(typ) == types.ClassType : - if typ is CO : return 1 + if issubclass(typ,CO) : + return 1 return 0 def wait_assd(self): @@ -104,7 +147,7 @@ class MCSIMP(I_OBJECT.OBJECT): """ for typ in self.definition.type: if type(typ) == types.ClassType : - if typ in (GEOM,ASSD,geom,assd) or issubclass(typ,GEOM) : + if typ.__name__ in ("GEOM","ASSD","geom","assd") or issubclass(typ,GEOM) : return 1 return 0 @@ -165,6 +208,8 @@ class MCSIMP(I_OBJECT.OBJECT): # type de nom new_valeur if self.wait_co(): try: + # Pour avoir la classe CO avec tous ses comportements + from Accas import CO self.valeur=CO(new_valeur) except: traceback.print_exc() @@ -204,6 +249,8 @@ class MCSIMP(I_OBJECT.OBJECT): return sd,1 else: d={} + # On veut EVAL avec tous ses comportements. On utilise Accas. Perfs ?? + from Accas import EVAL d['EVAL']=EVAL try : objet = eval(new_valeur,d) @@ -238,9 +285,13 @@ class MCSIMP(I_OBJECT.OBJECT): def copy(self): """ Retourne une copie de self """ objet = self.makeobjet() - #XXX est ce utile ?? - objet.valeur = copy(self.valeur) - objet.val = copy(self.val) + # il faut copier les listes et les tuples mais pas les autres valeurs + # possibles (réel,SD,...) + if type(self.valeur) in (types.ListType,types.TupleType): + objet.valeur = copy(self.valeur) + else: + objet.valeur = self.valeur + objet.val = objet.valeur return objet def makeobjet(self): @@ -257,3 +308,100 @@ class MCSIMP(I_OBJECT.OBJECT): if issubclass(self.valeur.__class__,ASSD) : l.append(self.valeur) return l + + def set_valeur_co(self,nom_co): + """ + Affecte à self l'objet de type CO et de nom nom_co + """ + step=self.etape.parent + if nom_co == None or nom_co == '': + new_objet=None + else: + # Pour le moment on importe en local le CO de Accas. + # Si problème de perfs, il faudra faire autrement + from Accas import CO + # Avant de créer un concept il faut s'assurer du contexte : step + # courant + sd= step.get_sd_autour_etape(nom_co,self.etape,avec='oui') + if sd: + # Si un concept du meme nom existe deja dans la portée de l'étape + # on ne crée pas le concept + return 0,"un concept de meme nom existe deja" + # Il n'existe pas de concept de meme nom. On peut donc le créer + # Il faut néanmoins que la méthode NommerSdProd de step gère les + # contextes en mode editeur + # Normalement la méthode du Noyau doit etre surchargée + # On déclare l'étape du mot clé comme etape courante pour NommerSdprod + cs= CONTEXT.get_current_step() + CONTEXT.unset_current_step() + CONTEXT.set_current_step(step) + step.set_etape_context(self.etape) + new_objet = CO(nom_co) + CONTEXT.unset_current_step() + CONTEXT.set_current_step(cs) + self.valeur = new_objet + self.val = new_objet + self.init_modif() + step.reset_context() + # On force l'enregistrement de new_objet en tant que concept produit + # de la macro en appelant get_type_produit avec force=1 + self.etape.get_type_produit(force=1) + return 1,"Concept créé" + + def reparent(self,parent): + """ + Cette methode sert a reinitialiser la parente de l'objet + """ + self.parent=parent + self.jdc=parent.jdc + self.etape=parent.etape + + def verif_existence_sd(self): + """ + Vérifie que les structures de données utilisées dans self existent bien dans le contexte + avant étape, sinon enlève la référence à ces concepts + """ + l_sd_avant_etape = self.jdc.get_contexte_avant(self.etape).values() + if type(self.valeur) in (types.TupleType,types.ListType) : + l=[] + for sd in self.valeur: + if isinstance(sd,ASSD) : + if sd in l_sd_avant_etape : + l.append(sd) + else: + l.append(sd) + self.valeur=l + self.init_modif() + else: + if isinstance(self.valeur,ASSD) : + if self.valeur not in l_sd_avant_etape : + self.valeur = None + self.init_modif() + + + def get_min_max(self): + """ + Retourne les valeurs min et max admissibles pour la valeur de self + """ + return self.definition.min,self.definition.max + + + def get_type(self): + """ + Retourne le type attendu par le mot-clé simple + """ + return self.definition.type + + + + + + + + + + + + + + diff --git a/Ihm/I_OBJECT.py b/Ihm/I_OBJECT.py index 559ebcd5..23feeefc 100644 --- a/Ihm/I_OBJECT.py +++ b/Ihm/I_OBJECT.py @@ -1,7 +1,33 @@ +# CONFIGURATION MANAGEMENT OF EDF VERSION +# ====================================================================== +# COPYRIGHT (C) 1991 - 2002 EDF R&D WWW.CODE-ASTER.ORG +# THIS PROGRAM IS FREE SOFTWARE; YOU CAN REDISTRIBUTE IT AND/OR MODIFY +# IT UNDER THE TERMS OF THE GNU GENERAL PUBLIC LICENSE AS PUBLISHED BY +# THE FREE SOFTWARE FOUNDATION; EITHER VERSION 2 OF THE LICENSE, OR +# (AT YOUR OPTION) ANY LATER VERSION. +# +# THIS PROGRAM IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL, BUT +# WITHOUT ANY WARRANTY; WITHOUT EVEN THE IMPLIED WARRANTY OF +# MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. SEE THE GNU +# GENERAL PUBLIC LICENSE FOR MORE DETAILS. +# +# YOU SHOULD HAVE RECEIVED A COPY OF THE GNU GENERAL PUBLIC LICENSE +# ALONG WITH THIS PROGRAM; IF NOT, WRITE TO EDF R&D CODE_ASTER, +# 1 AVENUE DU GENERAL DE GAULLE, 92141 CLAMART CEDEX, FRANCE. +# +# +# ====================================================================== """ """ +import string + +import prefs +import Noyau class OBJECT: + from Noyau.N_CO import CO + from Noyau.N_ASSD import assd + def isMCList(self): """ Retourne 1 si self est une MCList (liste de mots-clés), @@ -80,4 +106,33 @@ class OBJECT: """ return [],[] + def get_genealogie(self): + """ + Retourne la liste des noms des ascendants (noms de MCSIMP,MCFACT,MCBLOC + ou ETAPE) de self jusqu'au premier objet etape rencontré + """ + if self.parent: + l=self.parent.get_genealogie() + l.append(string.strip(self.nom)) + return l + else: + return [string.strip(self.nom)] + + def reparent(self,parent): + """ + Cette methode sert a reinitialiser la parente de l'objet + """ + self.parent=parent + self.jdc=parent.jdc + + def get_fr(self): + """ + Retourne la chaine d'aide contenue dans le catalogue + en tenant compte de la langue + """ + try : + return getattr(self.definition,prefs.lang) + except: + return '' + diff --git a/Ihm/I_PRESENT_ABSENT.py b/Ihm/I_PRESENT_ABSENT.py index 5ddd4a80..796d777a 100644 --- a/Ihm/I_PRESENT_ABSENT.py +++ b/Ihm/I_PRESENT_ABSENT.py @@ -1,3 +1,22 @@ +# CONFIGURATION MANAGEMENT OF EDF VERSION +# ====================================================================== +# COPYRIGHT (C) 1991 - 2002 EDF R&D WWW.CODE-ASTER.ORG +# THIS PROGRAM IS FREE SOFTWARE; YOU CAN REDISTRIBUTE IT AND/OR MODIFY +# IT UNDER THE TERMS OF THE GNU GENERAL PUBLIC LICENSE AS PUBLISHED BY +# THE FREE SOFTWARE FOUNDATION; EITHER VERSION 2 OF THE LICENSE, OR +# (AT YOUR OPTION) ANY LATER VERSION. +# +# THIS PROGRAM IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL, BUT +# WITHOUT ANY WARRANTY; WITHOUT EVEN THE IMPLIED WARRANTY OF +# MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. SEE THE GNU +# GENERAL PUBLIC LICENSE FOR MORE DETAILS. +# +# YOU SHOULD HAVE RECEIVED A COPY OF THE GNU GENERAL PUBLIC LICENSE +# ALONG WITH THIS PROGRAM; IF NOT, WRITE TO EDF R&D CODE_ASTER, +# 1 AVENUE DU GENERAL DE GAULLE, 92141 CLAMART CEDEX, FRANCE. +# +# +# ====================================================================== """ """ @@ -9,8 +28,9 @@ class PRESENT_ABSENT(I_REGLE.REGLE): if self.mcs[0] in liste_mc_presents:regle_active=1 if not regle_active : return liste_a_purger - for mc in self.mcs: - if mc in liste_a_purger: + # Il ne faut pas purger le mot cle present + for mc in self.mcs[1:]: + if mc in liste_a_purger : liste_a_purger.remove(mc) return liste_a_purger diff --git a/Ihm/I_PRESENT_PRESENT.py b/Ihm/I_PRESENT_PRESENT.py index e6a841e3..fbd6f681 100644 --- a/Ihm/I_PRESENT_PRESENT.py +++ b/Ihm/I_PRESENT_PRESENT.py @@ -1,3 +1,22 @@ +# CONFIGURATION MANAGEMENT OF EDF VERSION +# ====================================================================== +# COPYRIGHT (C) 1991 - 2002 EDF R&D WWW.CODE-ASTER.ORG +# THIS PROGRAM IS FREE SOFTWARE; YOU CAN REDISTRIBUTE IT AND/OR MODIFY +# IT UNDER THE TERMS OF THE GNU GENERAL PUBLIC LICENSE AS PUBLISHED BY +# THE FREE SOFTWARE FOUNDATION; EITHER VERSION 2 OF THE LICENSE, OR +# (AT YOUR OPTION) ANY LATER VERSION. +# +# THIS PROGRAM IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL, BUT +# WITHOUT ANY WARRANTY; WITHOUT EVEN THE IMPLIED WARRANTY OF +# MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. SEE THE GNU +# GENERAL PUBLIC LICENSE FOR MORE DETAILS. +# +# YOU SHOULD HAVE RECEIVED A COPY OF THE GNU GENERAL PUBLIC LICENSE +# ALONG WITH THIS PROGRAM; IF NOT, WRITE TO EDF R&D CODE_ASTER, +# 1 AVENUE DU GENERAL DE GAULLE, 92141 CLAMART CEDEX, FRANCE. +# +# +# ====================================================================== """ """ diff --git a/Ihm/I_PROC_ETAPE.py b/Ihm/I_PROC_ETAPE.py index ddfdabeb..81d6c810 100644 --- a/Ihm/I_PROC_ETAPE.py +++ b/Ihm/I_PROC_ETAPE.py @@ -1,4 +1,32 @@ +# CONFIGURATION MANAGEMENT OF EDF VERSION +# ====================================================================== +# COPYRIGHT (C) 1991 - 2002 EDF R&D WWW.CODE-ASTER.ORG +# THIS PROGRAM IS FREE SOFTWARE; YOU CAN REDISTRIBUTE IT AND/OR MODIFY +# IT UNDER THE TERMS OF THE GNU GENERAL PUBLIC LICENSE AS PUBLISHED BY +# THE FREE SOFTWARE FOUNDATION; EITHER VERSION 2 OF THE LICENSE, OR +# (AT YOUR OPTION) ANY LATER VERSION. +# +# THIS PROGRAM IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL, BUT +# WITHOUT ANY WARRANTY; WITHOUT EVEN THE IMPLIED WARRANTY OF +# MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. SEE THE GNU +# GENERAL PUBLIC LICENSE FOR MORE DETAILS. +# +# YOU SHOULD HAVE RECEIVED A COPY OF THE GNU GENERAL PUBLIC LICENSE +# ALONG WITH THIS PROGRAM; IF NOT, WRITE TO EDF R&D CODE_ASTER, +# 1 AVENUE DU GENERAL DE GAULLE, 92141 CLAMART CEDEX, FRANCE. +# +# +# ====================================================================== import I_ETAPE + + +# import rajoutés suite à l'ajout de Build_sd --> à résorber +import traceback,types +import Noyau +from Noyau import N_Exception +from Noyau.N_Exception import AsException +# fin import à résorber + class PROC_ETAPE(I_ETAPE.ETAPE): def get_sdname(self): return "" @@ -24,3 +52,30 @@ class PROC_ETAPE(I_ETAPE.ETAPE): for child in self.mc_liste : child.delete_concept(sd) + def Build_sd(self): + """ + Cette methode applique la fonction op_init au contexte du parent + et lance l'exécution en cas de traitement commande par commande + Elle doit retourner le concept produit qui pour une PROC est toujours None + En cas d'erreur, elle leve une exception : AsException ou EOFError + """ + if not self.isactif():return + try: + if self.parent: + if type(self.definition.op_init) == types.FunctionType: + apply(self.definition.op_init,(self,self.parent.g_context)) + else: + pass + if self.jdc.par_lot == "NON" : + self.Execute() + except AsException,e: + raise AsException("Etape ",self.nom,'ligne : ',self.appel[0], + 'fichier : ',self.appel[1],e) + except EOFError: + self.reset_current_step() + raise + except : + l=traceback.format_exception(sys.exc_info()[0],sys.exc_info()[1],sys.exc_info()[2]) + raise AsException("Etape ",self.nom,'ligne : ',self.appel[0], + 'fichier : ',self.appel[1]+'\n', + string.join(l)) diff --git a/Ihm/I_REGLE.py b/Ihm/I_REGLE.py index 1ff738f3..52a0c47a 100644 --- a/Ihm/I_REGLE.py +++ b/Ihm/I_REGLE.py @@ -1,3 +1,22 @@ +# CONFIGURATION MANAGEMENT OF EDF VERSION +# ====================================================================== +# COPYRIGHT (C) 1991 - 2002 EDF R&D WWW.CODE-ASTER.ORG +# THIS PROGRAM IS FREE SOFTWARE; YOU CAN REDISTRIBUTE IT AND/OR MODIFY +# IT UNDER THE TERMS OF THE GNU GENERAL PUBLIC LICENSE AS PUBLISHED BY +# THE FREE SOFTWARE FOUNDATION; EITHER VERSION 2 OF THE LICENSE, OR +# (AT YOUR OPTION) ANY LATER VERSION. +# +# THIS PROGRAM IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL, BUT +# WITHOUT ANY WARRANTY; WITHOUT EVEN THE IMPLIED WARRANTY OF +# MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. SEE THE GNU +# GENERAL PUBLIC LICENSE FOR MORE DETAILS. +# +# YOU SHOULD HAVE RECEIVED A COPY OF THE GNU GENERAL PUBLIC LICENSE +# ALONG WITH THIS PROGRAM; IF NOT, WRITE TO EDF R&D CODE_ASTER, +# 1 AVENUE DU GENERAL DE GAULLE, 92141 CLAMART CEDEX, FRANCE. +# +# +# ====================================================================== """ """ import string diff --git a/Ihm/I_UN_PARMI.py b/Ihm/I_UN_PARMI.py index a600514d..bd1ef701 100644 --- a/Ihm/I_UN_PARMI.py +++ b/Ihm/I_UN_PARMI.py @@ -1,3 +1,22 @@ +# CONFIGURATION MANAGEMENT OF EDF VERSION +# ====================================================================== +# COPYRIGHT (C) 1991 - 2002 EDF R&D WWW.CODE-ASTER.ORG +# THIS PROGRAM IS FREE SOFTWARE; YOU CAN REDISTRIBUTE IT AND/OR MODIFY +# IT UNDER THE TERMS OF THE GNU GENERAL PUBLIC LICENSE AS PUBLISHED BY +# THE FREE SOFTWARE FOUNDATION; EITHER VERSION 2 OF THE LICENSE, OR +# (AT YOUR OPTION) ANY LATER VERSION. +# +# THIS PROGRAM IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL, BUT +# WITHOUT ANY WARRANTY; WITHOUT EVEN THE IMPLIED WARRANTY OF +# MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. SEE THE GNU +# GENERAL PUBLIC LICENSE FOR MORE DETAILS. +# +# YOU SHOULD HAVE RECEIVED A COPY OF THE GNU GENERAL PUBLIC LICENSE +# ALONG WITH THIS PROGRAM; IF NOT, WRITE TO EDF R&D CODE_ASTER, +# 1 AVENUE DU GENERAL DE GAULLE, 92141 CLAMART CEDEX, FRANCE. +# +# +# ====================================================================== """ """ @@ -14,8 +33,9 @@ class UN_PARMI(I_REGLE.REGLE): if not regle_active : return liste_a_purger # Si un des mots clés est présent, on les enlève tous + # sauf celui ci for mc in self.mcs: - if mc in liste_a_purger: + if mc in liste_a_purger and mc not in liste_mc_presents: liste_a_purger.remove(mc) return liste_a_purger diff --git a/Ihm/__init__.py b/Ihm/__init__.py index a2c6164b..f12fbf81 100644 --- a/Ihm/__init__.py +++ b/Ihm/__init__.py @@ -1,3 +1,22 @@ +# CONFIGURATION MANAGEMENT OF EDF VERSION +# ====================================================================== +# COPYRIGHT (C) 1991 - 2002 EDF R&D WWW.CODE-ASTER.ORG +# THIS PROGRAM IS FREE SOFTWARE; YOU CAN REDISTRIBUTE IT AND/OR MODIFY +# IT UNDER THE TERMS OF THE GNU GENERAL PUBLIC LICENSE AS PUBLISHED BY +# THE FREE SOFTWARE FOUNDATION; EITHER VERSION 2 OF THE LICENSE, OR +# (AT YOUR OPTION) ANY LATER VERSION. +# +# THIS PROGRAM IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL, BUT +# WITHOUT ANY WARRANTY; WITHOUT EVEN THE IMPLIED WARRANTY OF +# MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. SEE THE GNU +# GENERAL PUBLIC LICENSE FOR MORE DETAILS. +# +# YOU SHOULD HAVE RECEIVED A COPY OF THE GNU GENERAL PUBLIC LICENSE +# ALONG WITH THIS PROGRAM; IF NOT, WRITE TO EDF R&D CODE_ASTER, +# 1 AVENUE DU GENERAL DE GAULLE, 92141 CLAMART CEDEX, FRANCE. +# +# +# ====================================================================== """ Ce package contient les fonctionnalités supplémentaires nécessaires pour l'éditeur graphique EFICAS diff --git a/Installation/Doc_technique_install.doc b/Installation/Doc_technique_install.doc new file mode 100755 index 00000000..285a3549 Binary files /dev/null and b/Installation/Doc_technique_install.doc differ diff --git a/Installation/README b/Installation/README new file mode 100755 index 00000000..4a575ba9 --- /dev/null +++ b/Installation/README @@ -0,0 +1,30 @@ + + + ================================================= + Procédure d'installation d'EFICAS + ================================================= + +Pré-requis : +------------ + + - Python 2.1 ou supérieur avec Tkinter + - PMW 8.0.5 ou supérieur + +Installation : +-------------- + +1°) copiez le fichier eficas.tar.gz dans un répertoire temporaire + +2°) Décompressez ce fichier comme suit : + + gunzip eficas.tar.gz + tar xvf eficas.tar + +3°) Vous devriez désormais voir 4 éléments : + + - 1 fichier README_install + - 1 fichier install.py + - 1 fichier code_aster.gif + - 1 répertoire /Eficas + +4°) Reportez-vous au fichier README_install pour la suite des actions à entreprendre. diff --git a/Installation/README_install b/Installation/README_install new file mode 100755 index 00000000..081d9428 --- /dev/null +++ b/Installation/README_install @@ -0,0 +1,40 @@ + + + ================================================= + Procédure d'installation d'EFICAS + ================================================= + +Pour lancer la procédure d'installation, tapez : + + python install.py + +Vous pouvez remplacer 'python' par le chemin d'accès de votre interpréteur Python. + +La procédure d'installation commence par vérifier que votre système contient bien les +pré-requis pour EFICAS (cf README) + +La procédure va vous demander un certain nombre de chemins d'accès nécessaires à l'établissement du +fichier de configuration d'EFICAS qui s'appelle editeur.ini et qui se trouvera, une fois EFICAS, +installé, dans le répertoire Eficas/Aster + +- Répertoire d'installation : répertoire dans lequel vous voulez installer Eficas +- Répertoire de travail : répertoire de travail temporaire d'EFICAS +- Répertoire matériaux : répertoire dans lequel se trouvent les catalogues matériaux d'ASTER +- Répertoire doc Aster : répertoire dans lequel se trouve le manuel U4 de la doc Aster (format pdf) + ex : /logiciels/aster/NEW6/doc/pdf/u4 +- Exécutable Acrobat Reader : chemin d'accès complet à l'exécutable Acrobat Reader + + +Catalogues Aster : EFICAS installe par défaut le catalogue Aster v6 qui se trouve en + Eficas/Aster/Cata. + Si vous voulez en installer d'autres, il faut qu'ils se trouvent dans ce même répertoire + ou qu'il y ait un lien dans ce répertoire vers le fichier. + Pour ajouter d'autres catalogues, il faut aller modifier directement le fichier editeur.ini + + + +Lancement d'EFICAS : le fichier à lancer est Eficas/Aster/eficas_aster.py + il faut le lancer précédé du chemin d'accès à l'interpréteur Python comme + pour la procédure d'installation. + + diff --git a/Installation/install.py b/Installation/install.py new file mode 100755 index 00000000..dbe14e34 --- /dev/null +++ b/Installation/install.py @@ -0,0 +1,949 @@ +SUCCES,ECHEC = 1,0 +OUI,NON = 1,0 + +## constantes pour les tests de versions + +python_min = 20 +tcl_min = 83 +tk_min = 83 +pmw_min = 85 +test = 0 + +try: + import sys,string,re,types,traceback + import os,commands +except Exception,e: + print "Mauvaise installation de Python" + print str(e) + +REPERTOIRE = os.path.abspath(os.curdir) + +def strip_points(chaine): + """ + Enlève les caractères autres que les chiffres des chaînes + """ + x="" + for i in range(len(chaine)): + try: + dummy = float(chaine[i]) + x=x+chaine[i] + except: + pass + return x + +class Test_Environnement : + def __init__(self): + self.l_errors = [] + + def test_plate_forme(self): + """ + Teste que la plate-forme est bien supportée + """ + if os.name not in ('nt','posix'): + self.l_errors.append("La plate-forme %s n'est pas supportée" %os.name) + + def test_version_python(self): + """ + Test de la version de python + """ + version = sys.version + n = string.index(version,"(") - 1 + vpyt = strip_points(version[0:n])[0:2] ## recupere les 2 premiers caracteres + if int(vpyt) self.max: + value = self.max + if value < self.min: + value = self.min + # Preserve the new value + c=self.canvas + # Adjust the rectangle + if self.orientation == "horizontal": + c.coords(self.scale,0, 0,float(value) / self.max * self.width, self.height) + else: + c.coords(self.scale,0, self.height - (float(value) / self.max*self.height),self.width, self.height) + # Now update the colors + c.itemconfig(self.scale, fill=self.fillColor) + c.itemconfig(self.label, fill=self.labelColor) + # And update the label + if self.autoLabel=="true": + c.itemconfig(self.label, text=self.labelFormat % value) + else: + c.itemconfig(self.label, text=self.labelFormat % self.labelText) + c.update_idletasks() +try : + import Tkinter + import Pmw + from tkMessageBox import showinfo,askyesno,showerror,askretrycancel +except: + pass + +class SplashScreen(Tkinter.Toplevel): + """ Provides a splash screen. Usage: + Subclass and override 'CreateWidgets()' + In constructor of main window/application call + - S = SplashScreen(main=self) (if caller is Toplevel) + - S = SplashScreen(main=self.master) (if caller is Frame) + - S.quit() after you are done creating your widgets etc. + """ + def __init__(self, master,**args): + Tkinter.Toplevel.__init__(self, master, relief='groove',borderwidth=5) + self.protocol("WM_DELETE_WINDOW",lambda x=0: x+x ) # pour ne pas détruire la fenêtre en pleine copie de fichiers + self.main = master + if self.main != None : + self.main.withdraw() + self.frame = Tkinter.Frame(self) + self.frame.pack(expand=1,fill='both') + self.init(args) + self.geometry("300x200") + self.resizable(0,0) + self.CreateWidgets() + + def init(self,args={}): + self.text = Tkinter.StringVar() + self.text.set('') + self.icone = 'Editeur/icons/logo_edf.gif' + self.barre = 'non' + if args == {} : return + if args.has_key('text'): + self.text.set(args['text']) + if args.has_key('titre'): + self.title(args['titre']) + if args.has_key('code'): + self.code = args['code'] + else: + self.code = 'inconnu' + if self.code == 'ASTER' : + self.icone = 'Editeur/icons/code_aster.gif' + + def CreateWidgets(self): + fic_image = os.path.join("./", self.icone) + if os.path.exists(fic_image): + self.catIcon = Tkinter.PhotoImage(file=os.path.join("./", self.icone)) + Tkinter.Label(self.frame, image=self.catIcon).pack(side=Tkinter.TOP) + else: + Tkinter.Label(self.frame, text = "EFICAS pour Code_Aster").pack(side=Tkinter.TOP) + self.label = Tkinter.Label(self.frame, textvariable=self.text) + self.label.pack(side=Tkinter.TOP,expand=1,fill='both') + self.progress = Slider(self.frame,value=0,max=100,orientation='horizontal', + fillColor='blue',width=200,height=30, + background='white',labelColor='red') + + def update_barre(self,event=None): + """ Permet de faire avancer la barre de progression """ + try: + self.progress.value = self.progress.value+self.increment + self.progress.update() + #self.after(100,self.update_barre) + except: + pass + + def configure_barre(self): + """ Calcule l'incrément de progression de la barre en fonction + du nombre d'opérations à effectuer afin que le compteur + soit à 100% à la fin des opérations""" + self.increment = 100./self.ratio + self.progress.update() + + def configure(self,**args): + if args.has_key('text'): + self.text.set(args['text']) + if args.has_key('titre'): + self.title(args['titre']) + if args.has_key('barre'): + old = self.barre + self.barre = args['barre'] + if self.barre == 'oui' and old == 'non': + self.progress.frame.pack(in_=self.frame,side='top') + elif self.barre == 'non' and old == 'oui': + self.progress.frame.pack_forget() + if args.has_key('ratio'): + self.ratio = args['ratio'] + self.configure_barre() + self.update() + + def quit(self): + self.progress = None + self.withdraw() + self.main.update() + self.main.deiconify() + +def centerwindow(window,parent = 'avec'): + if parent =='avec': + parent = window.winfo_parent() + if type(parent) == types.StringType: + try: + parent = window._nametowidget(parent) + except: + parent = window + # Find size of window. + window.update_idletasks() + width = window.winfo_width() + height = window.winfo_height() + if width == 1 and height == 1: + # If the window has not yet been displayed, its size is + # reported as 1x1, so use requested size. + width = window.winfo_reqwidth() + height = window.winfo_reqheight() + # Place in centre of screen: + if parent =='avec' : + x = (window.winfo_screenwidth() - width) / 2 - parent.winfo_vrootx() + y = (window.winfo_screenheight() - height) / 3 - parent.winfo_vrooty() + else: + x = (window.winfo_screenwidth() - width) / 2 + y = (window.winfo_screenheight() - height) / 3 + if x < 0: + x = 0 + if y < 0: + y = 0 + window.geometry('+%d+%d' % (x, y)) + +class config_item: + """ + Classe utilisée pour représenter chaque option de configuration + """ + def __init__(self, pere, nom): + self.nom = nom + self.pere = pere + self.entree_value = None + self.default = None + self.test = None + self.pere.register_item(self) + + def get_valeur(self): + return os.path.abspath(self.entree.get()) + + def set_entree(self,entree): + self.entree = entree + self.pere.register_entree(entree) + +class Config(Tkinter.Toplevel): + """ + Classe principale : une instance de Config est utilisée pour + créer l'interface. Toutes les actions (création de répertoire, copie + de fichiers ...) sont réalisées par des méthodes de Config ou de ses + composants + """ + pat_rep = re.compile(r'^(rep_)([\w_]*)') # expression réguliere pour reconnaitre les + # les options qui désignent des répertoires + def __init__(self, parent): + self.master = parent + Tkinter.Toplevel.__init__(self,None) + parent.withdraw() + self.title("Installation d'EFICAS") + self.geometry("500x320+0+0") + centerwindow(self) + self.install_running = 0 + #évite que la fenêtre puisse être détruite en pleine copie de fichiers + self.protocol("WM_DELETE_WINDOW",self.exit ) + # création des frames + self.frame_gen = Tkinter.Frame(self,bd=1,relief='groove') + self.frame_gen.place(relx=0,rely=0,relwidth=1,relheight=0.9 ) + self.frame_but = Tkinter.Frame(self,bd=1,relief='groove') + self.frame_but.place(relx=0,rely=0.9 ,relheight=0.1 ,relwidth=1) + # création des items de configuration + self.make_items_config() + # remplissage de la frame générale + self.make_frame_gen() + # remplissage de la frame boutons + self.make_frame_but() + # création boîtes de dialogue + self.init_complementaire() + # init système + self.init_systeme() + + def make_items_config(self): + """ + Création des objets Config_item + """ + self.items = [] + self.items_a_creer = [] + self.liste_rep_crees = [] + self.entrees = [] + # designation, texte d'invite , option par defaut(unix), option par defaut(windows), flag obligatoire/facultatif + self.l_tx_items = (('rep_install' , + "Répertoire d'installation :", + '', + '', + 'o'), + ('rep_travail' , + 'Répertoire de travail :', + 'tmp', + 'tmp', + 'f'), + ('rep_mat' , + 'Répertoire matériaux :', + None, + None, + 'f'), + ('rep_docaster' , + "Chemin d'accès à la doc Aster :" , + None, + None, + 'f' + ), + ('acrobat' , + 'Exécutable Acrobat Reader :', + '/usr/bin/acroread', + 'acrobat.exe', + 'o') + ) + + for item in self.l_tx_items: + nom_item = item[0] + setattr(self,nom_item,config_item(self,nom_item)) + + def make_frame_gen(self): + """ + Création des zones de saisie des paramètres généraux + """ + # Création du label titre de la frame + self.information = Tkinter.Label(self.frame_gen,text="CONFIGURATION D'EFICAS") + self.information.pack(side="top",pady=10) + # création des widgets de saisie des items + for txt in self.l_tx_items: + nom_item = txt[0] + txt_item = txt[1] + if os.name == 'nt': + default_value = txt[3] + else: + default_value = txt[2] + item = getattr(self,nom_item) + wdg_item = Pmw.EntryField(self.frame_gen, + labelpos = 'w', + label_text = txt_item, + command = lambda s=self,i=item : s.select_next_entry(i.entree)) + item.default_value = default_value + item.statut = txt[4] + item.set_entree(wdg_item) + # on affiche les entrées + for entree in self.entrees: + entree.pack(fill='x', expand=1, padx=10, pady=5) + Pmw.alignlabels(self.entrees) + self.entrees[0].focus_set() + #self.rep_cata_dev.entree.configure(entry_state = 'disabled') + self.display_defaults() + + def make_frame_but(self): + """ + Création des boutons de commande Installer et Annuler + """ + self.validButton = Tkinter.Button(self.frame_but, text = 'Installer', command = self.run_install) + self.exitButton = Tkinter.Button(self.frame_but, + text = 'Annuler', + command = lambda s=self : s.exit(annule='oui')) + self.exitButton.place(relx=0.35,rely=0.5,anchor='center') + self.validButton.place(relx=0.65,rely=0.5,anchor='center') + + def init_complementaire(self): + """ + Création de widgets complémentaires (boîtes de dialogue ...) + """ + self.erreur_dialog = Pmw.Dialog(self, + buttons = ('Modifier', 'Annuler'), + defaultbutton = 'Modifier', + title = 'Erreur', + command = self.erreur_exec) + self.erreur_dialog.withdraw() + self.fatale_dialog = Pmw.Dialog(self, + buttons = ('Annuler',), + title = 'Fatal', + command = self.fatale_exec) + self.fatale_dialog.withdraw() + self.info_dialog = Pmw.Dialog(self, + buttons = ('Ok',), + title = 'Attention') + self.info_dialog.configure(command=self.info_dialog.withdraw()) + self.info_dialog.withdraw() + self.attente = SplashScreen(None,code="ASTER") + self.attente.withdraw() + + def init_systeme(self): + """ + Détermine les commandes à exécuter en fonction de l'OS + """ + self.d_commandes = {} + if os.name == 'nt': + self.d_commandes['decompress'] = "unzip.exe " + self.d_commandes['copy'] = "copy " + self.d_commandes['delete'] = "del " + elif os.name == 'posix': + self.d_commandes['decompress'] = "gunzip " + self.d_commandes['copy'] = "cp " + self.d_commandes['delete'] = "rm " + + def run_install(self): + """ + Lance l'installation proprement dite d'EFICAS + """ + self.install_running = 1 + self.afficher_splash() + self.deactivate_entries() # Les entrees et les boutons sont desactivees + self.deactivate_buttons() # pendant les operations d'installation + #self.decompress_archive() + #if not os.path.exists(os.path.join(REPERTOIRE,'Eficas')): + # self.afficher_fatale("Il manque des fichiers d'EFICAS") + # self.install_running = 0 + # return + self.nb_fichiers = self.compte_fichiers(REPERTOIRE) + if self.nb_fichiers == 0: + self.afficher_fatale("Il manque des fichiers d'EFICAS") + self.install_running = 0 + return + # essaie de creer les repertoires. + try: + if self.make_dirs() == ECHEC : + self.activate_entries() + self.activate_buttons() + self.install_running = 0 + return + except: + self.install_running = 0 + self.afficher_fatale("Impossible de créer certains répertoires") + + # affiche la fenêtre avec la barre de progression + self.afficher_copie_fichiers() + # essaie de copier les fichiers d'EFICAS + try: + if self.move_files() == ECHEC: + self.afficher_echec("Impossible de copier les fichiers d'EFICAS") + self.activate_buttons() + self.install_running = 0 + return + except : + traceback.print_exc() + self.install_running = 0 + self.afficher_fatale("Impossible de copier certains fichiers") + + #self.rm_temp_dirs() # efface les répertoires temporaires + try: + self.creer_fic_conf() # crée le fichier eficas.conf + except: + afficher_info("Impossible de créer le fichier de configuration\n Il est possible de le faire a la main") +# self.install_running = 0 + self.afficher_install_terminee() # A ce stade tout est fait et il ne reste plus qu'à attendre + # un clic de souris pour sortir + + def display_defaults(self): + """ + Affiche les valeurs par défaut dans les zones de saisie + """ + # racine indique la racine de l'arborescence + if os.name == 'nt': + racine = 'C:\\' + else: + racine = os.environ['HOME'] + # remplit les zones de saisie avec les options par défaut + for item in self.items: + if item.default_value == None : continue + item.default_value = os.path.join(racine,item.default_value) + item.entree.insert(0,item.default_value) + + def register_item(self,item): + """ + Enregistre l'item dans la liste des items et éventuellement + dans la liste des items à créer (répertoires) + """ + self.items.append(item) + if self.pat_rep.match(item.nom) : + self.items_a_creer.append(item) + + def register_entree(self,entree): + """ + Enregistre la zone de saisie dans la liste des zones + """ + self.entrees.append(entree) + + def select_next_entry(self,entree): + """ + Place le focus dans l'entry suivant celle passée en argument + """ + index = self.entrees.index(entree)+1 + if index != len(self.entrees): + self.entrees[index].component('entry').focus() + + def activate_entries(self): + """ + Active les entrées. Les zones de saisie deviennent éditables. + """ + for item in self.entrees: + item.configure(entry_state='normal') + + def deactivate_entries(self): + """ + Désactive les entrées. Les zones ne sont plus éditables. + """ + for item in self.entrees: # Les entrees sont desactivees + item.configure(entry_state='disabled') # pendant les operations d'installation + + def activate_buttons(self): + """ + active les boutons valider et annuler + """ + self.validButton.configure(state = 'normal') + self.exitButton.configure(state = 'normal') + + def deactivate_buttons(self): + """ + désactive des boutons valider de annuler + """ + self.validButton.configure(state = 'disabled') + self.exitButton.configure(state = 'disabled') + + def erreur_exec(self, result): + """ + Callback exécuté lorsque l'utilisateur clique sur un des boutons + Modifier/Annuler de la fenêtre de dialogue qui lui présente les erreurs + """ + self.erreur_dialog.deactivate(result) + self.removedir() + if result == 'Annuler': + self.install_running = 0 + self.exit(annule='non') + + def fatale_exec(self, result): + """ + Callback exécuté lorsque l'utilisateur clique sur le bouton + Quitter de la fenêtre de dialogue qui lui présente les erreurs fatales + Seule solution : sortir de l'installation + """ + self.fatale_dialog.deactivate(result) + self.install_running = 0 + self.exit(annule='oui') + + def test_confirmation(self,flag,nom): + """ + Callback activé par le clic sur bouton fenêtre demandant confirmation + avant création répertoire facultatif + """ + if flag == 'NON': + self.confirmation.destroy() + self.TEST_confirmation_avant_creation = NON + return + else : + self.confirmation.destroy() + self.TEST_confirmation_avant_creation = OUI + + def afficher_fatale(self, message): + """ + Affiche les erreurs fatales + """ + self.attente.withdraw() + w = Tkinter.Label(self.fatale_dialog.interior(),text = message, pady = 5) + w.pack(expand = 1, fill = 'both', padx = 4, pady = 4) + self.fatale_dialog.configure(deactivatecommand = w.destroy) + self.fatale_dialog.activate() + + def afficher_echec(self, message): + """ + Affiche un message d'erreur + Par construction, dès que l'on passe par cette méthode, on sort de l'installation + en passant le flag install_running à 0 + """ + self.attente.withdraw() + w = Tkinter.Label(self.erreur_dialog.interior(),text = message, pady = 5) + w.pack(expand = 1, fill = 'both', padx = 4, pady = 4) + self.erreur_dialog.configure(deactivatecommand = w.destroy) + self.erreur_dialog.activate() + + def confirmation_avant_creation(self,repertoire): + """ + Affiche une boite de dialogue pour confirmer la création + d'un répertoire facultatif. + """ + self.attente.withdraw() + self.confirmation = Pmw.Dialog(self, + buttons = ('OUI', 'NON'), + defaultbutton = 'OUI', + title = "Répertoire inexistant", + command = lambda f,s=self,r=repertoire : s.test_confirmation(f,r)) + self.confirmation.withdraw() + Tkinter.Label(self.confirmation.interior(), + text="Le répertoire %s n'existe pas \n Voulez-vous le créer ?" %repertoire).pack(side='top') + self.confirmation.activate(geometry='centerscreenalways') + return self.TEST_confirmation_avant_creation + + def afficher_splash(self): + """ + Afficher la boite de message + """ + self.attente.deiconify() + self.attente.tkraise() + centerwindow(self.attente) + self.attente.configure(titre="Installation d'EFICAS", + text="Vérification intégrité sources Eficas", + barre="non") + + def afficher_info(self,message): + """ + Afficher une boite de warning + """ + w = Tkinter.Label(self.info_dialog.interior(),text = message, pady = 5) + w.pack(expand = 1, fill = 'both', padx = 4, pady = 4) + self.info_dialog.configure(deactivatecommand = w.destroy) + self.info_dialog.activate() + + def afficher_copie_fichiers(self): + """ + Afficher la boite de message avec la barre de progression + """ + self.attente.deiconify() + self.attente.tkraise() + self.attente.configure(titre="Installation d'EFICAS", + text="copie des fichiers", + barre="oui") + self.attente.ratio = self.nb_fichiers + self.attente.configure_barre() + + def afficher_install_terminee(self): + """ + Afficher le message Installation terminée + """ + self.withdraw() + self.attente.configure(titre="Installation d'EFICAS", + text="Installation terminée", + barre="non") + self.exitButton.place_forget() + self.validButton.place_forget() + self.validButton = Tkinter.Button(self.attente.frame, + text = 'Quitter', + command = self.exit) + self.validButton.pack(side='top',pady=5) + self.install_running = 0 + + def decompress_archive(self) : + """ + Décompresse l'archive d'EFICAS dans un répertoire temporaire (.) + """ + print "decompress_archive" + #try: + commande = os.path.join(REPERTOIRE,self.d_commandes['decompress']) + fichier = os.path.join(REPERTOIRE,"eficas.zip") + print 'commande =',commande + print 'fichier =',fichier + os.execv(commande,("eficas.zip",)) + #except: + # self.affiche_echec("Erreur dans la décompression") + + def normaliser_chemin(self, nom): + """ + Retourne le chemin d'accès complet à nom + """ + return os.path.abspath(os.path.expanduser(nom)) + + def discriminer_noms(self): + """ + Emet un message d'alerte si des zones de saisie ne sont pas remplies + ou si des noms de répertoires à créer sont identiques. + """ + liste_noms = [] + for item in self.items_a_creer: + nom = item.entree.get() + if nom == self.rep_install.entree.get(): # il faut ajouter 'Eficas' au chemin du repertoire + nom = os.path.join(nom,"Eficas") # d'installation + liste_noms.append(nom) + + test = SUCCES + for item in self.items_a_creer: + nom = item.entree.get() + if len(nom) == 0 : + test = ECHEC + message = "attention : certains répertoires n'ont pas de nom" + self.afficher_echec(message) + item.entree.component('entry').focus() + break + + if test == ECHEC : + return test + + for item in self.items_a_creer: + nom = item.entree.get() + if liste_noms.count(nom) >1 : + test = ECHEC + message = "attention : certains répertoires ont le même nom" + self.afficher_echec(message) + item.entree.component('entry').focus() + break + + return test + + def compte_fichiers(self,path): + """ + Dénombre les fichiers présents dans le répertoire Eficas (et ses sous-répertoires) + """ + nb = 0 + l_fic = os.listdir(path) + l_rep = [] + for fic in l_fic : + if os.path.isdir(os.path.join(path,fic)): + l_rep.append(fic) + else: + nb = nb+1 + for rep in l_rep : + nb = nb + self.compte_fichiers(os.path.join(path,rep)) + return nb + + def creer_fic_conf(self): + """ + Crée le fichier editeur.ini a partir des données saisies + par l'administrateur. + """ + fichier_conf = os.path.join(self.normaliser_chemin(self.rep_install.get_valeur()),"Eficas/Aster/editeur.ini") + f = open(fichier_conf,'w') + f.write("path_doc = "+'"'+self.normaliser_chemin(self.rep_docaster.get_valeur())+'"\n') + f.write("exec_acrobat = "+'"'+self.normaliser_chemin(self.acrobat.get_valeur())+'"\n') + f.write('isdeveloppeur = "NON"\n') + f.write("rep_travail = "+'"'+self.normaliser_chemin(self.rep_travail.get_valeur())+'"\n') + f.write("rep_cata = "+'"'+os.path.join(self.normaliser_chemin(self.rep_install.get_valeur()),"Eficas/Aster/Cata/")+'"\n') # attention au dernier slash + f.write("rep_mat = "+'"'+self.normaliser_chemin(self.rep_mat.get_valeur())+'"\n') + cata = """catalogues = (('ASTER','v6',rep_cata + 'cata_STA6.py','python','defaut'),)\n""" + f.write(cata) + f.close() + + + def move_files(self): + """ + Déplace les fichiers Eficas du répertoire temporaire vers + leur répertoire de destination + """ + # création du répertoire Eficas + rep_eficas = os.path.join(self.rep_install.get_valeur(),'Eficas') + self.copy_rep(REPERTOIRE,rep_eficas) + + def copy_rep(self,rep_dep,rep_arr): + """ + Copie le répertoire path_dep et ses sous-répertoires dans path_arr + """ + l_fichiers = os.listdir(rep_dep) + if not os.path.exists(rep_arr) : + # création du répertoire d'arrivée quand il n'existe pas + self.mkdirs(rep_arr) + for fic in l_fichiers : + nom_complet_dep = os.path.join(rep_dep,fic) + nom_complet_arr = os.path.join(rep_arr,fic) + if os.path.isfile(nom_complet_dep): + commande_copie = self.d_commandes['copy']+nom_complet_dep+' '+nom_complet_arr + commande_delete= self.d_commandes['delete']+nom_complet_dep + try: + os.system(commande_copie) + #os.system(commande_delete) + self.attente.update_barre() + except Exception,e: + pass + elif os.path.isdir(nom_complet_dep): + self.copy_rep(nom_complet_dep,nom_complet_arr) + + def rm_temp_dirs(self): + """ + Détruit le répertoire temporaire de l'archive d'Eficas + """ + rep_arch = os.path.join(REPERTOIRE,'Eficas') + self.rm_r(rep_arch) + + def make_dirs(self): + """ + Crée les répertoires d'accueil des fichiers d'EFICAS + """ + # création des répertoires dont l'utilisateur a donné le nom + if self.discriminer_noms() == ECHEC: + return ECHEC + for item in self.items_a_creer: + if not item.entree.get(): + continue + nom = item.get_valeur() + if nom == self.normaliser_chemin(self.rep_install.entree.get()): # il faut ajouter 'Eficas' au chemin du repertoire + nom = os.path.join(nom,"Eficas") # d'installation + item.test = self.essai_creer(nom,item.statut) + if item.test == ECHEC : + item.entree.component('entry').focus() + return ECHEC + return SUCCES + + def essai_creer(self, nom, statut): + """ + Essaie de créer le répertoire nom s'il n'existe pas déjà. + Si statut == 'f' et si le fichier n'existe pas, demande + confirmation avant création + """ + repertoire = self.normaliser_chemin(nom) # repertoire = chemin absolu de nom + if os.path.exists(repertoire): + if statut == 'o' : + self.afficher_echec("Un fichier ou répertoire de nom "+ repertoire+ " existe déjà !\n"+ + "L'installation ne peut continuer") + return ECHEC + else: + return SUCCES + + if statut == 'f' : + # on demande confirmation de création à l'utilisateur + test = self.confirmation_avant_creation(repertoire) + if test == NON: + return SUCCES + + try: + test = self.mkdirs(repertoire) + return SUCCES + except Exception,e: + message = "La création de "+repertoire+" a échoué :\n %s \n Vérifiez vos droits d'écriture" %str(e) # message d'erreur + self.afficher_echec(message) + return ECHEC + + def mkdirs(self,rep): + """ + Création récursive des répertoires d'installation. + Les noms des répertoires crées sont stockés dans + une liste dont se sert la méthode removedir pour + restaurer l'environnement initial en cas d'annulation. + """ + if rep==os.path.dirname(rep): + return SUCCES + + if os.path.exists(os.path.dirname(rep)): + os.mkdir(rep) + self.liste_rep_crees.append(rep) + return SUCCES + else: + test = self.mkdirs(os.path.dirname(rep)) + if test == SUCCES: + os.mkdir(rep) + self.liste_rep_crees.append(rep) + return SUCCES + else: + return ECHEC + + def rm_r(self,path): + """ + Detruit récursivement path + """ + if not os.path.exists(path): + return + try: + if len(os.listdir(path))!=0: + for entree in os.listdir(path): + entree = os.path.join(path,entree) + self.rm_r(entree) + os.rmdir(path) + except Exception,e: + self.afficher_info("Impossible de détruire le répertoire : "+path+"\n"+"\n"+str(e)+"\n L'installation continue néanmoins") + + def removedir(self): + """ + Destruction des répertoires déja crées (en cas d'annulation) + """ + for rep in self.liste_rep_crees: + self.rm_r(rep) + self.liste_rep_crees = [] + + def exit(self,annule='non'): + """ + Tente de sortir de l'application. + Echoue si installation en cours + """ + if self.install_running : + # l'installation est en cours --> on interdit la sortie + self.afficher_info("Impossible de quitter tant que l'installation est en cours\n Veuillez patienter") + else: + if annule == 'oui' : self.removedir() + self.master.quit() + +if __name__ == '__main__': + test = Test_Environnement().test() + if not test : + # environnement incomplet --> on sort de la procédure d'installation + sys.exit() + else: + import Tkinter + import Pmw + root = Tkinter.Tk() + Pmw.initialise(root) + try: + principal = Config(root) + root.mainloop() + except Exception,e: + print "Erreur non prévue rencontrée : ",str(e) + print "Veuillez prévenir la maintenance" + sys.exit() diff --git a/Minicode/cata_saturne.py b/Minicode/cata_saturne.py index 40975a2d..4c742a6a 100755 --- a/Minicode/cata_saturne.py +++ b/Minicode/cata_saturne.py @@ -3,6 +3,8 @@ import Accas from Accas import * +#CONTEXT.debug=1 + import ops JdC = JDC_CATA(code='SATURNE', @@ -11,13 +13,21 @@ JdC = JDC_CATA(code='SATURNE', AU_MOINS_UN('FIN'), A_CLASSER(('DEBUT','POURSUITE'),'FIN') ) - ); + ) # P. RASCLE MMN # remarques diverses sur le catalogue Saturne # - dans les blocs, il faut au moins un mot clé de statut obligatoire # probleme de rafraichissement des blocs dépendants quand la valeur d'un mot cle global (ITURB) passe de 1 à 0 +# Type le plus general +class entier (ASSD):pass +class reel (ASSD):pass +class complexe(ASSD):pass +class liste (ASSD):pass +class chaine (ASSD):pass + + class sonde(ASSD):pass class varsca(ASSD):pass class flusca(ASSD):pass @@ -36,7 +46,35 @@ class tsr23(ASSD):pass class resti(ASSD):pass class maillage(ASSD):pass -class listr8 (ASSD):pass +class modele(ASSD):pass +class matr_asse(ASSD):pass +class cham_elem_sief_r(ASSD):pass +class theta_geom(ASSD):pass +class cham_mater(ASSD):pass +class cara_elem(ASSD):pass +class char_ther(ASSD):pass +class char_meca(ASSD):pass +class nume_ddl(ASSD):pass +class char_acou(ASSD):pass +class listr8 (ASSD):pass +class matr_elem(ASSD):pass +class matr_elem_depl_c(matr_elem):pass +class matr_elem_depl_r(matr_elem):pass +class matr_elem_pres_c(matr_elem):pass +class matr_elem_temp_r(matr_elem):pass + +# matr_asse : +#-------------------------------- +class matr_asse(ASSD):pass +class matr_asse_depl_c(matr_asse):pass +class matr_asse_depl_r(matr_asse):pass +class matr_asse_gene_r(matr_asse):pass +class matr_asse_gene_c(matr_asse):pass +class matr_asse_pres_c(matr_asse):pass +class matr_asse_pres_r(matr_asse):pass +class matr_asse_temp_c(matr_asse):pass +class matr_asse_temp_r(matr_asse):pass + # fin entete @@ -101,6 +139,33 @@ FORMULE = FORM( nom='FORMULE',op=-5,sd_prod=fonction, COMPLEXE = SIMP(typ = 'shell',max=1), ) ; +AFFE_MODELE=OPER(nom="AFFE_MODELE",op=18,sd_prod=modele,docu="U4.41.01-f1", + fr="Affectation des éléments finis sur le maillage",reentrant='n', + MAILLAGE =SIMP(statut='o',typ=(maillage) ), + INFO =SIMP(statut='f',typ='I',defaut=1,into=(1,2) ), + VERIF =SIMP(statut='f',typ='TXM',max=2,into=("MAILLE","NOEUD") ), + ); +NUME_DDL=OPER(nom="NUME_DDL",op=11,sd_prod=nume_ddl,docu="U4.61.11-f",reentrant='n', + fr="Etablissement de la numérotation des ddl avec ou sans renumérotation et du stockage de la matrice", + MATR_RIGI =SIMP(statut='f',typ=(matr_elem_depl_r ,matr_elem_depl_c, + matr_elem_temp_r,matr_elem_pres_c),max=100 ), + MODELE =SIMP(statut='f',typ=modele ), + b_modele =BLOC(condition = "MODELE != None", + CHARGE =SIMP(statut='f',max='**',typ=(char_meca,char_ther,char_acou, ),), + ), + METHODE =SIMP(statut='f',typ='TXM',defaut="MULT_FRONT",into=("MULT_FRONT","LDLT","GCPC") ), + b_mult_front =BLOC(condition="METHODE=='MULT_FRONT'",fr="paramètres associés à la méthode multifrontale", + RENUM =SIMP(statut='f',typ='TXM',into=("MD","MDA","METIS"),defaut="METIS" ), + ), + b_ldlt =BLOC(condition="METHODE=='LDLT'",fr="paramètres associés à la méthode LDLT", + RENUM =SIMP(statut='f',typ='TXM',into=("RCMK","SANS"),defaut="RCMK" ), + ), + b_gcpc =BLOC(condition="METHODE=='GCPC'",fr="paramètres associés à la méthode gradient conjugué", + RENUM =SIMP(statut='f',typ='TXM',into=("RCMK","SANS"),defaut="RCMK" ), + ), + INFO =SIMP(statut='f',typ='I',into=(1,2)), +) ; + DEFI_SONDE = OPER(nom="DEFI_SONDE",op= 1,sd_prod=sonde, docu="U2D1", fr="définition d'une sonde historique avec ses coordonnées", @@ -1229,3 +1294,258 @@ FIN=PROC(nom="FIN",op=9999,repetable='n',fr="Fin d'une ) ; +def macro_matr_asse_ops(self,MODELE,CHAM_MATER,CARA_ELEM,MATR_ASSE, + SOLVEUR,NUME_DDL,CHARGE,INST,**args): + """ + Ecriture de la macro MACRO_MATR_ASSE + """ + ier=0 + # On met le mot cle NUME_DDL dans une variable locale pour le proteger + numeddl=NUME_DDL + # On importe les definitions des commandes a utiliser dans la macro + # Le nom de la variable doit etre obligatoirement le nom de la commande + CALC_MATR_ELEM=self.get_cmd('CALC_MATR_ELEM') + NUME_DDL =self.get_cmd('NUME_DDL') + ASSE_MATRICE =self.get_cmd('ASSE_MATRICE') + # La macro compte pour 1 dans la numerotation des commandes + self.icmd=1 + + if SOLVEUR: + methode=SOLVEUR['METHODE'] + if methode=='LDLT': + if SOLVEUR['RENUM']: + renum=SOLVEUR['RENUM'] + else: + renum='RCMK' + if renum not in ('SANS','RCMK'): + ier=ier+1 + self.cr.fatal("Avec methode LDLT, RENUM doit etre SANS ou RCMK.") + return ier + elif methode=='MULT_FRONT': + if SOLVEUR['RENUM']: + renum=SOLVEUR['RENUM'] + else: + renum='MDA' + if renum not in ('MDA','MD','METIS'): + ier=ier+1 + self.cr.fatal("Avec methode MULT_FRONT, RENUM doit etre MDA, MD ou RCMK.") + return ier + elif methode=='GCPC': + if SOLVEUR['RENUM']: + renum=SOLVEUR['RENUM'] + else: + renum='SANS' + if renum not in ('SANS','RCMK'): + ier=ier+1 + self.cr.fatal("Avec methode GCPC, RENUM doit etre SANS ou RCMK.") + return ier + else: + methode='MULT_FRONT' + renum ='MDA' + + if numeddl in self.sdprods: + # Si le concept numeddl est dans self.sdprods + # il doit etre produit par la macro + # il faudra donc appeler la commande NUME_DDL + lnume = 1 + else: + lnume = 0 + lrigel = 0 + lmasel = 0 + + iocc=0 + for m in MATR_ASSE: + iocc=iocc+1 + option=m['OPTION'] + if iocc == 1 and lnume == 1 and option not in ('RIGI_MECA','RIGI_MECA_LAGR', + 'RIGI_THER','RIGI_ACOU') : + ier=ier+1 + self.cr.fatal("LA PREMIERE OPTION DOIT ETRE RIGI_MECA OU RIGI_THER OU RIGI_ACOU OU RIGI_MECA_LAGR") + return ier + + if m['SIEF_ELGA']!=None and option!='RIGI_GEOM': + ier=ier+1 + self.cr.fatal("SIEF_ELGA N EST ADMIS QU AVEC L OPTION RIGI_GEOM") + return ier + + if m['MODE_FOURIER']!=None and option not in ('RIGI_MECA','RIGI_FLUI_STRU','RIGI_THER'): + ier=ier+1 + self.cr.fatal("MODE_FOURIER N EST ADMIS QU AVEC UNE DES OPTIONS RIGI_MECA RIGI_FLUI_STRU RIGI_THER") + return ier + + if (m['THETA']!=None or m['PROPAGATION']!=None) and option!='RIGI_MECA_LAGR': + ier=ier+1 + self.cr.fatal("PROPAGATION ET,OU THETA NE SONT ADMIS QU AVEC L OPTION RIGI_MECA_LAGR") + return ier + motscles={'OPTION':option} + if option == 'AMOR_MECA': + if (not lrigel or not lmasel): + ier=ier+1 + self.cr.fatal("""POUR CALCULER AMOR_MECA, IL FAUT AVOIR CALCULE + RIGI_MECA ET MASS_MECA AUPARAVANT (DANS LE MEME APPEL)""") + return ier + if CHAM_MATER != None: + motscles['RIGI_MECA'] =rigel + motscles['MASS_MECA'] =masel + if CHARGE != None: + if option[0:9] not in ('MASS_THER','RIGI_GEOM','MASS_ID_M'): + motscles['CHARGE'] =CHARGE + if CHAM_MATER != None: motscles['CHAM_MATER'] =CHAM_MATER + if CARA_ELEM != None: motscles['CARA_ELEM'] =CARA_ELEM + if INST != None: motscles['INST'] =INST + if m['SIEF_ELGA'] : motscles['SIEF_ELGA'] =m['SIEF_ELGA'] + if m['MODE_FOURIER']: motscles['MODE_FOURIER']=m['MODE_FOURIER'] + if m['THETA'] : motscles['THETA'] =m['THETA'] + if m['PROPAGATION'] : motscles['PROPAGATION'] =m['PROPAGATION'] + __a=CALC_MATR_ELEM(MODELE=MODELE,**motscles) + + if option == 'RIGI_MECA': + rigel = __a + lrigel = 1 + if option == 'MASS_MECA': + masel = __a + lmasel = 1 + + if lnume and option in ('RIGI_MECA','RIGI_THER','RIGI_ACOU','RIGI_MECA_LAGR'): + self.DeclareOut('num',numeddl) + # On peut passer des mots cles egaux a None. Ils sont ignores + num=NUME_DDL(MATR_RIGI=__a,METHODE=methode,RENUM=renum) + else: + num=numeddl + + self.DeclareOut('mm',m['MATRICE']) + mm=ASSE_MATRICE(MATR_ELEM=__a,NUME_DDL=num) + return ier + +def macro_matr_asse_prod(self,NUME_DDL,MATR_ASSE,**args): + if not MATR_ASSE: raise AsException("Impossible de typer les concepts resultats") + if not NUME_DDL: raise AsException("Impossible de typer les concepts resultats") + self.type_sdprod(NUME_DDL,nume_ddl) + for m in MATR_ASSE: + opti=m['OPTION'] + + if opti in ( "RIGI_MECA","RIGI_FLUI_STRU","RIGI_MECA_LAGR" , + "MASS_MECA" , "MASS_FLUI_STRU" ,"RIGI_GEOM" ,"RIGI_ROTA", + "AMOR_MECA","IMPE_MECA","MASS_ID_MDEP_R","MASS_ID_MDNS_R", + "ONDE_FLUI","MASS_MECA_DIAG" ) : t=matr_asse_depl_r + + if opti in ( "RIGI_ACOU","MASS_ACOU","AMOR_ACOU",) : t=matr_asse_pres_c + + if opti in ( "RIGI_THER","MASS_THER","RIGI_THER_CONV" , + "RIGI_THER_CONV_D","MASS_ID_MTEM_R","MASS_ID_MTNS_R",) : t=matr_asse_temp_r + + if opti == "RIGI_MECA_HYST" : t= matr_asse_depl_c + + self.type_sdprod(m['MATRICE'],t) + return None + +MACRO_MATR_ASSE=MACRO(nom="MACRO_MATR_ASSE",op=macro_matr_asse_ops,docu="U4.61.21-c", + sd_prod=macro_matr_asse_prod, + fr="Calcul des matrices assemblées (matr_asse_gd) par exemple de rigidité, de masse ", + MODELE =SIMP(statut='o',typ=modele), + CHAM_MATER =SIMP(statut='f',typ=cham_mater), + CARA_ELEM =SIMP(statut='f',typ=cara_elem), + CHARGE =SIMP(statut='f',typ=(char_meca,char_ther,char_acou)), + INST =SIMP(statut='f',typ='R'), + NUME_DDL =SIMP(statut='o',typ=(nume_ddl,CO)), + SOLVEUR =FACT(statut='d',min=01,max=01, + METHODE =SIMP(statut='f',typ='TXM',defaut="MULT_FRONT", + into=("LDLT","MULT_FRONT","GCPC")), + RENUM =SIMP(statut='f',typ='TXM',into=("SANS","RCMK","MD","MDA","METIS")), + ), + MATR_ASSE =FACT(statut='o',min=01,max='**', + MATRICE =SIMP(statut='o',typ=(matr_asse,CO)), + OPTION =SIMP(statut='o',typ='TXM', + into=("RIGI_MECA","MASS_MECA","MASS_MECA_DIAG", + "AMOR_MECA","RIGI_MECA_HYST","IMPE_MECA", + "ONDE_FLUI","RIGI_FLUI_STRU","MASS_FLUI_STRU", + "RIGI_ROTA","RIGI_GEOM","RIGI_MECA_LAGR", + "RIGI_THER","MASS_THER", + "RIGI_ACOU","MASS_ACOU","AMOR_ACOU", + "MASS_ID_MTEM_R","MASS_ID_MTNS_R","MASS_ID_MDEP_R","MASS_ID_MDNS_R",) + ), + SIEF_ELGA =SIMP(statut='f',typ=cham_elem_sief_r), + MODE_FOURIER =SIMP(statut='f',typ='I'), + THETA =SIMP(statut='f',typ=theta_geom), + PROPAGATION =SIMP(statut='f',typ='R'), + ), + TITRE =SIMP(statut='f',typ='TXM',max='**'), + INFO =SIMP(statut='f',typ='I',defaut=1,into=(1,2)), +) ; + + +def defi_valeur_prod(self,IS=None,R8=None,TX=None,C8=None,LS=None): + if IS != None : return entier + if R8 != None : return reel + if TX != None : return chaine + if C8 != None : return complexe + if LS != None : return liste + raise AsException("type de concept resultat non prevu") + +DEFI_VALEUR=MACRO(nom="DEFI_VALEUR",op=-4,sd_prod=defi_valeur_prod, + fr="Affectation d une valeur à une variable Superviseur", + docu="U4.31.04-e1",reentrant='f', + regles=(UN_PARMI('IS','R8','TX','C8','LS'),), + IS =SIMP(statut='f',typ='I',max='**'), + R8 =SIMP(statut='f',typ='R',max='**'), + TX =SIMP(statut='f',typ='TXM',max='**'), + C8 =SIMP(statut='f',typ='C',max='**'), + LS =SIMP(statut='f',typ='L',max='**'), +) ; + +def macro2_prod(self,MODELE,**args): + return maillage + +MACRO2 =MACRO(nom="MACRO2",op= -5 ,docu="U4.61.21-c", + sd_prod=macro2_prod, + fr="Calcul des matrices assemblées (matr_asse_gd) par exemple de rigidité, de masse ", + MODELE =SIMP(statut='o',typ=modele), +); + +class concept(ASSD):pass + +def op1_prod(x,**args): + if x == 0:return concept + if x == 1:return concept + raise AsException("type de concept resultat non prevu") + +OP1 = OPER(nom='OP1',op=1,sd_prod=op1_prod,reentrant='f', + a=SIMP(statut='o',typ='I',into=(0,1,2)), + b=SIMP(typ=concept), + ccc=FACT(statut='d',d=SIMP(typ='I'),e=SIMP(typ='I')), + b_1=BLOC(condition="a==0", + x=SIMP(statut='o',typ='I',into=(0,1)), + c=FACT(d=SIMP(typ='I'),e=SIMP(typ='I')), + ), + b_2=BLOC(condition="a==1", + x=SIMP(statut='o',typ='I',into=(0,1)), + b_2=BLOC(condition="1", + cc=FACT(d=SIMP(typ='I'),e=SIMP(typ='I')), + c=FACT(d=SIMP(typ='I'),e=SIMP(typ='I')), + ), + ), + ); + + +def op2_prod(self,x,**args): + if x == 0:return concept + if x == 1:return concept + raise AsException("type de concept resultat non prevu") + +OP2 = MACRO(nom='OP2',op=1,sd_prod=op2_prod,reentrant='f', + a=SIMP(statut='o',typ='I',into=(0,1,2)), + b=SIMP(typ=concept), + ccc=FACT(statut='d',d=SIMP(typ='I'),e=SIMP(typ='I')), + b_1=BLOC(condition="a==0", + x=SIMP(statut='o',typ='I',into=(0,1)), + c=FACT(d=SIMP(typ='I'),e=SIMP(typ='I')), + ), + b_2=BLOC(condition="a==1", + x=SIMP(statut='o',typ='I',into=(0,1)), + b_2=BLOC(condition="1", + cc=FACT(d=SIMP(typ='I'),e=SIMP(typ='I')), + c=FACT(d=SIMP(typ='I'),e=SIMP(typ='I')), + ), + ), + ); + diff --git a/Minicode/eficas_mini.py b/Minicode/eficas_mini.py index c8a97ac1..281ccc8e 100755 --- a/Minicode/eficas_mini.py +++ b/Minicode/eficas_mini.py @@ -3,19 +3,44 @@ Ce module sert à lancer EFICAS configuré pour Code_Mini """ # Modules Python -import sys +import sys,os # Modules Eficas import prefs sys.path[:0]=[prefs.INSTALLDIR] +args=sys.argv[1:] +for a in args: + if a == "-display": + os.environ['DISPLAY']=args[args.index("-display")+1] + import Editeur from Editeur import eficas_go -if len(sys.argv) > 1 : - # on veut ouvrir un fichier directement au lancement d'Eficas - eficas_go.lance_eficas(code='SATURNE',fichier = sys.argv[1]) +def main(): + if len(sys.argv) > 1 : + # on veut ouvrir un fichier directement au lancement d'Eficas + eficas_go.lance_eficas(code='SATURNE',fichier = sys.argv[1]) + else: + # on veut ouvrir Eficas 'vide' + eficas_go.lance_eficas(code='SATURNE') + +def hidez(): + from Misc import Cyclops + z = Cyclops.CycleFinder() + z.run(main) + z.find_cycles() + z.show_stats() + z.show_cycles() + # z.show_cycleobjs() + # z.show_sccs() + z.show_arcs() + +withCyclops=0 + +if withCyclops: + hidez() else: - # on veut ouvrir Eficas 'vide' - eficas_go.lance_eficas(code='SATURNE') + main() + diff --git a/Minicode/prefs.py b/Minicode/prefs.py index f3d82ae8..aa3f6929 100644 --- a/Minicode/prefs.py +++ b/Minicode/prefs.py @@ -14,6 +14,7 @@ INSTALLDIR=os.path.join(REPINI,'..') # Peut valoir None (defaut) CODE_PATH = None #CODE_PATH = os.path.join(REPINI,'../../Superv') +CODE_PATH = "/home01/chris/projet_Eficas/Devel/SUPER6_3/Aster6_3/bibpyt" # ICONDIR sert à localiser le répertoire contenant les icones # Par défaut on utilise le répertoire icons dans Editeur diff --git a/Tools/__init__.py b/Tools/__init__.py index 0366cee6..c060d833 100644 --- a/Tools/__init__.py +++ b/Tools/__init__.py @@ -1,8 +1,20 @@ -#@ MODIF __init__ Tools DATE 15/02/2001 AUTEUR YESSAYAN A.YESSAYAN # CONFIGURATION MANAGEMENT OF EDF VERSION # ====================================================================== -# COPYRIGHT (C) 1991 - 2001 EDF R&D WWW.CODE-ASTER.ORG -# SEE THE FILE "LICENSE.TERMS" FOR INFORMATION ON USAGE AND -# REDISTRIBUTION OF THIS FILE. +# COPYRIGHT (C) 1991 - 2002 EDF R&D WWW.CODE-ASTER.ORG +# THIS PROGRAM IS FREE SOFTWARE; YOU CAN REDISTRIBUTE IT AND/OR MODIFY +# IT UNDER THE TERMS OF THE GNU GENERAL PUBLIC LICENSE AS PUBLISHED BY +# THE FREE SOFTWARE FOUNDATION; EITHER VERSION 2 OF THE LICENSE, OR +# (AT YOUR OPTION) ANY LATER VERSION. +# +# THIS PROGRAM IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL, BUT +# WITHOUT ANY WARRANTY; WITHOUT EVEN THE IMPLIED WARRANTY OF +# MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. SEE THE GNU +# GENERAL PUBLIC LICENSE FOR MORE DETAILS. +# +# YOU SHOULD HAVE RECEIVED A COPY OF THE GNU GENERAL PUBLIC LICENSE +# ALONG WITH THIS PROGRAM; IF NOT, WRITE TO EDF R&D CODE_ASTER, +# 1 AVENUE DU GENERAL DE GAULLE, 92141 CLAMART CEDEX, FRANCE. +# +# # ====================================================================== __all__=['foztools'] diff --git a/convert/Parserv5/Translate.py b/convert/Parserv5/Translate.py index 66ddd27c..4cab28d5 100644 --- a/convert/Parserv5/Translate.py +++ b/convert/Parserv5/Translate.py @@ -1,3 +1,23 @@ +# CONFIGURATION MANAGEMENT OF EDF VERSION +# ====================================================================== +# COPYRIGHT (C) 1991 - 2002 EDF R&D WWW.CODE-ASTER.ORG +# THIS PROGRAM IS FREE SOFTWARE; YOU CAN REDISTRIBUTE IT AND/OR MODIFY +# IT UNDER THE TERMS OF THE GNU GENERAL PUBLIC LICENSE AS PUBLISHED BY +# THE FREE SOFTWARE FOUNDATION; EITHER VERSION 2 OF THE LICENSE, OR +# (AT YOUR OPTION) ANY LATER VERSION. +# +# THIS PROGRAM IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL, BUT +# WITHOUT ANY WARRANTY; WITHOUT EVEN THE IMPLIED WARRANTY OF +# MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. SEE THE GNU +# GENERAL PUBLIC LICENSE FOR MORE DETAILS. +# +# YOU SHOULD HAVE RECEIVED A COPY OF THE GNU GENERAL PUBLIC LICENSE +# ALONG WITH THIS PROGRAM; IF NOT, WRITE TO EDF R&D CODE_ASTER, +# 1 AVENUE DU GENERAL DE GAULLE, 92141 CLAMART CEDEX, FRANCE. +# +# +# ====================================================================== + #!/bin/env python -d #!/tools/net/app/Python-1.5.2/bin/python1.5 diff --git a/convert/Parserv5/__init__.py b/convert/Parserv5/__init__.py index 96e6d4d3..21ab883a 100644 --- a/convert/Parserv5/__init__.py +++ b/convert/Parserv5/__init__.py @@ -1,3 +1,23 @@ +# CONFIGURATION MANAGEMENT OF EDF VERSION +# ====================================================================== +# COPYRIGHT (C) 1991 - 2002 EDF R&D WWW.CODE-ASTER.ORG +# THIS PROGRAM IS FREE SOFTWARE; YOU CAN REDISTRIBUTE IT AND/OR MODIFY +# IT UNDER THE TERMS OF THE GNU GENERAL PUBLIC LICENSE AS PUBLISHED BY +# THE FREE SOFTWARE FOUNDATION; EITHER VERSION 2 OF THE LICENSE, OR +# (AT YOUR OPTION) ANY LATER VERSION. +# +# THIS PROGRAM IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL, BUT +# WITHOUT ANY WARRANTY; WITHOUT EVEN THE IMPLIED WARRANTY OF +# MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. SEE THE GNU +# GENERAL PUBLIC LICENSE FOR MORE DETAILS. +# +# YOU SHOULD HAVE RECEIVED A COPY OF THE GNU GENERAL PUBLIC LICENSE +# ALONG WITH THIS PROGRAM; IF NOT, WRITE TO EDF R&D CODE_ASTER, +# 1 AVENUE DU GENERAL DE GAULLE, 92141 CLAMART CEDEX, FRANCE. +# +# +# ====================================================================== + try: import mx.TextTools import sys diff --git a/convert/Parserv5/conv.py b/convert/Parserv5/conv.py index 8f9621c2..4f4aba8b 100644 --- a/convert/Parserv5/conv.py +++ b/convert/Parserv5/conv.py @@ -1,17 +1,30 @@ -#@ MODIF conv Parsers DATE 17/10/2001 AUTEUR DURAND C.DURAND # CONFIGURATION MANAGEMENT OF EDF VERSION # ====================================================================== -# COPYRIGHT (C) 1991 - 2001 EDF R&D WWW.CODE-ASTER.ORG -# SEE THE FILE "LICENSE.TERMS" FOR INFORMATION ON USAGE AND -# REDISTRIBUTION OF THIS FILE. +# COPYRIGHT (C) 1991 - 2002 EDF R&D WWW.CODE-ASTER.ORG +# THIS PROGRAM IS FREE SOFTWARE; YOU CAN REDISTRIBUTE IT AND/OR MODIFY +# IT UNDER THE TERMS OF THE GNU GENERAL PUBLIC LICENSE AS PUBLISHED BY +# THE FREE SOFTWARE FOUNDATION; EITHER VERSION 2 OF THE LICENSE, OR +# (AT YOUR OPTION) ANY LATER VERSION. +# +# THIS PROGRAM IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL, BUT +# WITHOUT ANY WARRANTY; WITHOUT EVEN THE IMPLIED WARRANTY OF +# MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. SEE THE GNU +# GENERAL PUBLIC LICENSE FOR MORE DETAILS. +# +# YOU SHOULD HAVE RECEIVED A COPY OF THE GNU GENERAL PUBLIC LICENSE +# ALONG WITH THIS PROGRAM; IF NOT, WRITE TO EDF R&D CODE_ASTER, +# 1 AVENUE DU GENERAL DE GAULLE, 92141 CLAMART CEDEX, FRANCE. +# +# # ====================================================================== + import sys,string import TextTools from tables import ERRORS # -__version__="$Name: V1_1p1 $" -__Id__="$Id: conv.py,v 1.1.1.1 2001/12/04 15:38:23 eficas Exp $" +__version__="$Name: $" +__Id__="$Id: conv.py,v 1.1.1.1 2002/03/26 09:08:45 eficas Exp $" # Keywords=('MAILLE_1','MAILLE_2','MAILLE_ESCL','MAILLE_FOND','MAILLE_MAIT','MAILLE_ORIG','MAILLE', diff --git a/convert/Parserv5/tables.py b/convert/Parserv5/tables.py index 513b0011..b258354d 100644 --- a/convert/Parserv5/tables.py +++ b/convert/Parserv5/tables.py @@ -1,4 +1,23 @@ -#@ MODIF tables Parsers DATE 15/02/2001 AUTEUR YESSAYAN A.YESSAYAN +# CONFIGURATION MANAGEMENT OF EDF VERSION +# ====================================================================== +# COPYRIGHT (C) 1991 - 2002 EDF R&D WWW.CODE-ASTER.ORG +# THIS PROGRAM IS FREE SOFTWARE; YOU CAN REDISTRIBUTE IT AND/OR MODIFY +# IT UNDER THE TERMS OF THE GNU GENERAL PUBLIC LICENSE AS PUBLISHED BY +# THE FREE SOFTWARE FOUNDATION; EITHER VERSION 2 OF THE LICENSE, OR +# (AT YOUR OPTION) ANY LATER VERSION. +# +# THIS PROGRAM IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL, BUT +# WITHOUT ANY WARRANTY; WITHOUT EVEN THE IMPLIED WARRANTY OF +# MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. SEE THE GNU +# GENERAL PUBLIC LICENSE FOR MORE DETAILS. +# +# YOU SHOULD HAVE RECEIVED A COPY OF THE GNU GENERAL PUBLIC LICENSE +# ALONG WITH THIS PROGRAM; IF NOT, WRITE TO EDF R&D CODE_ASTER, +# 1 AVENUE DU GENERAL DE GAULLE, 92141 CLAMART CEDEX, FRANCE. +# +# +# ====================================================================== + """ Ce fichier définit une table de tags à utiliser avec le package mxTextTools pour décoder un fichier au format Asterv5. @@ -10,7 +29,7 @@ from TextTools import * # __version__="$Name: $" -__Id__="$Id: tables.tag,v 1.11.18.1 2001/06/15 17:20:24 iliade Exp $" +__Id__="$Id: tables.tag,v 1.1.1.1 2002/03/26 09:08:45 eficas Exp $" # err0='ERR0 , erreur non identifiee : ' @@ -24,9 +43,10 @@ err7='ERR7 , mot cle facteur errone : ' err8='ERR8 , signe = ou ( attendu : ' err9='ERR9 , ( attendue : ' err10='ERR10 , vexpr attendue : ' +err11='ERR11 , ) attendue : ' ERRORS=(err0,err1,err2,err3,err4,err5,err6,err7,err8,err9, - err10) + err10,err11) white_set=set(whitespace) @@ -170,6 +190,16 @@ t_complexe = \ (err7,Table,t_err,MatchFail,MatchOk), )) +# Table pour identifier le keyword PI + +t_PI = \ + ('PI',Table,( + (None,Word,'PI',MatchFail), + (None,IsIn,alpha+'_'+number,MatchOk,+1), + (None,Skip,-1), + (None,Jump,To,MatchFail), + )) + t_vexpr = ( ('par',Is,'(',+5,+1), commespaces + (+1,), @@ -181,7 +211,7 @@ t_vexpr = ( ('sign',IsIn,'+-',+3,+1), commespaces + (+1,), ('vexpr',Table,ThisTable,+19,+10), - ("PI",Word,'PI',+1,+9), + t_PI + (+1,+9), t_ident + (MatchFail,), commespaces + (+1,), ('listpar',Is,'(',+6,+1), # on peut avoir une liste de parametres @@ -307,9 +337,9 @@ t_formule = \ commespaces + (+1,), ('vexpr',Table,t_vexpr,+9), commespaces + (+1,), - (None,Is,')',+8), + (None,Is,')',+9), commespaces + (+1,), - (None,Is,')',+6), + (None,Is,')',+7), commespaces + (+1,), (None,Is,';',+3), (None,AllNotIn,'\n',+1), @@ -318,6 +348,8 @@ t_formule = \ (err0,Table,t_err,MatchFail,MatchOk), # (err9,Table,t_err,MatchFail,MatchOk), + # + (err11,Table,t_err,MatchFail,MatchOk), )) t_nom_ope = \ diff --git a/convert/Parserv5/tables.tag b/convert/Parserv5/tables.tag index 2a28f072..309dd497 100755 --- a/convert/Parserv5/tables.tag +++ b/convert/Parserv5/tables.tag @@ -1,4 +1,23 @@ -#@ MODIF tables Parsers DATE 15/02/2001 AUTEUR YESSAYAN A.YESSAYAN +# CONFIGURATION MANAGEMENT OF EDF VERSION +# ====================================================================== +# COPYRIGHT (C) 1991 - 2002 EDF R&D WWW.CODE-ASTER.ORG +# THIS PROGRAM IS FREE SOFTWARE; YOU CAN REDISTRIBUTE IT AND/OR MODIFY +# IT UNDER THE TERMS OF THE GNU GENERAL PUBLIC LICENSE AS PUBLISHED BY +# THE FREE SOFTWARE FOUNDATION; EITHER VERSION 2 OF THE LICENSE, OR +# (AT YOUR OPTION) ANY LATER VERSION. +# +# THIS PROGRAM IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL, BUT +# WITHOUT ANY WARRANTY; WITHOUT EVEN THE IMPLIED WARRANTY OF +# MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. SEE THE GNU +# GENERAL PUBLIC LICENSE FOR MORE DETAILS. +# +# YOU SHOULD HAVE RECEIVED A COPY OF THE GNU GENERAL PUBLIC LICENSE +# ALONG WITH THIS PROGRAM; IF NOT, WRITE TO EDF R&D CODE_ASTER, +# 1 AVENUE DU GENERAL DE GAULLE, 92141 CLAMART CEDEX, FRANCE. +# +# +# ====================================================================== + """ Ce fichier définit une table de tags à utiliser avec le package mxTextTools pour décoder un fichier au format Asterv5. @@ -10,7 +29,7 @@ from TextTools import * # __version__="$Name: $" -__Id__="$Id: tables.tag,v 1.11.18.1 2001/06/15 17:20:24 iliade Exp $" +__Id__="$Id: tables.tag,v 1.1.1.1 2002/03/26 09:08:45 eficas Exp $" # err0='ERR0 , erreur non identifiee : ' @@ -24,9 +43,10 @@ err7='ERR7 , mot cle facteur errone : ' err8='ERR8 , signe = ou ( attendu : ' err9='ERR9 , ( attendue : ' err10='ERR10 , vexpr attendue : ' +err11='ERR11 , ) attendue : ' ERRORS=(err0,err1,err2,err3,err4,err5,err6,err7,err8,err9, - err10) + err10,err11) white_set=set(whitespace) @@ -158,6 +178,15 @@ t_complexe is: err7 = Table t_err F:MatchFail T:MatchOk +# Table pour identifier le keyword PI + +t_PI is: + 'PI' = Table is: + Word 'PI' F:MatchFail + IsIn alpha+'_'+number F:MatchOk T:next + Skip back + Jump To MatchFail + t_vexpr = Table is: 'par' = Is '(': commespaces F:next @@ -169,7 +198,7 @@ t_vexpr = Table is: 'sign' = IsIn '+-': commespaces F:next 'vexpr' = Table ThisTable F: T: - "PI" = Word 'PI' F:next T: + t_PI F:next T: t_ident F:MatchFail commespaces F:next 'listpar' = Is '(': # on peut avoir une liste de parametres @@ -287,9 +316,9 @@ t_formule is: commespaces F:next 'vexpr' = Table t_vexpr F: commespaces F:next - Is ')' F: + Is ')' F: commespaces F:next - Is ')' F: + Is ')' F: commespaces F:next Is ';' F: AllNotIn '\n' F:next @@ -298,6 +327,8 @@ t_formule is: err0 = Table t_err F:MatchFail T:MatchOk err9 = Table t_err F:MatchFail T:MatchOk + + err11 = Table t_err F:MatchFail T:MatchOk t_nom_ope is: 'nom_ope' = Table is: diff --git a/convert/__init__.py b/convert/__init__.py index c6d52220..e731b26d 100644 --- a/convert/__init__.py +++ b/convert/__init__.py @@ -1,3 +1,22 @@ +# CONFIGURATION MANAGEMENT OF EDF VERSION +# ====================================================================== +# COPYRIGHT (C) 1991 - 2002 EDF R&D WWW.CODE-ASTER.ORG +# THIS PROGRAM IS FREE SOFTWARE; YOU CAN REDISTRIBUTE IT AND/OR MODIFY +# IT UNDER THE TERMS OF THE GNU GENERAL PUBLIC LICENSE AS PUBLISHED BY +# THE FREE SOFTWARE FOUNDATION; EITHER VERSION 2 OF THE LICENSE, OR +# (AT YOUR OPTION) ANY LATER VERSION. +# +# THIS PROGRAM IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL, BUT +# WITHOUT ANY WARRANTY; WITHOUT EVEN THE IMPLIED WARRANTY OF +# MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. SEE THE GNU +# GENERAL PUBLIC LICENSE FOR MORE DETAILS. +# +# YOU SHOULD HAVE RECEIVED A COPY OF THE GNU GENERAL PUBLIC LICENSE +# ALONG WITH THIS PROGRAM; IF NOT, WRITE TO EDF R&D CODE_ASTER, +# 1 AVENUE DU GENERAL DE GAULLE, 92141 CLAMART CEDEX, FRANCE. +# +# +# ====================================================================== """ Ce package contient tous les convertisseurs de formats d'entrée en objets compréhensibles par EFICAS. diff --git a/convert/convert_asterv5.py b/convert/convert_asterv5.py index 780626d8..e025eec2 100644 --- a/convert/convert_asterv5.py +++ b/convert/convert_asterv5.py @@ -1,3 +1,22 @@ +# CONFIGURATION MANAGEMENT OF EDF VERSION +# ====================================================================== +# COPYRIGHT (C) 1991 - 2002 EDF R&D WWW.CODE-ASTER.ORG +# THIS PROGRAM IS FREE SOFTWARE; YOU CAN REDISTRIBUTE IT AND/OR MODIFY +# IT UNDER THE TERMS OF THE GNU GENERAL PUBLIC LICENSE AS PUBLISHED BY +# THE FREE SOFTWARE FOUNDATION; EITHER VERSION 2 OF THE LICENSE, OR +# (AT YOUR OPTION) ANY LATER VERSION. +# +# THIS PROGRAM IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL, BUT +# WITHOUT ANY WARRANTY; WITHOUT EVEN THE IMPLIED WARRANTY OF +# MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. SEE THE GNU +# GENERAL PUBLIC LICENSE FOR MORE DETAILS. +# +# YOU SHOULD HAVE RECEIVED A COPY OF THE GNU GENERAL PUBLIC LICENSE +# ALONG WITH THIS PROGRAM; IF NOT, WRITE TO EDF R&D CODE_ASTER, +# 1 AVENUE DU GENERAL DE GAULLE, 92141 CLAMART CEDEX, FRANCE. +# +# +# ====================================================================== """ Ce module contient le plugin convertisseur de fichier au format asterv5 pour EFICAS. diff --git a/convert/convert_ini.py b/convert/convert_ini.py index aa32a725..811bc6a5 100644 --- a/convert/convert_ini.py +++ b/convert/convert_ini.py @@ -1,3 +1,22 @@ +# CONFIGURATION MANAGEMENT OF EDF VERSION +# ====================================================================== +# COPYRIGHT (C) 1991 - 2002 EDF R&D WWW.CODE-ASTER.ORG +# THIS PROGRAM IS FREE SOFTWARE; YOU CAN REDISTRIBUTE IT AND/OR MODIFY +# IT UNDER THE TERMS OF THE GNU GENERAL PUBLIC LICENSE AS PUBLISHED BY +# THE FREE SOFTWARE FOUNDATION; EITHER VERSION 2 OF THE LICENSE, OR +# (AT YOUR OPTION) ANY LATER VERSION. +# +# THIS PROGRAM IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL, BUT +# WITHOUT ANY WARRANTY; WITHOUT EVEN THE IMPLIED WARRANTY OF +# MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. SEE THE GNU +# GENERAL PUBLIC LICENSE FOR MORE DETAILS. +# +# YOU SHOULD HAVE RECEIVED A COPY OF THE GNU GENERAL PUBLIC LICENSE +# ALONG WITH THIS PROGRAM; IF NOT, WRITE TO EDF R&D CODE_ASTER, +# 1 AVENUE DU GENERAL DE GAULLE, 92141 CLAMART CEDEX, FRANCE. +# +# +# ====================================================================== """ Ce module contient le plugin convertisseur de fichier au format ini pour EFICAS. diff --git a/convert/convert_pyth.py b/convert/convert_pyth.py index 30f3b28a..b408ff21 100644 --- a/convert/convert_pyth.py +++ b/convert/convert_pyth.py @@ -1,3 +1,22 @@ +# CONFIGURATION MANAGEMENT OF EDF VERSION +# ====================================================================== +# COPYRIGHT (C) 1991 - 2002 EDF R&D WWW.CODE-ASTER.ORG +# THIS PROGRAM IS FREE SOFTWARE; YOU CAN REDISTRIBUTE IT AND/OR MODIFY +# IT UNDER THE TERMS OF THE GNU GENERAL PUBLIC LICENSE AS PUBLISHED BY +# THE FREE SOFTWARE FOUNDATION; EITHER VERSION 2 OF THE LICENSE, OR +# (AT YOUR OPTION) ANY LATER VERSION. +# +# THIS PROGRAM IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL, BUT +# WITHOUT ANY WARRANTY; WITHOUT EVEN THE IMPLIED WARRANTY OF +# MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. SEE THE GNU +# GENERAL PUBLIC LICENSE FOR MORE DETAILS. +# +# YOU SHOULD HAVE RECEIVED A COPY OF THE GNU GENERAL PUBLIC LICENSE +# ALONG WITH THIS PROGRAM; IF NOT, WRITE TO EDF R&D CODE_ASTER, +# 1 AVENUE DU GENERAL DE GAULLE, 92141 CLAMART CEDEX, FRANCE. +# +# +# ====================================================================== """ Ce module contient le plugin convertisseur de fichier au format python pour EFICAS. diff --git a/convert/convert_python.py b/convert/convert_python.py index a5a69cb2..cfe54a6a 100644 --- a/convert/convert_python.py +++ b/convert/convert_python.py @@ -1,3 +1,22 @@ +# CONFIGURATION MANAGEMENT OF EDF VERSION +# ====================================================================== +# COPYRIGHT (C) 1991 - 2002 EDF R&D WWW.CODE-ASTER.ORG +# THIS PROGRAM IS FREE SOFTWARE; YOU CAN REDISTRIBUTE IT AND/OR MODIFY +# IT UNDER THE TERMS OF THE GNU GENERAL PUBLIC LICENSE AS PUBLISHED BY +# THE FREE SOFTWARE FOUNDATION; EITHER VERSION 2 OF THE LICENSE, OR +# (AT YOUR OPTION) ANY LATER VERSION. +# +# THIS PROGRAM IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL, BUT +# WITHOUT ANY WARRANTY; WITHOUT EVEN THE IMPLIED WARRANTY OF +# MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. SEE THE GNU +# GENERAL PUBLIC LICENSE FOR MORE DETAILS. +# +# YOU SHOULD HAVE RECEIVED A COPY OF THE GNU GENERAL PUBLIC LICENSE +# ALONG WITH THIS PROGRAM; IF NOT, WRITE TO EDF R&D CODE_ASTER, +# 1 AVENUE DU GENERAL DE GAULLE, 92141 CLAMART CEDEX, FRANCE. +# +# +# ====================================================================== """ Ce module contient le plugin convertisseur de fichier au format python pour EFICAS. diff --git a/convert/parseur_python.py b/convert/parseur_python.py index b999b6ba..b5a45897 100644 --- a/convert/parseur_python.py +++ b/convert/parseur_python.py @@ -1,9 +1,21 @@ -#@ MODIF parseur_python Parsers DATE 05/09/2001 AUTEUR DURAND C.DURAND # CONFIGURATION MANAGEMENT OF EDF VERSION # ====================================================================== -# COPYRIGHT (C) 1991 - 2001 EDF R&D WWW.CODE-ASTER.ORG -# SEE THE FILE "LICENSE.TERMS" FOR INFORMATION ON USAGE AND -# REDISTRIBUTION OF THIS FILE. +# COPYRIGHT (C) 1991 - 2002 EDF R&D WWW.CODE-ASTER.ORG +# THIS PROGRAM IS FREE SOFTWARE; YOU CAN REDISTRIBUTE IT AND/OR MODIFY +# IT UNDER THE TERMS OF THE GNU GENERAL PUBLIC LICENSE AS PUBLISHED BY +# THE FREE SOFTWARE FOUNDATION; EITHER VERSION 2 OF THE LICENSE, OR +# (AT YOUR OPTION) ANY LATER VERSION. +# +# THIS PROGRAM IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL, BUT +# WITHOUT ANY WARRANTY; WITHOUT EVEN THE IMPLIED WARRANTY OF +# MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. SEE THE GNU +# GENERAL PUBLIC LICENSE FOR MORE DETAILS. +# +# YOU SHOULD HAVE RECEIVED A COPY OF THE GNU GENERAL PUBLIC LICENSE +# ALONG WITH THIS PROGRAM; IF NOT, WRITE TO EDF R&D CODE_ASTER, +# 1 AVENUE DU GENERAL DE GAULLE, 92141 CLAMART CEDEX, FRANCE. +# +# # ====================================================================== import sys,string,re diff --git a/generator/Formatage.py b/generator/Formatage.py index d54d464c..aaa531a5 100644 --- a/generator/Formatage.py +++ b/generator/Formatage.py @@ -1,3 +1,22 @@ +# CONFIGURATION MANAGEMENT OF EDF VERSION +# ====================================================================== +# COPYRIGHT (C) 1991 - 2002 EDF R&D WWW.CODE-ASTER.ORG +# THIS PROGRAM IS FREE SOFTWARE; YOU CAN REDISTRIBUTE IT AND/OR MODIFY +# IT UNDER THE TERMS OF THE GNU GENERAL PUBLIC LICENSE AS PUBLISHED BY +# THE FREE SOFTWARE FOUNDATION; EITHER VERSION 2 OF THE LICENSE, OR +# (AT YOUR OPTION) ANY LATER VERSION. +# +# THIS PROGRAM IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL, BUT +# WITHOUT ANY WARRANTY; WITHOUT EVEN THE IMPLIED WARRANTY OF +# MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. SEE THE GNU +# GENERAL PUBLIC LICENSE FOR MORE DETAILS. +# +# YOU SHOULD HAVE RECEIVED A COPY OF THE GNU GENERAL PUBLIC LICENSE +# ALONG WITH THIS PROGRAM; IF NOT, WRITE TO EDF R&D CODE_ASTER, +# 1 AVENUE DU GENERAL DE GAULLE, 92141 CLAMART CEDEX, FRANCE. +# +# +# ====================================================================== """ Ce module contient la classe Formatage qui permet le formatage d'une liste de chaines de caractères dans une syntaxe représentative d'un diff --git a/generator/__init__.py b/generator/__init__.py index 89d4cb40..39110152 100644 --- a/generator/__init__.py +++ b/generator/__init__.py @@ -1,3 +1,22 @@ +# CONFIGURATION MANAGEMENT OF EDF VERSION +# ====================================================================== +# COPYRIGHT (C) 1991 - 2002 EDF R&D WWW.CODE-ASTER.ORG +# THIS PROGRAM IS FREE SOFTWARE; YOU CAN REDISTRIBUTE IT AND/OR MODIFY +# IT UNDER THE TERMS OF THE GNU GENERAL PUBLIC LICENSE AS PUBLISHED BY +# THE FREE SOFTWARE FOUNDATION; EITHER VERSION 2 OF THE LICENSE, OR +# (AT YOUR OPTION) ANY LATER VERSION. +# +# THIS PROGRAM IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL, BUT +# WITHOUT ANY WARRANTY; WITHOUT EVEN THE IMPLIED WARRANTY OF +# MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. SEE THE GNU +# GENERAL PUBLIC LICENSE FOR MORE DETAILS. +# +# YOU SHOULD HAVE RECEIVED A COPY OF THE GNU GENERAL PUBLIC LICENSE +# ALONG WITH THIS PROGRAM; IF NOT, WRITE TO EDF R&D CODE_ASTER, +# 1 AVENUE DU GENERAL DE GAULLE, 92141 CLAMART CEDEX, FRANCE. +# +# +# ====================================================================== """ Ce package contient tous les générateurs de formats de sortie à partir des objets d' EFICAS. diff --git a/generator/generator_aplat.py b/generator/generator_aplat.py index c12b6dac..25c3265f 100644 --- a/generator/generator_aplat.py +++ b/generator/generator_aplat.py @@ -1,3 +1,22 @@ +# CONFIGURATION MANAGEMENT OF EDF VERSION +# ====================================================================== +# COPYRIGHT (C) 1991 - 2002 EDF R&D WWW.CODE-ASTER.ORG +# THIS PROGRAM IS FREE SOFTWARE; YOU CAN REDISTRIBUTE IT AND/OR MODIFY +# IT UNDER THE TERMS OF THE GNU GENERAL PUBLIC LICENSE AS PUBLISHED BY +# THE FREE SOFTWARE FOUNDATION; EITHER VERSION 2 OF THE LICENSE, OR +# (AT YOUR OPTION) ANY LATER VERSION. +# +# THIS PROGRAM IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL, BUT +# WITHOUT ANY WARRANTY; WITHOUT EVEN THE IMPLIED WARRANTY OF +# MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. SEE THE GNU +# GENERAL PUBLIC LICENSE FOR MORE DETAILS. +# +# YOU SHOULD HAVE RECEIVED A COPY OF THE GNU GENERAL PUBLIC LICENSE +# ALONG WITH THIS PROGRAM; IF NOT, WRITE TO EDF R&D CODE_ASTER, +# 1 AVENUE DU GENERAL DE GAULLE, 92141 CLAMART CEDEX, FRANCE. +# +# +# ====================================================================== """ Ce module contient le plugin generateur de fichier au format aplat pour EFICAS. @@ -268,7 +287,7 @@ class AplatGenerator: text = '' init = self.init + self.sep + obj.nom old_init=self.init - for data in self.data : + for data in obj.data : i=i+1 self.init = init + self.sep + "occurrence n°"+`i` text = text + self.generator(data) @@ -283,7 +302,7 @@ class AplatGenerator: if type(obj.valeur) in (types.TupleType,types.ListType) : # On est en présence d'une liste de valeur rep = '(' - for val in self.valeur: + for val in obj.valeur: if type(val) == types.InstanceType : rep = rep + self.generator(val) +',' else: diff --git a/generator/generator_asterv5.py b/generator/generator_asterv5.py index fa3b9499..d634158a 100644 --- a/generator/generator_asterv5.py +++ b/generator/generator_asterv5.py @@ -1,3 +1,22 @@ +# CONFIGURATION MANAGEMENT OF EDF VERSION +# ====================================================================== +# COPYRIGHT (C) 1991 - 2002 EDF R&D WWW.CODE-ASTER.ORG +# THIS PROGRAM IS FREE SOFTWARE; YOU CAN REDISTRIBUTE IT AND/OR MODIFY +# IT UNDER THE TERMS OF THE GNU GENERAL PUBLIC LICENSE AS PUBLISHED BY +# THE FREE SOFTWARE FOUNDATION; EITHER VERSION 2 OF THE LICENSE, OR +# (AT YOUR OPTION) ANY LATER VERSION. +# +# THIS PROGRAM IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL, BUT +# WITHOUT ANY WARRANTY; WITHOUT EVEN THE IMPLIED WARRANTY OF +# MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. SEE THE GNU +# GENERAL PUBLIC LICENSE FOR MORE DETAILS. +# +# YOU SHOULD HAVE RECEIVED A COPY OF THE GNU GENERAL PUBLIC LICENSE +# ALONG WITH THIS PROGRAM; IF NOT, WRITE TO EDF R&D CODE_ASTER, +# 1 AVENUE DU GENERAL DE GAULLE, 92141 CLAMART CEDEX, FRANCE. +# +# +# ====================================================================== """ Ce module contient le plugin generateur de fichier au format asterv5 pour EFICAS. diff --git a/generator/generator_ini.py b/generator/generator_ini.py index 64b5bfd8..2e2ac93b 100644 --- a/generator/generator_ini.py +++ b/generator/generator_ini.py @@ -1,3 +1,22 @@ +# CONFIGURATION MANAGEMENT OF EDF VERSION +# ====================================================================== +# COPYRIGHT (C) 1991 - 2002 EDF R&D WWW.CODE-ASTER.ORG +# THIS PROGRAM IS FREE SOFTWARE; YOU CAN REDISTRIBUTE IT AND/OR MODIFY +# IT UNDER THE TERMS OF THE GNU GENERAL PUBLIC LICENSE AS PUBLISHED BY +# THE FREE SOFTWARE FOUNDATION; EITHER VERSION 2 OF THE LICENSE, OR +# (AT YOUR OPTION) ANY LATER VERSION. +# +# THIS PROGRAM IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL, BUT +# WITHOUT ANY WARRANTY; WITHOUT EVEN THE IMPLIED WARRANTY OF +# MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. SEE THE GNU +# GENERAL PUBLIC LICENSE FOR MORE DETAILS. +# +# YOU SHOULD HAVE RECEIVED A COPY OF THE GNU GENERAL PUBLIC LICENSE +# ALONG WITH THIS PROGRAM; IF NOT, WRITE TO EDF R&D CODE_ASTER, +# 1 AVENUE DU GENERAL DE GAULLE, 92141 CLAMART CEDEX, FRANCE. +# +# +# ====================================================================== """ Ce module contient le plugin generateur de fichier au format ini pour EFICAS. diff --git a/generator/generator_pyth.py b/generator/generator_pyth.py index 6d911224..34fa5cf7 100644 --- a/generator/generator_pyth.py +++ b/generator/generator_pyth.py @@ -1,3 +1,22 @@ +# CONFIGURATION MANAGEMENT OF EDF VERSION +# ====================================================================== +# COPYRIGHT (C) 1991 - 2002 EDF R&D WWW.CODE-ASTER.ORG +# THIS PROGRAM IS FREE SOFTWARE; YOU CAN REDISTRIBUTE IT AND/OR MODIFY +# IT UNDER THE TERMS OF THE GNU GENERAL PUBLIC LICENSE AS PUBLISHED BY +# THE FREE SOFTWARE FOUNDATION; EITHER VERSION 2 OF THE LICENSE, OR +# (AT YOUR OPTION) ANY LATER VERSION. +# +# THIS PROGRAM IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL, BUT +# WITHOUT ANY WARRANTY; WITHOUT EVEN THE IMPLIED WARRANTY OF +# MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. SEE THE GNU +# GENERAL PUBLIC LICENSE FOR MORE DETAILS. +# +# YOU SHOULD HAVE RECEIVED A COPY OF THE GNU GENERAL PUBLIC LICENSE +# ALONG WITH THIS PROGRAM; IF NOT, WRITE TO EDF R&D CODE_ASTER, +# 1 AVENUE DU GENERAL DE GAULLE, 92141 CLAMART CEDEX, FRANCE. +# +# +# ====================================================================== """ Ce module contient le plugin generateur de fichier au format pyth pour EFICAS. diff --git a/generator/generator_python.py b/generator/generator_python.py index 6220c818..87c55ca5 100644 --- a/generator/generator_python.py +++ b/generator/generator_python.py @@ -1,3 +1,22 @@ +# CONFIGURATION MANAGEMENT OF EDF VERSION +# ====================================================================== +# COPYRIGHT (C) 1991 - 2002 EDF R&D WWW.CODE-ASTER.ORG +# THIS PROGRAM IS FREE SOFTWARE; YOU CAN REDISTRIBUTE IT AND/OR MODIFY +# IT UNDER THE TERMS OF THE GNU GENERAL PUBLIC LICENSE AS PUBLISHED BY +# THE FREE SOFTWARE FOUNDATION; EITHER VERSION 2 OF THE LICENSE, OR +# (AT YOUR OPTION) ANY LATER VERSION. +# +# THIS PROGRAM IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL, BUT +# WITHOUT ANY WARRANTY; WITHOUT EVEN THE IMPLIED WARRANTY OF +# MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. SEE THE GNU +# GENERAL PUBLIC LICENSE FOR MORE DETAILS. +# +# YOU SHOULD HAVE RECEIVED A COPY OF THE GNU GENERAL PUBLIC LICENSE +# ALONG WITH THIS PROGRAM; IF NOT, WRITE TO EDF R&D CODE_ASTER, +# 1 AVENUE DU GENERAL DE GAULLE, 92141 CLAMART CEDEX, FRANCE. +# +# +# ====================================================================== """ Ce module contient le plugin generateur de fichier au format python pour EFICAS. @@ -453,6 +472,8 @@ class PythonGenerator: if hasattr(obj.etape,'sdprods'): if val in obj.etape.sdprods : s = s + "CO('"+ self.generator(val) +"')" + elif val.__class__.__name__ == 'CO': + s = s + "CO('"+ self.generator(val) +"')" else: s = s + self.generator(val) elif isinstance(val,PARAMETRE): @@ -472,6 +493,8 @@ class PythonGenerator: if hasattr(obj.etape,'sdprods'): if val in obj.etape.sdprods : s = "CO('"+ self.generator(val) +"')" + elif val.__class__.__name__ == 'CO': + s = "CO('"+ self.generator(val) +"')" else: s = self.generator(val) elif isinstance(val,PARAMETRE):