[Baypiggies] configuration parser using python modules?

Brent Tubbs brent.tubbs at gmail.com
Sat Jul 14 17:43:54 CEST 2012


My peeve against ConfigParser is that if you want a list of things, you end
up faking it with some incomplete-looking syntax

[my_things]
thing1 =
thing2 =

That makes me sad.  (I'm looking at you, .hgrc.)

These days all my config files are YAML.  You get all the lists and hashes
that JSON can do, but you can leave out all the quote marks and curly
braces, which is a big plus for readability.

On Fri, Jul 13, 2012 at 10:38 PM, Ian Zimmerman <itz at buug.org> wrote:

>
> David> app written in Python, some pub-sub stuff written in JS on Node
>
> In this case, JSON seems like an obvious choice for a config format :-P
>
> Personally, I try to just use eval(read(open(CONFFILE))) whenever
> remotely possible , guarded against surprises of course.
>
> The ConfigParser module is quite unpleasant IMO.  Particularly because the
> natural structure to hold such information is either a dictionary or an
> object with named fields, but that's not what ConfigParser gives you.
>
> --
> Ian Zimmerman
> gpg public key: 1024D/C6FF61AD
> fingerprint: 66DC D68F 5C1B 4D71 2EE5  BD03 8A00 786C C6FF 61AD
> http://www.gravatar.com/avatar/c66875cda51109f76c6312f4d4743d1e.png
> Rule 420: All persons more than eight miles high to leave the court.
> _______________________________________________
> Baypiggies mailing list
> Baypiggies at python.org
> To change your subscription options or unsubscribe:
> http://mail.python.org/mailman/listinfo/baypiggies
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/baypiggies/attachments/20120714/a7e553ee/attachment.html>


More information about the Baypiggies mailing list