From: pchristo at ic.sunysb.edu (Pavlos Christoforou)
Date: Tue, 13 Apr 1999 13:46:17 -0400
Subject: ConfigParser module and alternatives (flad, flan)
In-Reply-To: <xcxP2.1302$rd2.27684@news14.ispnews.com>
References: <19990331160323.21601.00000471@ng-fi1.aol.com> <7du3ab$3ag@chronicle.concentric.net> <jtaewsfmlj.fsf@wazor.biostat.wisc.edu> <xcxP2.1302$rd2.27684@news14.ispnews.com>
Message-ID: <Pine.SOL.3.96.990413134011.24975B-100000@sparky>
Content-Length: 1341
X-UID: 1395                                                  

On Sat, 10 Apr 1999, Mike Orr wrote:

> I use ConfigParser to parse the data files in a Mad Lib CGI program.
> See it at http://mso.oz.net/python/madbibs/
> (When I add/change a story, I run a script that parses the files,
> creates the HTML, and stores the preprocessed data structures in a 
> cPickle file for the CGI script.)

Sounds like you might benefit from Zope, or at least ZPublisher.


> 
> I'm not sure if I'll use ConfigParser for the next version.  I don't
> really need the sections (multiple files work just fine, using the filename
> for the section name), and I haven't found a use for the the %(other_key)s
> substitutions.  On the other hand, it doesn't handle multiple values (the
> same key repeated within a record), which I sometimes need.

Last time I needed to use configuration files I wrote an XML module that
maps XML files onto python dictionaries. Changes to either the python
dictionary during run-time or to the file are synchronized automatically
(not good for huge configuration files that are modified frequently). The
standard python distribution comes with a good XML parser so you can do
pretty cool things. Mapping onto dictionaries creates the same problem
that you mentioned (no multiple values withing the same sectrion
(dictionary)). If anyone is interested I can send her/him a copy.

Pavlos





