Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #21623 > unrolled thread

Re: Is there a ConfigParser which keeps comments

Started byTim Chase <python.list@tim.thechases.com>
First post2012-03-14 13:13 -0500
Last post2012-03-14 13:13 -0500
Articles 1 — 1 participant

Back to article view | Back to comp.lang.python

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: Is there a  ConfigParser which keeps comments Tim Chase <python.list@tim.thechases.com> - 2012-03-14 13:13 -0500

#21623 — Re: Is there a ConfigParser which keeps comments

FromTim Chase <python.list@tim.thechases.com>
Date2012-03-14 13:13 -0500
SubjectRe: Is there a ConfigParser which keeps comments
Message-ID<mailman.648.1331751843.3037.python-list@python.org>
On 03/14/12 12:06, Terry Reedy wrote:
> On 3/14/2012 6:07 AM, Gelonida N wrote:
>> Now I'm looking for a library, which behaves like config parser, but
>> with one minor difference.
>>
>> The write() mehtod should keep existing comments.
>
> Assuming that you have not overlooked anything, I would just subclass
> ConfigParser with an altered write method.

It would require a lot more than that.  It would entail changing 
the reading as well so that it preserved the comments as well as 
the order of sections & keys, and a way of storing those 
associated comments in sequence.  I looked into it a fair while 
back and it was a LOT more work than I cared to do for minimal 
gain.  I wimped out and just documented it with "If you use the 
ability to (re)write a configuration file, it will not keep any 
comments or ordering from any original sources."

-tkc

[toc] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web