git.cweiske.de
/
enigma2.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
e301b99
)
fix resolve key for ConfigSubDict / ConfigSublist
author
Felix Domke
<tmbinc@elitedvb.net>
Wed, 1 Nov 2006 23:26:47 +0000
(23:26 +0000)
committer
Felix Domke
<tmbinc@elitedvb.net>
Wed, 1 Nov 2006 23:26:47 +0000
(23:26 +0000)
lib/python/Components/config.py
patch
|
blob
|
history
diff --git
a/lib/python/Components/config.py
b/lib/python/Components/config.py
index 4e467897835b90026a32dd871073598ef4e9832c..a3537889988e3115690610f65970498824b87743 100644
(file)
--- a/
lib/python/Components/config.py
+++ b/
lib/python/Components/config.py
@@
-698,6
+698,12
@@
class ConfigSubList(list, object):
item.saved_value = self.stored_values[i]
item.load()
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
# 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()
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.
#
# 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()
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.
#
# 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:
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
else:
return str(cmap[pickles[0]].value)
return None