save configSequence floating point correctly
authorStefan Pluecken <stefan.pluecken@multimedia-labs.de>
Sat, 21 Jan 2006 00:24:18 +0000 (00:24 +0000)
committerStefan Pluecken <stefan.pluecken@multimedia-labs.de>
Sat, 21 Jan 2006 00:24:18 +0000 (00:24 +0000)
lib/python/Components/config.py

index 5a4ed12e8c71845b009e567fc6d242c346bf7919..e1c0bf8abef992971421c58eb8cd250845faa13b 100644 (file)
@@ -479,16 +479,20 @@ class configElement:
                        return str(data.strip())
 
                elif control == configSequence:
                        return str(data.strip())
 
                elif control == configSequence:
+                       print self.vals
+                       print self.value
                        try:
                        try:
-                               value = ((len(data) * ("%d" + self.vals[0]))[0:-1]) % tuple(data)
+                               value = ""
+                               count = 0
+                               for i in data:
+                                       if value !="":
+                                               value += self.vals[0]
+                                       value += (("%0" + str(len(str(self.vals[1][count][1]))) + "d") % i)
+                                       count += 1
+                                       #value = ((len(data) * ("%d" + self.vals[0]))[0:-1]) % tuple(data)
                        except: 
                                value = str(data)       
                        except: 
                                value = str(data)       
-#                      just in case you don't understand the above, here an equivalent:
-#                      value = ""
-#                      for i in data:
-#                              if value !="":
-#                                      value += self.vals[0]
-#                              value += str(i)
+
                        return value
                elif control == configSatlist:
                        return str(self.vals[self.value][1]);
                        return value
                elif control == configSatlist:
                        return str(self.vals[self.value][1]);