add load/save for configSequence
authorRonny Strutz <ronny.strutz@multimedia-labs.de>
Fri, 2 Sep 2005 12:24:58 +0000 (12:24 +0000)
committerRonny Strutz <ronny.strutz@multimedia-labs.de>
Fri, 2 Sep 2005 12:24:58 +0000 (12:24 +0000)
lib/python/Components/config.py

index 14c03655e8d702aac685ed0960c6a2420524d350..237e0bf8aa56f1bc68ad1afafb2d71e14f3f8682 100644 (file)
@@ -109,8 +109,8 @@ class configSequence:
        def __call__(self):                     #needed by configlist
                value = ""
                for i in self.parent.value:
-                       if (value != ""):
-                               value += self.parent.vals[0]
+                       if value != "":
+                               value += self.parent.vals
                        value += str(i)
                return ("text", value)
 
@@ -170,6 +170,12 @@ class configElement:
                        return int(data);
                elif control == configBoolean:
                        return int(data);
+               elif control == configSequence:
+                       list = [ ]
+                       part = data.split(self.vals)
+                       for x in part:
+                               list.append(int(x))
+                       return list
                else: 
                        return ""       
 
@@ -178,6 +184,13 @@ class configElement:
                        return str(data);
                elif control == configBoolean:
                        return str(data);
+               elif control == configSequence:
+                       value = ""
+                       for i in data:
+                               if value !="":
+                                       value += self.vals
+                               value += str(i)
+                       return value
                else: 
                        return ""