From 536c9954a0ead206b875cda6f1ccff361e354ab7 Mon Sep 17 00:00:00 2001 From: Andreas Frisch Date: Tue, 7 Oct 2008 10:48:06 +0000 Subject: [PATCH] don't display leading zeros for IP addresses --- lib/python/Components/config.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/lib/python/Components/config.py b/lib/python/Components/config.py index b91c449e..7fbe13b7 100644 --- a/lib/python/Components/config.py +++ b/lib/python/Components/config.py @@ -507,6 +507,19 @@ class ConfigIP(ConfigSequence): def getHTML(self, id): # we definitely don't want leading zeros return '.'.join(["%d" % d for d in self.value]) + + def genText(self): + value = "" + mPos = self.marked_pos + num = 0; + for i in self._value: + if len(value): + value += self.seperator + if mPos >= len(value) - 1: + mPos += 1 + value += str(i) + num += 1 + return (value, mPos) class ConfigMAC(ConfigSequence): def __init__(self, default): -- 2.30.2