refactor
This commit is contained in:
@ -353,15 +353,25 @@ class Settings(object):
|
||||
path = opt.impl_getpath(self._getcontext())
|
||||
return self.getproperties(opt, path)
|
||||
|
||||
def getproperties(self, opt, path, setting_properties=undefined, index=None, obj=True):
|
||||
def getproperties(self,
|
||||
opt,
|
||||
path,
|
||||
setting_properties=undefined,
|
||||
index=None,
|
||||
obj=True):
|
||||
"""get properties for a specified option
|
||||
"""
|
||||
properties = self._getproperties(opt, path, index=index,
|
||||
properties = self._getproperties(opt,
|
||||
path,
|
||||
index=index,
|
||||
setting_properties=setting_properties)
|
||||
if obj:
|
||||
return Property(self, properties, opt, path)
|
||||
return properties
|
||||
|
||||
def getcontextproperties(self):
|
||||
return self._getproperties()
|
||||
|
||||
def __setitem__(self, opt, value): # pragma: optional cover
|
||||
raise ValueError(_('you should only append/remove properties'))
|
||||
|
||||
@ -377,9 +387,13 @@ class Settings(object):
|
||||
self._p_.delproperties(_path)
|
||||
self._getcontext().cfgimpl_reset_cache(opt=opt, path=_path, only=('settings', 'values'))
|
||||
|
||||
def _getproperties(self, opt=None, path=None,
|
||||
setting_properties=undefined, read_write=True,
|
||||
apply_requires=True, index=None):
|
||||
def _getproperties(self,
|
||||
opt=None,
|
||||
path=None,
|
||||
setting_properties=undefined,
|
||||
read_write=True,
|
||||
apply_requires=True,
|
||||
index=None):
|
||||
"""
|
||||
"""
|
||||
if opt is None:
|
||||
|
Reference in New Issue
Block a user