X-Git-Url: https://git.cweiske.de/enigma2.git/blobdiff_plain/1e595b94afee2632a87d1191e0d9fb6f698ac493..1daa5b67f948ba86ee6ca7a31035c8c00cbec226:/lib/python/Components/config.py diff --git a/lib/python/Components/config.py b/lib/python/Components/config.py index 4e467897..ad389a08 100644 --- a/lib/python/Components/config.py +++ b/lib/python/Components/config.py @@ -336,7 +336,7 @@ class ConfigSequence(ConfigElement): max_pos += len(str(self.limits[num][1])) while self._value[num] < self.limits[num][0]: - self.value[num] += 1 + self._value[num] += 1 while self._value[num] > self.limits[num][1]: self._value[num] -= 1 @@ -622,7 +622,7 @@ class ConfigSatlist(ConfigSelection): def __init__(self, list, default = None): if default is not None: default = str(default) - ConfigSelection.__init__(self, choices = [(str(orbpos), desc) for (orbpos, desc) in list], default = default) + ConfigSelection.__init__(self, choices = [(str(orbpos), desc, flags) for (orbpos, desc, flags) in list], default = default) def getOrbitalPosition(self): if self.value == "": @@ -698,6 +698,12 @@ class ConfigSubList(list, object): item.saved_value = self.stored_values[i] item.load() + def dict(self): + res = dict() + for index in range(len(self)): + res[str(index)] = self[index] + return res + # same as ConfigSubList, just as a dictionary. # care must be taken that the 'key' has a proper # str() method, because it will be used in the config @@ -737,6 +743,9 @@ class ConfigSubDict(dict, object): item.saved_value = self.stored_values[str(key)] item.load() + def dict(self): + return self + # Like the classes above, just with a more "native" # syntax. # @@ -797,6 +806,9 @@ class ConfigSubsection(object): for x in self.content.items.values(): x.load() + def dict(self): + return self.content.items + # the root config object, which also can "pickle" (=serialize) # down the whole config tree. # @@ -878,7 +890,7 @@ class ConfigFile: def __resolveValue(self, pickles, cmap): if cmap.has_key(pickles[0]): if len(pickles) > 1: - return self.__resolveValue(pickles[1:], cmap[pickles[0]].content.items) + return self.__resolveValue(pickles[1:], cmap[pickles[0]].dict()) else: return str(cmap[pickles[0]].value) return None