From 0b1d1ef3f143d9224d01661bdba1e4c5084cf25f Mon Sep 17 00:00:00 2001 From: Emmanuel Garette Date: Wed, 15 Nov 2023 21:41:04 +0100 Subject: [PATCH] add value.get() to optiondescription (instead of value.dict()) --- tiramisu/api.py | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/tiramisu/api.py b/tiramisu/api.py index 92e6a4a..289a7d4 100644 --- a/tiramisu/api.py +++ b/tiramisu/api.py @@ -582,13 +582,16 @@ class TiramisuOptionValue(CommonTiramisuOption): @option_type('optiondescription') def dict(self, options_bag: List[OptionBag]): - """Dict with path as key and value""" + """Obsolete: dict with path as key and value""" return self._config_bag.context.make_dict(options_bag[-1]) - @option_type(['option', 'symlink', 'with_index']) + @option_type(['option', 'symlink', 'with_index', 'optiondescription']) def get(self, options_bag: List[OptionBag], ): + """Get value""" + if options_bag[-1].option.impl_is_optiondescription(): + return self._config_bag.context.make_dict(options_bag[-1]) return self._get(options_bag) def _get(self, @@ -947,6 +950,14 @@ class TiramisuContextValue(TiramisuConfig): ) def dict(self): + """Obsolete: dict with path as key and value""" + option_bag = OptionBag(self._config_bag.context.get_description(), + None, + self._config_bag, + ) + return self._config_bag.context.make_dict(option_bag) + + def get(self): """Dict with path as key and value""" option_bag = OptionBag(self._config_bag.context.get_description(), None,