Salome HOME
PN : Enleve Homard pour la v1.7
[tools/eficas.git] / Ihm / I_OBJECT.py
index 559ebcd5736f9283db4634b0ae1db4487d2ecad2..eb00f2a970116dcec99b27fbdbf29ae6f5cc0269 100644 (file)
@@ -1,11 +1,43 @@
+# -*- coding: utf-8 -*-
+#            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 Noyau
+
+try:
+  import prefs
+  lang=prefs.lang
+except:
+  lang='fr'
+  
 
 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), 
-                 0 sinon (défaut) 
+        Retourne 1 si self est une MCList (liste de mots-clés), 0 sinon (défaut) 
     """
     return 0
 
@@ -75,9 +107,30 @@ class OBJECT:
         Evalue les conditions de tous les blocs fils possibles 
         (en fonction du catalogue donc de la définition) de self et
         retourne deux listes :
-        - la première contient les noms des blocs à rajouter
-        - la seconde contient les noms des blocs à supprimer
+          - la première contient les noms des blocs à rajouter
+          - la seconde contient les noms des blocs à supprimer
     """
     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 get_fr(self):
+     """
+         Retourne la chaine d'aide contenue dans le catalogue
+         en tenant compte de la langue
+     """
+     try :
+        return getattr(self.definition,lang)
+     except:
+        return ''