From 5498a12b2b290b7c290ed6910c94e61cb63b7fa4 Mon Sep 17 00:00:00 2001 From: Emmanuel Garette Date: Mon, 27 May 2019 16:11:41 +0200 Subject: [PATCH] copy/deepcopy groupconfig --- tiramisu/api.py | 28 ++++++++++++++++++++++++---- 1 file changed, 24 insertions(+), 4 deletions(-) diff --git a/tiramisu/api.py b/tiramisu/api.py index 3d269a3..f4c42c4 100644 --- a/tiramisu/api.py +++ b/tiramisu/api.py @@ -1250,9 +1250,9 @@ class _TiramisuContextConfig(TiramisuContext, _TiramisuContextConfigReset): return self._config_bag.context.impl_getname() def copy(self, - session_id=None, - persistent=False, - storage=None): + session_id=None, + persistent=False, + storage=None): return Config(self._config_bag.context.duplicate(session_id, persistent=persistent, storage=storage)) @@ -1303,7 +1303,27 @@ class _TiramisuContextGroupConfig(TiramisuContext): config = self._config_bag.context for spath in spaths: config = config.getconfig(spath) - return Config(config) + + def copy(self, + session_id=None, + persistent=False, + storage=None): + return Config(self._config_bag.context.duplicate(session_id, + persistent=persistent, + storage=storage)) + + def deepcopy(self, + session_id=None, + persistent=False, + storage=None, + metaconfig_prefix=None): + return Config(self._config_bag.context.duplicate(session_id, + persistent=persistent, + storage=storage, + metaconfig_prefix=metaconfig_prefix, + deep=True)) + + return Config(config) def path(self): return self._config_bag.context.cfgimpl_get_config_path()