Re: ConfigParser preserving file ordering

2007-10-19 Thread Gabriel Genellina
En Fri, 19 Oct 2007 10:16:00 -0300, Andrew Durdin [EMAIL PROTECTED]  
escribió:

 As for updating ConfigParser -- like most other changes, it probably
 needs a champion.

ConfigParser is so dumb that should be burned to death and rebuilt from  
the ashes.

-- 
Gabriel Genellina

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: ConfigParser preserving file ordering

2007-10-19 Thread Andrew Durdin
On 10/19/07, Frank Aune [EMAIL PROTECTED] wrote:

 Yes, but as I said I need functionality present in the standard-library, so
 sub-classing ConfigParser is the last option really.

Any particular reason you're limited to the standard library?

I've used iniparse http://code.google.com/p/iniparse/ before as a
drop-in replacement for ConfigParser that preserves ordering and
comments, and only falling back to ConfigParser if iniparse wasn't
present; like this:

try:
from iniparse.compat import *
except ImportError:
from ConfigParser import *

As for updating ConfigParser -- like most other changes, it probably
needs a champion.

Andrew
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: ConfigParser preserving file ordering

2007-10-19 Thread Frank Aune
On Friday 19 October 2007 03:42:16 Joshua J. Kugler wrote:

 Have you taken a look at ConfigObj?

 http://www.voidspace.org.uk/python/configobj.html


Yes, but as I said I need functionality present in the standard-library, so 
sub-classing ConfigParser is the last option really. I was hoping preserve 
ordering for ConfigParser would find its way into a release soon.

-Frank
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: ConfigParser preserving file ordering

2007-10-18 Thread Joshua J. Kugler
On Thursday 18 October 2007 15:23, Frank Aune wrote:

 Hello,
 
 I use ConfigParser and actually quite like it, EXCEPT that it doesnt
 preserve the section order of the original config file when writing a new.
 This behaviour is hopeless IMO, and I've been looking for alternatives.
 
 I've been reading the interesting discussion on python-dev about
 improvements to ConfigParser:
 
 http://mail.python.org/pipermail/python-dev/2006-January/060138.html
 
 I know there are patches to archieve what I want, but tbh I need
 functionality present in the standard library or as a last option
 sub-class ConfigParser to archieve ordering preservation.
 
 Since the thread above is nearly two years old, I'm wondering if something
 has happended in this department?

Have you taken a look at ConfigObj?

http://www.voidspace.org.uk/python/configobj.html

j

-- 
Joshua Kugler
Lead System Admin -- Senior Programmer
http://www.eeinternet.com
PGP Key: http://pgp.mit.edu/  ID 0xDB26D7CE

-- 
http://mail.python.org/mailman/listinfo/python-list

ConfigParser preserving file ordering

2007-10-18 Thread Frank Aune
Hello,

I use ConfigParser and actually quite like it, EXCEPT that it doesnt preserve 
the section order of the original config file when writing a new. This 
behaviour is hopeless IMO, and I've been looking for alternatives.

I've been reading the interesting discussion on python-dev about improvements 
to ConfigParser:

http://mail.python.org/pipermail/python-dev/2006-January/060138.html

I know there are patches to archieve what I want, but tbh I need functionality 
present in the standard library or as a last option sub-class ConfigParser to 
archieve ordering preservation.

Since the thread above is nearly two years old, I'm wondering if something has 
happended in this department?

Thanks,
Frank
-- 
http://mail.python.org/mailman/listinfo/python-list