From d9c0b18404a8531dbb9cb054b84b2de3268aef8a Mon Sep 17 00:00:00 2001 From: Emmanuel Garette Date: Sun, 8 Dec 2019 08:14:36 +0100 Subject: [PATCH] 'new' config allow storage --- tiramisu/api.py | 2 ++ tiramisu/config.py | 6 +++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/tiramisu/api.py b/tiramisu/api.py index 2935d7e..dc1bccd 100644 --- a/tiramisu/api.py +++ b/tiramisu/api.py @@ -1451,10 +1451,12 @@ class _TiramisuContextMetaConfig(_TiramisuContextMixConfig): def new(self, session_id, persistent=False, + storage=None, type='config'): """Create and add a new config""" new_config = self._config_bag.context.new_config(session_id=session_id, persistent=persistent, + storage=storage, type_=type) return self._return_config(new_config) diff --git a/tiramisu/config.py b/tiramisu/config.py index 56495d6..13ac054 100644 --- a/tiramisu/config.py +++ b/tiramisu/config.py @@ -1214,7 +1214,8 @@ class KernelMetaConfig(KernelMixConfig): def new_config(self, session_id, type_='config', - persistent=False): + persistent=False, + storage=None): if session_id in [child.impl_getname() for child in self._impl_children]: raise ConflictError(_('config name must be uniq in ' 'groupconfig for {0}').format(session_id)) @@ -1224,18 +1225,21 @@ class KernelMetaConfig(KernelMixConfig): config = KernelConfig(self._impl_descr, session_id=session_id, persistent=persistent, + storage=storage, display_name=self._display_name) elif type_ == 'metaconfig': config = KernelMetaConfig([], optiondescription=self._impl_descr, session_id=session_id, persistent=persistent, + storage=storage, display_name=self._display_name) elif type_ == 'mixconfig': config = KernelMixConfig(children=[], optiondescription=self._impl_descr, session_id=session_id, persistent=persistent, + storage=storage, display_name=self._display_name) # Copy context properties/permissives if new: