From 295fb0f22061cb6c1c014d866ea79c453527a867 Mon Sep 17 00:00:00 2001 From: Felix Domke Date: Sun, 8 Oct 2006 22:27:00 +0000 Subject: [PATCH] don't create selection comments for now, check ConfigSubsection contents for valid classes, fix default not overwriting non-defaults --- lib/python/Components/config.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/python/Components/config.py b/lib/python/Components/config.py index 07186157..75035a78 100644 --- a/lib/python/Components/config.py +++ b/lib/python/Components/config.py @@ -158,7 +158,7 @@ class ConfigSelection(ConfigElement): self.changed() def tostring(self, val): - return (val, ','.join(self.choices)) + return val def getValue(self): return self._value @@ -697,6 +697,7 @@ class ConfigSubsection(object): def __setattr__(self, name, value): if name == "saved_value": return self.setSavedValue(value) + assert isinstance(value, ConfigSubsection) or isinstance(value, ConfigElement) or isinstance(value, ConfigSubList) or isinstance(value, ConfigSubDict), "ConfigSubsections can only store ConfigSubsections, ConfigSubLists, ConfigSubDicts or ConfigElements" self.content.items[name] = value if name in self.content.stored_values: #print "ok, now we have a new item,", name, "and have the following value for it:", self.content.stored_values[name] @@ -711,6 +712,9 @@ class ConfigSubsection(object): for (key, val) in self.content.items.items(): if val.saved_value is not None: res[key] = val.saved_value + elif key in res: + del res[key] + return res def setSavedValue(self, values): -- 2.30.2