previous value api
This commit is contained in:
parent
762b0e9c69
commit
151bc83ba5
@ -225,6 +225,9 @@ class Option(HiddenBaseType, DisabledBaseType):
|
||||
"config *must* be only the **parent** config (not the toplevel config)"
|
||||
return config._cfgimpl_context._cfgimpl_values.getowner(self)
|
||||
|
||||
def get_previous_value(self, config):
|
||||
return config._cfgimpl_context._cfgimpl_values.get_previous_value(self)
|
||||
|
||||
def reset(self, config):
|
||||
"""resets the default value and owner
|
||||
"""
|
||||
|
@ -76,6 +76,13 @@ class Values(object):
|
||||
else:
|
||||
self.previous_values[opt] = old_value
|
||||
|
||||
def get_previous_value(self, opt):
|
||||
if opt in self.previous_values:
|
||||
prec_value = self.previous_values[opt]
|
||||
else:
|
||||
prec_value = None
|
||||
return prec_value
|
||||
|
||||
def _is_empty(self, opt, value=None):
|
||||
"convenience method to know if an option is empty"
|
||||
if value is not None:
|
||||
|
Loading…
Reference in New Issue
Block a user