From 0e01b5919e9ca9afadd1e008847699d9ca3229c5 Mon Sep 17 00:00:00 2001 From: Benny Malengier Date: Tue, 18 Dec 2012 11:50:02 +0000 Subject: [PATCH] 6231: WARNING: configmanager.py: line 309: WARNING: ignoring key with wrong type 'behavior.autoload' svn: r20789 --- gramps/gen/utils/configmanager.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/gramps/gen/utils/configmanager.py b/gramps/gen/utils/configmanager.py index 403ffacf8..d7debd7e4 100644 --- a/gramps/gen/utils/configmanager.py +++ b/gramps/gen/utils/configmanager.py @@ -302,11 +302,20 @@ class ConfigManager(object): ####################### Now, let's test and set: if (name in self.default and 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): self.data[name][setting] = value else: 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: # this could be a third-party setting; add it: self.data[name][setting] = value