Open GoogleCodeExporter opened 9 years ago
INIConfig and INISection both have iterator support which does what you are
wanting here. A thing to remember is that the iterator support is over the
section/key name, not the section/value. It could be nice if INIConfig had
(iter)?(items|sections|values) methods and INISection
(iter)?(items|keys|values) methods, like dict, but that would then reserve some
names meaning that if you had an INI section or key called "values" (quite
plausible) you couldn't do ini.values to get it but would rather need to do
ini['values']. At present there are no properties without leading underscores,
meaning that there are no clashes unless your INI file includes underscores.
Anyway, in summary:
Instead of INIConfig.get_sections, use list(INIConfig).
Instead of INISection.get_options, use list(INISection).
(Or iterate over them.)
Original comment by chris.morganiser
on 4 Jun 2011 at 10:48
Original issue reported on code.google.com by
jphthier...@gmail.com
on 19 Jan 2011 at 7:03