iter on all objects

This commit is contained in:
gwen 2013-03-07 11:02:18 +01:00
parent 9b3eb33d27
commit 11ad037af9
1 changed files with 9 additions and 0 deletions

View File

@ -382,6 +382,15 @@ class Config(object):
except:
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):
"""iteration on groups objects only.
All groups are returned if `group_type` is `None`, otherwise the groups