find and find_first's new argument

This commit is contained in:
gwen 2013-11-04 17:15:47 +01:00
parent 615cad4b49
commit 384b30210c
1 changed files with 7 additions and 5 deletions

View File

@ -250,7 +250,8 @@ class SubConfig(object):
force_properties=force_properties,
force_permissive=force_permissive)
def find(self, bytype=None, byname=None, byvalue=None, type_='option'):
def find(self, bytype=None, byname=None, byvalue=None, type_='option',
check_properties=True):
"""
finds a list of options recursively in the config
@ -262,11 +263,11 @@ class SubConfig(object):
return self._cfgimpl_get_context()._find(bytype, byname, byvalue,
first=False,
type_=type_,
_subpath=self.cfgimpl_get_path()
)
_subpath=self.cfgimpl_get_path(),
check_properties=check_properties)
def find_first(self, bytype=None, byname=None, byvalue=None,
type_='option', display_error=True):
type_='option', display_error=True, check_properties=True):
"""
finds an option recursively in the config
@ -277,7 +278,8 @@ class SubConfig(object):
"""
return self._cfgimpl_get_context()._find(
bytype, byname, byvalue, first=True, type_=type_,
_subpath=self.cfgimpl_get_path(), display_error=display_error)
_subpath=self.cfgimpl_get_path(), display_error=display_error,
check_properties=check_properties)
def _find(self, bytype, byname, byvalue, first, type_='option',
_subpath=None, check_properties=True, display_error=True):