ConfigParser - add a stop sentinel?
jello at comics.com
Wed Jan 12 16:48:58 CET 2005
I am working with PythonCard in one of my apps. For its purposes, it
uses an .ini file that is passed to ConfigParser. For my app, I also
need configuration information, but for various reasons, I'd rather
use a syntax that ConfigParser can't handle.
I know I can maintain two separate configuration files, and if I have
to I will, but I'd rather avoid that, if possible, and a solution
that suits my purposes is quite straightforward. I insert a sentinel
in the ini file and modify my local ConfigParser's _read method to
stop accepting input when it encounters that value. I handle my app's
portion of the configuration myself.
This all works fine, but I was wondering whether it might be
worthwhile to add a standard stop flag in ConfigParser itself. Am I
the only one with this sort of use case? If there were a standard way
of doing this, I'd much rather use that, particularly if I ever have
reason to distribute the app elsewhere.
More information about the Python-list