add getHTML to ConfigIP
authorFelix Domke <tmbinc@elitedvb.net>
Tue, 9 Jan 2007 23:04:48 +0000 (23:04 +0000)
committerFelix Domke <tmbinc@elitedvb.net>
Tue, 9 Jan 2007 23:04:48 +0000 (23:04 +0000)
lib/python/Components/config.py

index 02d17055b551d36f8afb97e5df53fcd9781b76f8..7df6e762f7c3df5d0fa86e54d3b31c91acfb253e 100644 (file)
@@ -440,11 +440,15 @@ class ConfigSequence(ConfigElement):
                return str(v)
 
        def fromstring(self, value):
-               return [int(x) for x in self.saved_value.split(self.seperator)]
+               return [int(x) for x in value.split(self.seperator)]
 
 class ConfigIP(ConfigSequence):
        def __init__(self, default):
                ConfigSequence.__init__(self, seperator = ".", limits = [(0,255),(0,255),(0,255),(0,255)], default = default)
+       
+       def getHTML(self, id):
+               # we definitely don't want leading zeros
+               return '.'.join(["%d" % d for d in self.value])
 
 class ConfigMAC(ConfigSequence):
        def __init__(self, default):