From 81ba8338641aa41e52e498b43aeefa66714819fe Mon Sep 17 00:00:00 2001 From: Felix Domke Date: Mon, 9 Oct 2006 21:15:18 +0000 Subject: [PATCH] fix ConfigText to use unicode, fix ConfigClock --- lib/python/Components/config.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/python/Components/config.py b/lib/python/Components/config.py index 104e4465..cf94614c 100644 --- a/lib/python/Components/config.py +++ b/lib/python/Components/config.py @@ -415,7 +415,9 @@ class ConfigPosition(ConfigSequence): class ConfigClock(ConfigSequence): def __init__(self, default): - ConfigSequence.__init__(self, seperator = ":", limits = [(0,23),(0,59)], default = default) + import time + t = time.localtime(default) + ConfigSequence.__init__(self, seperator = ":", limits = [(0,23),(0,59)], default = [t.tm_hour, t.tm_min]) class ConfigInteger(ConfigSequence): def __init__(self, default, limits): @@ -491,7 +493,7 @@ class ConfigText(ConfigElement, NumericalTextInput): self.text = self.text.ljust(len(self.text) + 1) elif key in KEY_NUMBERS: number = self.getKey(getKeyNumber(key)) - self.text = self.text[0:self.marked_pos] + str(number) + self.text[self.marked_pos + 1:] + self.text = self.text[0:self.marked_pos] + unicode(number) + self.text[self.marked_pos + 1:] elif key == KEY_TIMEOUT: self.timeout() return -- 2.30.2