remove debug print
[enigma2.git] / lib / python / Components / config.py
index 2b51d169ce5cbcff972229b375b1449d4a8be37a..82a5d6d853122b037a19b64ebb0d0216b44e56fe 100644 (file)
@@ -48,7 +48,18 @@ class configFile:
 
                        fileHandle.write(wstr)
 
-               fileHandle.close()              
+               fileHandle.close()
+               
+def currentConfigSelectionElement(element):
+       return element.vals[element.value][0]
+
+def getConfigSelectionElement(element, value):
+       count = 0
+       for x in element.vals:
+               if x[0] == value:
+                       return count
+               count += 1
+       return -1
 
 class configSelection:
        def __init__(self, parent):
@@ -82,9 +93,6 @@ class configSelection:
                        returnValue = _(self.parent.vals[self.parent.value])
                else:
                        returnValue = _(self.parent.vals[self.parent.value][1])
-
-                       
-               print self.parent.vals[self.parent.value]
                
                return ("text", returnValue)
                
@@ -173,6 +181,9 @@ class configSequenceArg:
                # configsequencearg.get("FLOAT", [(min,max),(min1,max1)]) => x.y with min <= x <= max and min1 <= y <= max1
                if (type == "FLOAT"):
                        return (("."), args, "")
+               
+       def getFloat(self, element):
+               return float(("%d.%0" + str(len(str(element.vals[1][1][1]))) + "d") % (element.value[0], element.value[1]))
 
 configsequencearg = configSequenceArg()
                
@@ -455,6 +466,8 @@ class configElement:
                if control == ConfigSlider:
                        return str(data)
                elif control == configSelection:
+                       if len(self.vals) < data + 1:
+                               return "0"
                        if isinstance(self.vals[data], str):
                                return str(data)
                        else:
@@ -474,7 +487,6 @@ class configElement:
                        return str(data.strip())
 
                elif control == configSequence:
-                       print data
                        try:
                                value = ((len(data) * ("%d" + self.vals[0]))[0:-1]) % tuple(data)
                        except: