configparser shuffles all sections ?
Nick Craig-Wood
nick at craig-wood.com
Fri Jun 22 05:30:05 EDT 2007
stef <s.mientki at id.umcn.nl> wrote:
> I just used configparser for the first time and discovered that it
> shuffled all my sections,
> and the contents of the sections too.
>
> This makes human manipulation of the file impossible.
>
> Is there a way to prevent this shuffling,
You could try getting yourself an ordered dictionary implmentation,
say
http://www.voidspace.org.uk/python/odict.html
Then doing something like this (untested)
class MyConfigParser(SafeConfigParser):
def __init__(self, defaults=None):
SafeConfigParser.__init__(defaults)
self._sections = odict()
self._defaults = odict()
--
Nick Craig-Wood <nick at craig-wood.com> -- http://www.craig-wood.com/nick
More information about the Python-list
mailing list