ability to disable warnings validation
This commit is contained in:
@ -581,9 +581,11 @@ class Option(OnlyOption):
|
||||
if warning:
|
||||
msg = _("warning on the value of the option {0}: {1}").format(
|
||||
self.impl_getname(), warning)
|
||||
warnings.warn_explicit(ValueWarning(msg, self),
|
||||
ValueWarning,
|
||||
self.__class__.__name__, 0)
|
||||
if context is None or 'warnings' in \
|
||||
context.cfgimpl_get_settings():
|
||||
warnings.warn_explicit(ValueWarning(msg, self),
|
||||
ValueWarning,
|
||||
self.__class__.__name__, 0)
|
||||
elif error:
|
||||
raise ValueError(_("invalid value for option {0}: {1}").format(
|
||||
self.impl_getname(), error))
|
||||
|
@ -78,8 +78,11 @@ everything_frozen
|
||||
validator
|
||||
launch validator set by user in option (this property has no effect
|
||||
for internal validator)
|
||||
|
||||
warnings
|
||||
display warnings during validation
|
||||
"""
|
||||
default_properties = ('cache', 'expire', 'validator')
|
||||
default_properties = ('cache', 'expire', 'validator', 'warnings')
|
||||
|
||||
"""Config can be in two defaut mode:
|
||||
|
||||
|
Reference in New Issue
Block a user