Re: Recommended "new" way for config files

2010-02-25 Thread Nicola Larosa (tekNico)
Peter wrote: > There seems to be several strategies to enhance the old ini-style config > files with real python code > [...] > Is there a strategy that should be prefered for new projects ? 5) Use ConfigObj , by Michael Foord and yours truly. It

Re: Recommended "new" way for config files

2010-01-19 Thread Jonathan Gardner
On Jan 8, 2:54 pm, Ben Finney wrote: > Chris Rebert writes: > > JSON is one option:http://docs.python.org/library/json.html > > YAML http://en.wikipedia.org/wiki/YAML> is another contender. > Compared to JSON, it is yet to gain as much mind-share, but even more > human-friendly and no less expres

Re: Recommended "new" way for config files

2010-01-08 Thread Ben Finney
Chris Rebert writes: > JSON is one option: http://docs.python.org/library/json.html YAML http://en.wikipedia.org/wiki/YAML> is another contender. Compared to JSON, it is yet to gain as much mind-share, but even more human-friendly and no less expressive. Here are some discussions of YAML that c

Re: Recommended "new" way for config files

2010-01-08 Thread Peter
On 01/08/2010 03:57 PM, r0g wrote: Chris Rebert wrote: On Thu, Jan 7, 2010 at 10:19 AM, Peter wrote: The .ini file is the simpliest solution, at least from the user point of view, no need to learn any python syntax. I am speaking from the point of view of a python program

Re: Recommended "new" way for config files

2010-01-08 Thread Vinay Sajip
On Jan 7, 8:12 pm, Peter wrote: > > > > >> So what is the "worshipped" approach, when you need more than name=value > >> pairs ? > > > JSON is one option:http://docs.python.org/library/json.html > > Thanks, didn't think about that, although most of the apps I know don't > seem to use this approac

Re: Recommended "new" way for config files

2010-01-08 Thread r0g
Chris Rebert wrote: > On Thu, Jan 7, 2010 at 10:19 AM, Peter wrote: > >>> The .ini file is the simpliest solution, at least from the user point of >>> view, no need to learn any python syntax. >> I am speaking from the point of view of a python programmer, and I find the >> .ini restrictions not

Re: Recommended "new" way for config files

2010-01-08 Thread Jorgen Grahn
On Thu, 2010-01-07, Jean-Michel Pichavant wrote: > Peter wrote: >> Hi >> There seems to be several strategies to enhance the old ini-style >> config files with real python code, for example: ... >> Is there a strategy that should be prefered for new projects ? ... > The .ini file is the simpliest

Re: Recommended "new" way for config files

2010-01-07 Thread Peter
So what is the "worshipped" approach, when you need more than name=value pairs ? JSON is one option: http://docs.python.org/library/json.html Thanks, didn't think about that, although most of the apps I know don't seem to use this approach for improved conf file handling ( ip

Re: Recommended "new" way for config files

2010-01-07 Thread Chris Rebert
On Thu, Jan 7, 2010 at 10:19 AM, Peter wrote: >> The .ini file is the simpliest solution, at least from the user point of >> view, no need to learn any python syntax. > > I am speaking from the point of view of a python programmer, and I find the > .ini restrictions not necessarily simple, for ex

Re: Recommended "new" way for config files

2010-01-07 Thread Peter
Thanks for your answer, let me be more precise: I would add the standard module ConfigParser http://docs.python.org/library/configparser.html to your list. of course, that was the implicit starting point of my request, when talking about .ini files. I don't know exactly what you intend to do wi

Re: Recommended "new" way for config files

2010-01-07 Thread Robert Kern
On 2010-01-07 10:10 AM, Peter wrote: Hi There seems to be several strategies to enhance the old ini-style config files with real python code, for example: 1) the documentation tool sphinx uses a python file conf.py that is exefile(d) , but execfile is suppressed in Python 3 Only because it is

Re: Recommended "new" way for config files

2010-01-07 Thread Lie Ryan
On 1/8/2010 3:10 AM, Peter wrote: Is there a strategy that should be prefered for new projects ? The answer is, it depends. -- http://mail.python.org/mailman/listinfo/python-list

Re: Recommended "new" way for config files

2010-01-07 Thread Jean-Michel Pichavant
Peter wrote: Hi There seems to be several strategies to enhance the old ini-style config files with real python code, for example: 1) the documentation tool sphinx uses a python file conf.py that is exefile(d) , but execfile is suppressed in Python 3 2) there is a module cfgparse on sourcefo

Recommended "new" way for config files

2010-01-07 Thread Peter
Hi There seems to be several strategies to enhance the old ini-style config files with real python code, for example: 1) the documentation tool sphinx uses a python file conf.py that is exefile(d) , but execfile is suppressed in Python 3 2) there is a module cfgparse on sourceforge that suppo