# HG changeset patch # User nihathrael@33b003aa-7bff-0310-803a-e67f0ece8222 # Date 1276851065 0 # Node ID 1d60e022311720e351a5c091b2523e44e4b4e9ac # Parent 63226105ac4547c930b02420c51a7ec20aa72e9a Added a check when a new entry is added to the settings. If get returns None, it is assumed the entry is not presenta in the current settings file, thus the default is copied and the check is repeated. If it is still not found a warning is printed. diff -r 63226105ac45 -r 1d60e0223117 engine/python/fife/extensions/fife_settings.py --- a/engine/python/fife/extensions/fife_settings.py Thu Jun 17 20:10:48 2010 +0000 +++ b/engine/python/fife/extensions/fife_settings.py Fri Jun 18 08:51:05 2010 +0000 @@ -202,6 +202,15 @@ self._entries[entry.module] = {} self._entries[entry.module][entry.name] = entry + # Make sure the new entry is available + if self.get(entry.module, entry.name) is None: + print "Updating", self._settings_file, "to the default, it is missing the entry:"\ + , entry.name ,"for module", entry.module + self.setDefaults() + if self.get(entry.module, entry.name) is None: + print "WARNING:", entry.module, ":", entry.name, "still not found!" + print "It's probably missing in settings-dist.xml as well!" + def loadSettings(self): self._tree = ET.parse(os.path.join(self._appdata, self._settings_file)) @@ -514,7 +523,6 @@ if self.OptionsDlg: self.OptionsDlg.hide() - def _getEntries(self): return self._entries