aboutsummaryrefslogtreecommitdiff
path: root/lib/python/Components/config.py
diff options
context:
space:
mode:
Diffstat (limited to 'lib/python/Components/config.py')
-rw-r--r--lib/python/Components/config.py15
1 files changed, 9 insertions, 6 deletions
diff --git a/lib/python/Components/config.py b/lib/python/Components/config.py
index 1795d426..2fd0ff15 100644
--- a/lib/python/Components/config.py
+++ b/lib/python/Components/config.py
@@ -128,7 +128,8 @@ class configSequence:
if diff > 0:
value += " " * diff
value += str(i)
-
+# or the above code if you have to spare ink
+# value = ((len(self.parent.value) * ("%0" + str(self.parent.vals[1]) + "d" + self.parent.vals[0]))[0:-1]) % tuple(self.parent.value)
value = value[0:mPos] + "_" + value[mPos + 1:]
return ("text", value)
@@ -203,11 +204,13 @@ class configElement:
elif control == configSelection:
return str(data);
elif control == configSequence:
- value = ""
- for i in data:
- if value !="":
- value += self.vals[0]
- value += str(i)
+ value = ((len(data) * ("%d" + self.vals[0]))[0:-1]) % tuple(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
else:
return ""