class SubConfig(object):
"sub configuration management entry"
- __slots__ = ('_cfgimpl_descr', '_cfgimpl_parent', '_cfgimpl_context')
+ __slots__ = ('_cfgimpl_descr', '_cfgimpl_context')
- def __init__(self, descr, parent, context): # FIXME , slots):
+ def __init__(self, descr, context):
""" Configuration option management master class
:param descr: describes the configuration schema
:type descr: an instance of ``option.OptionDescription``
- :param parent: parent's `Config`
- :type parent: `Config`
:param context: the current root config
:type context: `Config`
"""
# main option description
self._cfgimpl_descr = descr
# sub option descriptions
- self._cfgimpl_parent = parent
self._cfgimpl_context = context
- #self._cfgimpl_build(slots)
def cfgimpl_get_context(self):
return self._cfgimpl_context
"no attribute {2}".format(self.__class__,
opt_or_descr._name,
name))
- return SubConfig(opt_or_descr, self, self._cfgimpl_context)
+ return SubConfig(opt_or_descr, self._cfgimpl_context)
# special attributes
if name.startswith('_cfgimpl_'):
# if it were in __dict__ it would have been found already
force_properties=force_properties)
return self, path[-1]
- def _cfgimpl_get_path(self):
- "the path in the attribute access meaning."
- #FIXME optimisation
- subpath = []
- obj = self
- while obj._cfgimpl_parent is not None:
- subpath.insert(0, obj._cfgimpl_descr._name)
- obj = obj._cfgimpl_parent
- return ".".join(subpath)
-
def getkey(self):
return self._cfgimpl_descr.getkey(self)
:param descr: describes the configuration schema
:type descr: an instance of ``option.OptionDescription``
- :param parent: is None if the ``Config`` is root parent Config otherwise
- :type parent: ``Config``
:param context: the current root config
:type context: `Config`
"""
self._cfgimpl_settings = Setting()
self._cfgimpl_values = Values(self)
- super(Config, self).__init__(descr, None, self) # , slots)
+ super(Config, self).__init__(descr, self) # , slots)
self._cfgimpl_build_all_paths()
def _cfgimpl_build_all_paths(self):