[Zope-Coders] Environment variables
Fred L. Drake, Jr.
fdrake@acm.org
Tue, 30 Apr 2002 09:38:18 -0400
Casey Duncan writes:
> Well, the only problem with that in regards to ConfigParser is that the
> comments are erased if you ever use it's write method.
That's only a problem if you use the write() method, though!
I once had a .ini-file module that included two versions of the basic
interface: one that used a bnuch of dictionaries and threw away
comments, and another that added a whole bunch of additional code to
edit the input (kept in memory) line-by-line when changes were made.
It was very smart about how the edits were made, and worked quite
well. I'd offer that, but I lost it a few years ago.
I think it would be really good to include both flavors. One of the
problems with performing "surgical" editing is that the comments
related to a setting may become wrong when changing the value, but
there's no way to know. It would probably be good to flag changed
values with some marker when they get changed this way, so a human can
be aware that the value and comments may be out of sync.
-Fred
--
Fred L. Drake, Jr. <fdrake at acm.org>
PythonLabs at Zope Corporation