1 # CONFIGURATION MANAGEMENT OF EDF VERSION
2 # ======================================================================
3 # COPYRIGHT (C) 1991 - 2002 EDF R&D WWW.CODE-ASTER.ORG
4 # THIS PROGRAM IS FREE SOFTWARE; YOU CAN REDISTRIBUTE IT AND/OR MODIFY
5 # IT UNDER THE TERMS OF THE GNU GENERAL PUBLIC LICENSE AS PUBLISHED BY
6 # THE FREE SOFTWARE FOUNDATION; EITHER VERSION 2 OF THE LICENSE, OR
7 # (AT YOUR OPTION) ANY LATER VERSION.
9 # THIS PROGRAM IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL, BUT
10 # WITHOUT ANY WARRANTY; WITHOUT EVEN THE IMPLIED WARRANTY OF
11 # MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. SEE THE GNU
12 # GENERAL PUBLIC LICENSE FOR MORE DETAILS.
14 # YOU SHOULD HAVE RECEIVED A COPY OF THE GNU GENERAL PUBLIC LICENSE
15 # ALONG WITH THIS PROGRAM; IF NOT, WRITE TO EDF R&D CODE_ASTER,
16 # 1 AVENUE DU GENERAL DE GAULLE, 92141 CLAMART CEDEX, FRANCE.
19 # ======================================================================
23 # import rajoutés suite à l'ajout de Build_sd --> à résorber
25 import traceback,types,string
27 from Noyau import N_Exception
28 from Noyau.N_Exception import AsException
29 # fin import à résorber
31 class PROC_ETAPE(I_ETAPE.ETAPE):
35 def get_sdprods(self,nom_sd):
37 Fonction : retourne le concept produit par l etape de nom nom_sd
38 s il existe sinon None
39 Une PROC ne produit aucun concept
43 def delete_concept(self,sd):
48 Mettre a jour les mots cles de l etape
49 suite à la disparition du concept sd
50 Seuls les mots cles simples MCSIMP font un traitement autre
51 que de transmettre aux fils
53 for child in self.mc_liste :
54 child.delete_concept(sd)
56 def replace_concept(self,old_sd,sd):
59 old_sd=concept remplacé
62 Mettre a jour les mots cles de l etape
63 suite au remplacement du concept old_sd
65 for child in self.mc_liste :
66 child.replace_concept(old_sd,sd)
70 Cette methode applique la fonction op_init au contexte du parent
71 et lance l'exécution en cas de traitement commande par commande
72 Elle doit retourner le concept produit qui pour une PROC est toujours None
73 En cas d'erreur, elle leve une exception : AsException ou EOFError
75 if not self.isactif():return
78 if type(self.definition.op_init) == types.FunctionType:
79 apply(self.definition.op_init,(self,self.parent.g_context))
82 if self.jdc.par_lot == "NON" :
85 raise AsException("Etape ",self.nom,'ligne : ',self.appel[0],
86 'fichier : ',self.appel[1],e)
88 self.reset_current_step()
91 l=traceback.format_exception(sys.exc_info()[0],sys.exc_info()[1],sys.exc_info()[2])
92 raise AsException("Etape ",self.nom,'ligne : ',self.appel[0],
93 'fichier : ',self.appel[1]+'\n',