diff --git a/tiramisu/option.py b/tiramisu/option.py index 9fc559a..88ce51e 100644 --- a/tiramisu/option.py +++ b/tiramisu/option.py @@ -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 """ diff --git a/tiramisu/value.py b/tiramisu/value.py index 237dd7c..d62d558 100644 --- a/tiramisu/value.py +++ b/tiramisu/value.py @@ -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: