freeze() in read_write method
authorgwen <gremond@cadoles.com>
Mon, 24 Sep 2012 13:58:37 +0000 (15:58 +0200)
committergwen <gremond@cadoles.com>
Mon, 24 Sep 2012 13:58:37 +0000 (15:58 +0200)
tiramisu/config.py
tiramisu/option.py

index 5d5c0f2..8c76a36 100644 (file)
@@ -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')
index 0e7fa10..d4d694f 100644 (file)
@@ -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: