INIParser
A parser for .ini-syntax files.
The INIParser class is accessible via the initools.iniparser module.
Implements all features I know of in .ini files:
- sections with a [ in the first column
- assignment via a=b or a: b
- rfc822-style continuation lines (i.e., start the next line with indentation to make it a continuation).
- ; or # for comments
This class should be subclassed. Subclasses may only need to implement the .assignment() method. You may want to use the .section attribute, which holds the current section (or None if no section has been defined yet).
Use .parse_error(message) when you encounter a problem; this will create an exception that will note the filename and line in which the problem occurs.
Methods
See the source for more information.