From 4d04ee7322ead5dc5d6504b4799137817ca4c9eb Mon Sep 17 00:00:00 2001 From: eficas <> Date: Fri, 23 Dec 2005 11:23:23 +0000 Subject: [PATCH] PN : pour edition en colonnes dans le fichier produit --- generator/generator_python.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/generator/generator_python.py b/generator/generator_python.py index bebd399f..3f5e420b 100644 --- a/generator/generator_python.py +++ b/generator/generator_python.py @@ -488,6 +488,8 @@ class PythonGenerator: s = s + ',' if len(obj.valeur) > 1: s = '(' + s + '),' + if obj.nbrColonnes() : + s=self.formatColonnes(obj.nbrColonnes(),s) else : val=obj.valeur if type(val) == types.InstanceType : @@ -524,3 +526,19 @@ class PythonGenerator: return s + def formatColonnes(self,nbrColonnes,text): + try : + #if 1 == 1 : + liste=text.split(",") + indice=0 + textformat="" + while ( indice < len(liste) -2 ) : + for l in range(nbrColonnes) : + textformat=textformat+liste[indice]+"," + indice=indice+1 + textformat=textformat+"\n" + textformat=textformat+")," + except : + #else : + textformat=text + return textformat -- 2.39.2