freeze() in read_write method
This commit is contained in:
parent
9e417334d4
commit
a2f9beb9f4
2 changed files with 6 additions and 7 deletions
|
@ -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')
|
||||
|
|
|
@ -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:
|
||||
|
|
Loading…
Reference in a new issue