6231: WARNING: configmanager.py: line 309: WARNING: ignoring key with wrong type
'behavior.autoload' svn: r20789
This commit is contained in:
parent
100eeec905
commit
0e01b5919e
@ -302,11 +302,20 @@ class ConfigManager(object):
|
|||||||
####################### Now, let's test and set:
|
####################### Now, let's test and set:
|
||||||
if (name in self.default and
|
if (name in self.default and
|
||||||
setting in self.default[name]):
|
setting in self.default[name]):
|
||||||
|
if isinstance(self.default[name][setting], bool):
|
||||||
|
#make sure 0 and 1 are False and True
|
||||||
|
if value == 0:
|
||||||
|
value = False
|
||||||
|
elif value == 1:
|
||||||
|
value = True
|
||||||
if self.check_type(self.default[name][setting], value):
|
if self.check_type(self.default[name][setting], value):
|
||||||
self.data[name][setting] = value
|
self.data[name][setting] = value
|
||||||
else:
|
else:
|
||||||
logging.warning("WARNING: ignoring key with wrong type "
|
logging.warning("WARNING: ignoring key with wrong type "
|
||||||
"'%s.%s'" % (name, setting))
|
"'%s.%s' %s needed instead of %s" %
|
||||||
|
(name, setting,
|
||||||
|
type(self.data[name][setting]),
|
||||||
|
type(value)))
|
||||||
else:
|
else:
|
||||||
# this could be a third-party setting; add it:
|
# this could be a third-party setting; add it:
|
||||||
self.data[name][setting] = value
|
self.data[name][setting] = value
|
||||||
|
Loading…
x
Reference in New Issue
Block a user