From a2f9beb9f444628aa5d6e68b09e76ad7f095806d Mon Sep 17 00:00:00 2001 From: gwen Date: Mon, 24 Sep 2012 15:58:37 +0200 Subject: [PATCH] freeze() in read_write method --- tiramisu/config.py | 8 ++++---- tiramisu/option.py | 5 ++--- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/tiramisu/config.py b/tiramisu/config.py index 5d5c0f2..8c76a36 100644 --- a/tiramisu/config.py +++ b/tiramisu/config.py @@ -180,7 +180,7 @@ class Config(object): if not isinstance(opt_or_descr, Option) and \ not isinstance(opt_or_descr, OptionDescription): raise TypeError('Unexpected object: {0}'.format(repr(opt_or_descr))) - properties = opt_or_descr.properties + properties = copy(opt_or_descr.properties) for proper in properties: if not self._cfgimpl_toplevel._cfgimpl_has_property(proper): properties.remove(proper) @@ -434,7 +434,7 @@ class Config(object): return rootconfig._cfgimpl_mandatory def cfgimpl_read_only(self): - # hung up on freeze, hidden and disabled concepts + # convenience method to freeze, hidde and disable self.cfgimpl_freeze() rootconfig = self._cfgimpl_get_toplevel() rootconfig.cfgimpl_disable_property('hidden') @@ -442,8 +442,8 @@ class Config(object): rootconfig._cfgimpl_mandatory = True def cfgimpl_read_write(self): - # hung up on freeze, hidden and disabled concepts - self.cfgimpl_unfreeze() + # convenience method to freeze, hidde and disable + self.cfgimpl_freeze() rootconfig = self._cfgimpl_get_toplevel() rootconfig.cfgimpl_enable_property('hidden') rootconfig.cfgimpl_enable_property('disabled') diff --git a/tiramisu/option.py b/tiramisu/option.py index 0e7fa10..d4d694f 100644 --- a/tiramisu/option.py +++ b/tiramisu/option.py @@ -404,12 +404,11 @@ class OptionDescription(HiddenBaseType, DisabledBaseType): attr = option._name if attr.startswith('_cfgimpl'): continue - value = getattr(self, attr) - if isinstance(value, OptionDescription): + if isinstance(option, OptionDescription): if include_groups: paths.append('.'.join(currpath + [attr])) currpath.append(attr) - paths += value.getpaths(include_groups=include_groups, + paths += option.getpaths(include_groups=include_groups, currpath=currpath) currpath.pop() else: