Salome HOME
correction pb condition_context avec newJDC
[tools/eficas.git] / generator / generator_aplat.py
index 11a9953fc4375137729b4916abf54d2a6e17f442..0361c4a083cc7cd14038e62c409aa361662dab40 100644 (file)
@@ -1,3 +1,23 @@
+# -*- 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.
+#
+#
+# ======================================================================
 """
     Ce module contient le plugin generateur de fichier au format 
     aplat pour EFICAS.
@@ -40,8 +60,7 @@ class AplatGenerator:
 
        Ses caractéristiques principales sont exposées dans des attributs 
        de classe :
-
-       - extensions : qui donne une liste d'extensions de fichier préconisées
+         - extensions : qui donne une liste d'extensions de fichier préconisées
 
    """
    # Les extensions de fichier préconisées
@@ -67,10 +86,8 @@ class AplatGenerator:
 
    def gener(self,obj,format='brut'):
       """
-          Retourne une représentation du JDC obj sous une
-          forme qui est paramétrée par format.
-          Si format vaut 'brut', 'standard' ou 'beautifie', retourne le texte issu
-                       de generator
+          Retourne une représentation du JDC obj sous une forme qui est paramétrée par format.
+          Si format vaut 'brut', 'standard' ou 'beautifie', retourne le texte issu de generator
       """
       liste= self.generator(obj)
       if format == 'brut':
@@ -189,7 +206,9 @@ class AplatGenerator:
          en une chaine de caractères à la syntaxe aplat 
       """
       if type(obj.valeur) == types.StringType:
-        return obj.nom + " = '" + obj.valeur + "';\n"
+        # PN pour corriger le bug a='3+4' au lieu de a= 3+4
+        #return obj.nom + " = '" + obj.valeur + "';\n"
+        return obj.nom + " = " + obj.valeur + ";\n"
       else:
         return obj.nom + ' = ' + str(obj.valeur) + ';\n'