iter on all objects
This commit is contained in:
parent
9b3eb33d27
commit
11ad037af9
1 changed files with 9 additions and 0 deletions
|
@ -382,6 +382,15 @@ class Config(object):
|
||||||
except:
|
except:
|
||||||
pass # option with properties
|
pass # option with properties
|
||||||
|
|
||||||
|
def iter_all(self):
|
||||||
|
"""A way of parsing options **and** groups.
|
||||||
|
iteration on Options and OptionDescriptions."""
|
||||||
|
for child in self._cfgimpl_descr._children:
|
||||||
|
try:
|
||||||
|
yield child._name, getattr(self, child._name)
|
||||||
|
except:
|
||||||
|
pass # option with properties
|
||||||
|
|
||||||
def iter_groups(self, group_type=None):
|
def iter_groups(self, group_type=None):
|
||||||
"""iteration on groups objects only.
|
"""iteration on groups objects only.
|
||||||
All groups are returned if `group_type` is `None`, otherwise the groups
|
All groups are returned if `group_type` is `None`, otherwise the groups
|
||||||
|
|
Loading…
Reference in a new issue