Re: [Rest2web-develop] Down with writein
Brought to you by:
mjfoord
From: Nicola L. <ni...@te...> - 2005-08-04 06:15:20
|
> I've decided to scrap the writein method for ConfigObj - and instead > preserve comments above keywords. > > I intend to preserve inline comments as well - so each Section will have > an ``inline_comments`` and a ``comments`` dictionary attached. Each > member of ``comments`` will be a *list* of comment lines. I can do this > with minor changes to the current implementation. > > The file format will look like : > > # initial_comment > # preserved > > # lost > > # preserved with section marker > [section] # also preserved > # lost > > # preserved with key > Key = value # also preserved > # lost > > # final_comment > # preserved > > > What do you think ? I think that's great. I didn't quite like the idea of interspersing changes in an already existing file. This way, the user does not have to worry which write method has to be used. The loss of isolated comment lines is unfortunate, and seems a rather arbitrary thing to do, from the user point of view. But these drawbacks are surely minor, and the gained simplicity is worth them. Maybe they could be alleviated by emitting some kind of warning during file parsing. -- Nicola Larosa - ni...@te... If there are a few shark attacks in Florida - and a graphic movie - suddenly every swimmer is worried. More people are killed every year by pigs than by sharks, which shows you how good we are at evaluating risk. -- Bruce Schneier, May 2005 |