Re: [Python-Dev] ConfigParser to save with order

2006-01-20 Thread Paramjit Oberoi
> I think it's moot unless you also preserve comments. Ideally would be > something that prserved everything (ordering, blank lines, comments > etc.) from how it was read in. Modifying a value should keep its > position. Adding a value should add it to the end of the section it's > in (unless there

Re: [Python-Dev] ConfigParser to save with order

2006-01-20 Thread Tony Meyer
[Tony Meyer] > Allowing 'surgical' editing of configuration files, as has been > proposed many times both here and c.l.p would not require > ConfigParser to be entirely rewritten (just more extensive > modification of the write() method). After writing the summary of this thread, I figured I might

Re: [Python-Dev] ConfigParser to save with order

2006-01-12 Thread Tony Meyer
> I see two paths here: > > - Rewrite ConfigParser entirely. > - Apply my patch. Allowing 'surgical' editing of configuration files, as has been proposed many times both here and c.l.p would not require ConfigParser to be entirely rewritten (just more extensive modification of the write() me

Re: [Python-Dev] ConfigParser to save with order

2006-01-11 Thread Facundo Batista
2006/1/11, Tony Meyer <[EMAIL PROTECTED]>: > Remember that there has been a lot of discussion about how > ConfigParser should work in the past; for example (ignoring c.l.p): > > >

Re: [Python-Dev] ConfigParser to save with order

2006-01-10 Thread Tony Meyer
[Guido] >> I think it's moot unless you also preserve comments. Ideally would be >> something that prserved everything (ordering, blank lines, comments >> etc.) from how it was read in. Modifying a value should keep its >> position. Adding a value should add it to the end of the section it's >> in

Re: [Python-Dev] ConfigParser to save with order

2006-01-10 Thread Facundo Batista
2006/1/10, Barry Warsaw <[EMAIL PROTECTED]>: > It's also important when you do crazy things like keep your > configuration files in a revision control system. That's something that Good point, Barry. So, unless somebody screams a blatant "no", I'll apply my patch to gain predictability and reje

Re: [Python-Dev] ConfigParser to save with order

2006-01-10 Thread Barry Warsaw
On Mon, 2006-01-09 at 14:08 -0300, Facundo Batista wrote: > We can rewrite ConfigParser to store everything and write it back in > the exact order it took it, with new values at the end of each section > (or where the user inserted it), but it'll took a big rewrite of the > module: right now it's

Re: [Python-Dev] ConfigParser to save with order

2006-01-09 Thread Facundo Batista
2006/1/9, Fred L. Drake, Jr. <[EMAIL PROTECTED]>: > On Monday 09 January 2006 12:08, Facundo Batista wrote: > > What I wanted to add to the module was predicatibility: a very needed > > feature when you're writing test cases (and that's where I got bite). > > In that case, would sorting the keys

Re: [Python-Dev] ConfigParser to save with order

2006-01-09 Thread Fred L. Drake, Jr.
On Monday 09 January 2006 12:08, Facundo Batista wrote: > What I wanted to add to the module was predicatibility: a very needed > feature when you're writing test cases (and that's where I got bite). In that case, would sorting the keys within each section be sufficient when writing it back out

Re: [Python-Dev] ConfigParser to save with order

2006-01-09 Thread Facundo Batista
2006/1/7, Guido van Rossum <[EMAIL PROTECTED]>: > I think it's moot unless you also preserve comments. Ideally would be > something that prserved everything (ordering, blank lines, comments > etc.) from how it was read in. Modifying a value should keep its > position. Adding a value should add it

Re: [Python-Dev] ConfigParser to save with order

2006-01-07 Thread Guido van Rossum
I think it's moot unless you also preserve comments. Ideally would be something that prserved everything (ordering, blank lines, comments etc.) from how it was read in. Modifying a value should keep its position. Adding a value should add it to the end of the section it's in (unless there are cases

[Python-Dev] ConfigParser to save with order

2006-01-07 Thread Facundo Batista
ConfigParser saves the data in a not-predefined order. This is because it keeps, internally, the information in dictionaries. I opened a patch in SF 1399309 that orders the info to be saved in the file through the ConfigParser write() method. This patch does not let the user to specify the order,