build cache builds correctly now
This commit is contained in:
parent
201f9d6db4
commit
8181d1b596
|
@ -81,9 +81,7 @@ class Config(object):
|
||||||
self._cfgimpl_build_all_paths()
|
self._cfgimpl_build_all_paths()
|
||||||
|
|
||||||
def _cfgimpl_build_all_paths(self):
|
def _cfgimpl_build_all_paths(self):
|
||||||
# if self._cfgimpl_all_paths == None:
|
self._cfgimpl_descr.build_cache()
|
||||||
# raise ConfigError('cache paths must not be None')
|
|
||||||
self._cfgimpl_descr.build_cache() #self._cfgimpl_all_paths)
|
|
||||||
|
|
||||||
def cfgimpl_get_settings(self):
|
def cfgimpl_get_settings(self):
|
||||||
return self._cfgimpl_context._cfgimpl_settings
|
return self._cfgimpl_context._cfgimpl_settings
|
||||||
|
|
|
@ -475,22 +475,23 @@ class OptionDescription(BaseType, BaseInformation):
|
||||||
paths.append('.'.join(currpath + [attr]))
|
paths.append('.'.join(currpath + [attr]))
|
||||||
return paths
|
return paths
|
||||||
|
|
||||||
def build_cache(self, currpath=None):
|
def build_cache(self, cache=None, currpath=None):
|
||||||
if currpath is None and self._cache_paths != {}:
|
if currpath is None and self._cache_paths != {}:
|
||||||
return
|
return
|
||||||
if currpath is None:
|
if currpath is None:
|
||||||
currpath = []
|
currpath = []
|
||||||
|
if cache is None:
|
||||||
|
cache = self._cache_paths
|
||||||
for option in self._children:
|
for option in self._children:
|
||||||
attr = option._name
|
attr = option._name
|
||||||
if attr.startswith('_cfgimpl'):
|
if attr.startswith('_cfgimpl'):
|
||||||
continue
|
continue
|
||||||
if isinstance(option, OptionDescription):
|
if isinstance(option, OptionDescription):
|
||||||
currpath.append(attr)
|
currpath.append(attr)
|
||||||
option.build_cache(currpath=currpath)
|
option.build_cache(cache, currpath)
|
||||||
currpath.pop()
|
currpath.pop()
|
||||||
else:
|
else:
|
||||||
self._cache_paths[option] = str('.'.join(currpath + [attr]))
|
cache[option] = str('.'.join(currpath + [attr]))
|
||||||
|
|
||||||
# ____________________________________________________________
|
# ____________________________________________________________
|
||||||
def set_group_type(self, group_type):
|
def set_group_type(self, group_type):
|
||||||
"""sets a given group object to an OptionDescription
|
"""sets a given group object to an OptionDescription
|
||||||
|
|
|
@ -61,7 +61,7 @@ class Values(object):
|
||||||
value = opt.getdefault()
|
value = opt.getdefault()
|
||||||
|
|
||||||
if opt in self.slaves:
|
if opt in self.slaves:
|
||||||
masterpath = self.context._cfgimpl_all_paths[self.slaves[opt]]
|
masterpath = self.context._cfgimpl_descr._cache_paths[self.slaves[opt]]
|
||||||
mastervalue = getattr(self.context, masterpath)
|
mastervalue = getattr(self.context, masterpath)
|
||||||
masterlen = len(mastervalue)
|
masterlen = len(mastervalue)
|
||||||
if len(value) < masterlen:
|
if len(value) < masterlen:
|
||||||
|
|
Loading…
Reference in New Issue