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 # ======================================================================
35 from Noyau.N_CO import CO
36 from Noyau.N_ASSD import assd
40 Retourne 1 si self est une MCList (liste de mots-clés), 0 sinon (défaut)
46 Retourne les règles de self
48 if hasattr(self,'definition'):
49 return self.definition.regles
50 elif hasattr(self,'regles'):
57 Met l'état de l'objet à modified et propage au parent
58 qui vaut None s'il n'existe pas
60 self.state = 'modified'
62 self.parent.init_modif()
66 Méthode appelée après qu'une modification a été faite afin de déclencher
67 d'éventuels traitements post-modification
69 # pour les objets autres que les commandes, aucun traitement spécifique
70 # on remonte l'info de fin de modif au parent
72 self.parent.fin_modif()
74 def isrepetable(self):
76 Indique si l'objet est répétable
80 def liste_mc_presents(self):
82 Retourne la liste des noms des mots clés présents
87 return self.definition.get_docu()
89 def get_liste_mc_inconnus(self):
91 Retourne la liste des mots-clés inconnus dans self
95 def verif_condition_regles(self,liste_presents):
97 Retourne la liste des mots-clés à rajouter pour satisfaire les règles
98 en fonction de la liste des mots-clés présents
101 for regle in self.definition.regles:
102 liste=regle.verif_condition_regle(liste,liste_presents)
105 def verif_condition_bloc(self):
107 Evalue les conditions de tous les blocs fils possibles
108 (en fonction du catalogue donc de la définition) de self et
109 retourne deux listes :
110 - la première contient les noms des blocs à rajouter
111 - la seconde contient les noms des blocs à supprimer
115 def get_genealogie(self):
117 Retourne la liste des noms des ascendants (noms de MCSIMP,MCFACT,MCBLOC
118 ou ETAPE) de self jusqu'au premier objet etape rencontré
121 l=self.parent.get_genealogie()
122 l.append(string.strip(self.nom))
125 return [string.strip(self.nom)]
129 Retourne la chaine d'aide contenue dans le catalogue
130 en tenant compte de la langue
133 return getattr(self.definition,lang)