copy/deepcopy could be persistent
This commit is contained in:
parent
4d3a470e58
commit
10aaf2219f
2 changed files with 8 additions and 1 deletions
|
@ -979,14 +979,18 @@ class TiramisuContextConfig(TiramisuContext):
|
|||
|
||||
def _c_copy(self,
|
||||
session_id=None,
|
||||
persistent=False,
|
||||
storage=None):
|
||||
return Config(self.config_bag.context.duplicate(session_id,
|
||||
persistent=persistent,
|
||||
storage=storage))
|
||||
|
||||
def _c_deepcopy(self,
|
||||
session_id=None,
|
||||
persistent=False,
|
||||
storage=None):
|
||||
return Config(self.config_bag.context.duplicate(session_id,
|
||||
persistent=persistent,
|
||||
storage=storage,
|
||||
deep=True))
|
||||
|
||||
|
|
|
@ -681,6 +681,7 @@ class _CommonConfig(SubConfig):
|
|||
force_values=None,
|
||||
force_settings=None,
|
||||
storage=None,
|
||||
persistent=False,
|
||||
deep=False):
|
||||
if isinstance(self, KernelConfig):
|
||||
config = KernelConfig(self._impl_descr,
|
||||
|
@ -688,6 +689,7 @@ class _CommonConfig(SubConfig):
|
|||
session_id=session_id,
|
||||
force_values=force_values,
|
||||
force_settings=force_settings,
|
||||
persistent=persistent,
|
||||
storage=storage)
|
||||
elif isinstance(self, KernelMetaConfig):
|
||||
config = KernelMetaConfig([],
|
||||
|
@ -696,6 +698,7 @@ class _CommonConfig(SubConfig):
|
|||
session_id=session_id,
|
||||
force_values=force_values,
|
||||
force_settings=force_settings,
|
||||
persistent=persistent,
|
||||
storage=storage)
|
||||
else:
|
||||
raise Exception('hu?')
|
||||
|
@ -706,7 +709,7 @@ class _CommonConfig(SubConfig):
|
|||
)._pp_.exportation())
|
||||
if self._impl_meta:
|
||||
if deep:
|
||||
meta = self._impl_meta().duplicate(deep=deep, storage=storage)
|
||||
meta = self._impl_meta().duplicate(deep=deep, storage=storage, persistent=persistent)
|
||||
meta._impl_children.append(config)
|
||||
config._impl_meta = weakref.ref(meta)
|
||||
config = meta
|
||||
|
|
Loading…
Reference in a new issue