remove warnings when execute option.list

This commit is contained in:
Emmanuel Garette 2018-11-17 23:02:03 +01:00
parent 17bd7c3c05
commit ef66d487b7
2 changed files with 17 additions and 8 deletions

View File

@ -1003,14 +1003,15 @@ class TiramisuContextOption(TiramisuContext):
def _filter(self,
opt,
subconfig):
subconfig,
config_bag):
option_bag = OptionBag()
option_bag.set_option(opt,
opt.impl_getpath(),
None,
self._config_bag)
config_bag)
if opt.impl_is_optiondescription():
self._config_bag.context.cfgimpl_get_settings().validate_properties(option_bag)
config_bag.context.cfgimpl_get_settings().validate_properties(option_bag)
return subconfig.get_subconfig(option_bag)
subconfig.getattr(opt.impl_getname(),
option_bag)
@ -1020,11 +1021,13 @@ class TiramisuContextOption(TiramisuContext):
recursive,
type_,
group_type,
config_bag,
subconfig):
for opt in option.get_children(self._config_bag):
for opt in option.get_children(config_bag):
try:
subsubconfig = self._filter(opt,
subconfig)
subconfig,
config_bag)
except PropertiesOptionError:
continue
if opt.impl_is_optiondescription():
@ -1033,6 +1036,7 @@ class TiramisuContextOption(TiramisuContext):
recursive,
type_,
group_type,
config_bag,
subsubconfig):
yield toption
if type_ == 'option' or (type_ == 'optiondescription' and \
@ -1056,12 +1060,17 @@ class TiramisuContextOption(TiramisuContext):
assert type in ('all', 'option', 'optiondescription'), _('unknown list type {}').format(type)
assert group_type is None or isinstance(group_type, groups.GroupType), \
_("unknown group_type: {0}").format(group_type)
option = self._config_bag.context.cfgimpl_get_description()
config_bag = self._config_bag
if config_bag.properties and 'warnings' in config_bag.properties:
config_bag = config_bag.copy()
config_bag.properties = config_bag.properties - {'warnings'}
option = config_bag.context.cfgimpl_get_description()
for toption in self._walk(option,
recursive,
type,
group_type,
self._config_bag.context):
config_bag,
config_bag.context):
yield toption

View File

@ -28,7 +28,7 @@ from .option import SynDynOptionDescription, DynOptionDescription, MasterSlaves
from .option.baseoption import BaseOption, valid_name
from .setting import OptionBag, ConfigBag, groups, Settings, undefined
from .storage import get_storages, gen_storage_id, get_default_values_storages
from .value import Values # , Multi
from .value import Values
from .i18n import _