]> SALOME platform Git repositories - tools/eficas.git/commitdiff
Salome HOME
correction du test sur PARAM dans GetText
authoreficas <>
Mon, 20 Oct 2003 08:14:19 +0000 (08:14 +0000)
committereficas <>
Mon, 20 Oct 2003 08:14:19 +0000 (08:14 +0000)
Ihm/I_MCSIMP.py

index f85d97a5c88654a5116330af645755fae8aea9b0..460317ddfafccb7d87b80f0aaad1033ace979428 100644 (file)
@@ -53,34 +53,39 @@ class MCSIMP(I_OBJECT.OBJECT):
     if self.valeur == None : 
       return None
     elif type(self.valeur) == types.FloatType : 
+      # Traitement d'un flottant isolé
       #txt = repr_float(self.valeur)
       # Normalement str fait un travail correct
       txt = str(self.valeur)
     elif type(self.valeur) in (types.ListType,types.TupleType) :
+      # Traitement des listes
       txt='('
       i=0
       for val in self.valeur:
         if type(val) == types.FloatType : 
-           # Normalement str fait un travail correct
+           # CCAR : 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): 
+        elif isinstance(val,ASSD): 
            txt = txt + i*',' + val.get_name()
     #PN
     # ajout du elif
-        elif val.__class__.__name__ in  ('PARAMETRE','PARAMETRE_EVAL'):
-            txt = txt + i*','+ str(val) 
+        elif type(val) == types.InstanceType and val.__class__.__name__ in  ('PARAMETRE','PARAMETRE_EVAL'):
+          txt = txt + i*','+ str(val) 
         else: 
            txt = txt + i*','+ myrepr.repr(val)
         i=1
       txt=txt+')'
     else:
+      # Traitement des autres cas
       txt = self.getval()
-    if type(txt) != types.StringType:
+
       if type(txt) == types.InstanceType:
         if isinstance(txt,parametre.PARAMETRE):
-          return str(txt)
-      return repr(txt)
+          txt= str(txt)
+      else:
+        txt=repr(txt)
+
     # 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
@@ -88,16 +93,6 @@ class MCSIMP(I_OBJECT.OBJECT):
     # 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 :
-      return txt
-    else:
-      return txt[0:29]
-
   def getval(self):
     """ 
        Retourne une chaîne de caractère représentant la valeur de self