properties are check now in getowner

get_modified_values works good with force_store_value
This commit is contained in:
2014-03-29 20:31:56 +01:00
parent 712db2875e
commit ff5376a382
9 changed files with 242 additions and 132 deletions

View File

@ -365,7 +365,10 @@ class Settings(object):
self._p_.reset_properties(_path)
self._getcontext().cfgimpl_reset_cache()
def _getproperties(self, opt=None, path=None, is_apply_req=True):
def _getproperties(self, opt=None, path=None, _is_apply_req=True):
"""
be careful, _is_apply_req doesn't copy properties
"""
if opt is None:
props = copy(self._p_.getproperties(path, default_properties))
else:
@ -379,15 +382,16 @@ class Settings(object):
is_cached, props = self._p_.getcache(path, ntime)
if is_cached:
return copy(props)
props = copy(self._p_.getproperties(path, opt._properties))
if is_apply_req:
props = self._p_.getproperties(path, opt._properties)
if _is_apply_req:
props = copy(props)
props |= self.apply_requires(opt, path)
if 'cache' in self:
if 'expire' in self:
if ntime is None:
ntime = int(time())
ntime = ntime + expires_time
self._p_.setcache(path, copy(props), ntime)
if 'cache' in self:
if 'expire' in self:
if ntime is None:
ntime = int(time())
ntime = ntime + expires_time
self._p_.setcache(path, copy(props), ntime)
return props
def append(self, propname):
@ -640,6 +644,15 @@ class Settings(object):
def get_modified_permissives(self):
return self._p_.get_modified_permissives()
def get_with_property(self, propname):
opts, paths = self._getcontext().cfgimpl_get_description(
)._cache_paths
for index in range(0, len(paths)):
opt = opts[index]
path = paths[index]
if propname in self._getproperties(opt, path, False):
yield (opt, path)
def __getstate__(self):
return {'_p_': self._p_, '_owner': str(self._owner)}