From: Douglas S. B. <db...@cs...> - 2007-11-25 16:26:51
|
I'm trying to fix a bug in writing default ini values, and am trying to figure out the design. The bug is when writing a new keys.ini file, GRAMPS doesn't get the default value from default_value but rather asks GconfKeys. The relevant code from src/Config/__init__.py (with some debug): def __upgrade_gconf(): import _GrampsGconfKeys as GconfKeys print "Upgrading INI file" for key in default_value.keys(): print key, default_value[key], data = GconfKeys.get(key) print data set(key, data) gives output like: ('interface', 'source-height', 1) 450 0 ('interface', 'person-ref-width', 1) 600 0 ('interface', 'name-width', 1) 600 0 ('interface', 'note-width', 1) 700 0 ('behavior', 'date-after-range', 1) 9999 0 so the default_value[key] is being ignored and replaced by a zero from GconfKeys.get(key), and the resulting keys.ini has a bunch of zeros (which affects code that depends on these keys). The big question is: what is the relation between Gconf and Ini? And the specific question: what should be done here (and other places) to respect the defaults of default_value? Thanks for any hints. -Doug |