0

changed the semantics of required and default in settings definitions.

I think it makes more logical sense now. Essentially, the default is
always used if the user doesn't specify a value. If there is no user
specified value and the default is None, then the action depends on the
value of required. required=True means raise an error. required=False
means silently omit that setting.
This commit is contained in:
Andrew Brown
2012-02-04 22:06:29 -05:00
parent 6d95d80a73
commit 324100206b
3 changed files with 61 additions and 45 deletions

View File

@@ -33,7 +33,7 @@ class MultiWorldParser(object):
self._settings[settingname] = setting
if not setting.required:
if setting.required and setting.default is not None:
self._config_state[settingname] = setting.default
def set_config_item(self, itemname, itemvalue):