Re: [Rest2web-develop] Down with writein
Brought to you by:
mjfoord
From: Michael F. <mi...@pc...> - 2005-08-04 12:10:39
|
Nicola Larosa wrote: [snip..] >>I thought this could end up associating comments with the wrong value. >>As a side effect it means that there is no way of providing a comment >>for the *first* key/section. It will all be swallowed up by initial_comment. > > > Why don't you do away with the notions of initial_comment, final_comment, > and associating comments with config items, and instead keep all non-data > lines just as they are? > > You could do this by using a third sequence, say "self.comments", and > interleaving its elements with self.scalars and self.sections somehow. > Part of the point is that the comments *are* associated with the config items. That way if you're constructing config files programattically, you can say - this comment belongs with this value. If you don't care about the association (or how it's done internally) - then the current implementation 'just works'. Interleaving comments and the other values sounds like a nightmare ! Best Regards, Fuzzy http://www.voidspace.org.uk/python |