1 # -*- coding: utf-8 -*-
2 # CONFIGURATION MANAGEMENT OF EDF VERSION
3 # ======================================================================
4 # COPYRIGHT (C) 1991 - 2002 EDF R&D WWW.CODE-ASTER.ORG
5 # THIS PROGRAM IS FREE SOFTWARE; YOU CAN REDISTRIBUTE IT AND/OR MODIFY
6 # IT UNDER THE TERMS OF THE GNU GENERAL PUBLIC LICENSE AS PUBLISHED BY
7 # THE FREE SOFTWARE FOUNDATION; EITHER VERSION 2 OF THE LICENSE, OR
8 # (AT YOUR OPTION) ANY LATER VERSION.
10 # THIS PROGRAM IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL, BUT
11 # WITHOUT ANY WARRANTY; WITHOUT EVEN THE IMPLIED WARRANTY OF
12 # MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. SEE THE GNU
13 # GENERAL PUBLIC LICENSE FOR MORE DETAILS.
15 # YOU SHOULD HAVE RECEIVED A COPY OF THE GNU GENERAL PUBLIC LICENSE
16 # ALONG WITH THIS PROGRAM; IF NOT, WRITE TO EDF R&D CODE_ASTER,
17 # 1 AVENUE DU GENERAL DE GAULLE, 92141 CLAMART CEDEX, FRANCE.
20 # ======================================================================
36 from Noyau.N_CO import CO
37 from Noyau.N_ASSD import assd
41 Retourne 1 si self est une MCList (liste de mots-clés), 0 sinon (défaut)
47 Retourne les règles de self
49 if hasattr(self,'definition'):
50 return self.definition.regles
51 elif hasattr(self,'regles'):
58 Met l'état de l'objet à modified et propage au parent
59 qui vaut None s'il n'existe pas
61 self.state = 'modified'
63 self.parent.init_modif()
67 Méthode appelée après qu'une modification a été faite afin de déclencher
68 d'éventuels traitements post-modification
70 #print "fin_modif",self
71 # pour les objets autres que les commandes, aucun traitement spécifique
72 # on remonte l'info de fin de modif au parent
73 CONNECTOR.Emit(self,"valid")
75 self.parent.fin_modif()
77 def isrepetable(self):
79 Indique si l'objet est répétable
83 def liste_mc_presents(self):
85 Retourne la liste des noms des mots clés présents
90 return self.definition.get_docu()
92 def get_liste_mc_inconnus(self):
94 Retourne la liste des mots-clés inconnus dans self
98 def verif_condition_regles(self,liste_presents):
100 Retourne la liste des mots-clés à rajouter pour satisfaire les règles
101 en fonction de la liste des mots-clés présents
104 for regle in self.definition.regles:
105 liste=regle.verif_condition_regle(liste,liste_presents)
108 def verif_condition_bloc(self):
110 Evalue les conditions de tous les blocs fils possibles
111 (en fonction du catalogue donc de la définition) de self et
112 retourne deux listes :
113 - la première contient les noms des blocs à rajouter
114 - la seconde contient les noms des blocs à supprimer
118 def get_genealogie(self):
120 Retourne la liste des noms des ascendants (noms de MCSIMP,MCFACT,MCBLOC
121 ou ETAPE) de self jusqu'au premier objet etape rencontré
124 l=self.parent.get_genealogie()
125 l.append(string.strip(self.nom))
128 return [string.strip(self.nom)]
132 Retourne la chaine d'aide contenue dans le catalogue
133 en tenant compte de la langue
136 return getattr(self.definition,lang)
140 def update_concept(self,sd):