Packaing configuration files

2011-06-01 Thread Miki Tebeka
Greetings, For some modules, I have .yaml file which contains configuration option next to the module itself. For example, there will be mypackage/logger.yaml next to mypackag/logger.py. What the best way to tell distutils/setuptools to package all these files? (I can write my custom function

Re: loading configuration files that are themselves python

2010-07-29 Thread Jean-Michel Pichavant
language that’s Turing- complete? I think not. Configuration files should be read as data; they should be declarative only, not executable languages. That way, a different program can read and parse them without having to be a parser for an entire programming language. For local non distribu

Re: loading configuration files that are themselves python

2010-07-23 Thread Ben Finney
uage that’s Turing- > complete? I think not. Configuration files should be read as data; they should be declarative only, not executable languages. That way, a different program can read and parse them without having to be a parser for an entire programming language. As illustration of this po

Re: loading configuration files that are themselves python

2010-07-23 Thread Lawrence D'Oliveiro
In message <7j8w5tylmw@rapun.sel.cam.ac.uk>, Matthew Vernon wrote: > Is there a more idiomatic way of loading in a configuration file > that's python code ... Is it really a good idea to have a configuration language that’s Turing- complete? -- http://mail.python.org/mailman/listinfo/python-

Re: loading configuration files that are themselves python

2010-07-03 Thread Terry Reedy
On 7/3/2010 5:15 AM, Matthew Vernon wrote: Hi, Is there a more idiomatic way of loading in a configuration file that's python code than: _temp=__import__(path,fromlist='cachestrs') cachestrs=_temp.cachestrs ? I mean, that's pretty ugly...Plain "import" doesn't work in this case because 'path'

Re: loading configuration files that are themselves python

2010-07-03 Thread Matthew Vernon
Peter Otten <__pete...@web.de> writes: > Matthew Vernon wrote: > > > Is there a more idiomatic way of loading in a configuration file > > that's python code than: > > > > _temp=__import__(path,fromlist='cachestrs') > > cachestrs=_temp.cachestrs > > > > ? I mean, that's pretty ugly...Plain "impo

Re: loading configuration files that are themselves python

2010-07-03 Thread Bruno Desthuilliers
Matthew Vernon a écrit : > Hi, > > Is there a more idiomatic way of loading in a configuration file > that's python code than: > > _temp=__import__(path,fromlist='cachestrs') > cachestrs=_temp.cachestrs > > ? I mean, that's pretty ugly...Plain "import" doesn't work in this > case because 'path'

Re: loading configuration files that are themselves python

2010-07-03 Thread Peter Otten
Matthew Vernon wrote: > Is there a more idiomatic way of loading in a configuration file > that's python code than: > > _temp=__import__(path,fromlist='cachestrs') > cachestrs=_temp.cachestrs > > ? I mean, that's pretty ugly...Plain "import" doesn't work in this > case because 'path' is a variab

loading configuration files that are themselves python

2010-07-03 Thread Matthew Vernon
Hi, Is there a more idiomatic way of loading in a configuration file that's python code than: _temp=__import__(path,fromlist='cachestrs') cachestrs=_temp.cachestrs ? I mean, that's pretty ugly...Plain "import" doesn't work in this case because 'path' is a variable defined elsewhere TIA, Matthe

Re: Configuration Files and Tkinter--Possible?

2009-03-04 Thread Gabriel Genellina
En Wed, 04 Mar 2009 13:50:32 -0200, W. eWatson escribió: Gabriel Genellina wrote: En Wed, 04 Mar 2009 12:12:50 -0200, W. eWatson escribió: That's fine, but I think my problem boils down to one question. There seem to be two ways to communicate with a dialog (I mean a collection of widg

Re: Configuration Files and Tkinter--Possible?

2009-03-04 Thread W. eWatson
Gabriel Genellina wrote: En Wed, 04 Mar 2009 12:12:50 -0200, W. eWatson escribió: That's fine, but I think my problem boils down to one question. There seem to be two ways to communicate with a dialog (I mean a collection of widgets assembled in a window that requires the user enter various

Re: Configuration Files and Tkinter--Possible?

2009-03-04 Thread Marc 'BlackJack' Rintsch
On Wed, 04 Mar 2009 06:12:50 -0800, W. eWatson wrote: > That's fine, but I think my problem boils down to one question. There > seem to be two ways to communicate with a dialog (I mean a collection of > widgets assembled in a window that requires the user enter various > parameters, integers, stri

Re: Configuration Files and Tkinter--Possible?

2009-03-04 Thread Gabriel Genellina
En Wed, 04 Mar 2009 12:12:50 -0200, W. eWatson escribió: That's fine, but I think my problem boils down to one question. There seem to be two ways to communicate with a dialog (I mean a collection of widgets assembled in a window that requires the user enter various parameters, integers,

Re: Configuration Files and Tkinter--Possible?

2009-03-04 Thread W. eWatson
Gabriel Genellina wrote: En Wed, 04 Mar 2009 03:13:43 -0200, W. eWatson escribió: I'm converting a Tkinter program (Win XP) that uses widgets that allows the user to change default values of various parameters like start and stop time in hh:mm:ss, time of exposure in seconds, and whether ce

Re: Configuration Files and Tkinter--Possible?

2009-03-04 Thread Gabriel Genellina
En Wed, 04 Mar 2009 03:13:43 -0200, W. eWatson escribió: I'm converting a Tkinter program (Win XP) that uses widgets that allows the user to change default values of various parameters like start and stop time in hh:mm:ss, time of exposure in seconds, and whether certain options should b

Configuration Files and Tkinter--Possible?

2009-03-03 Thread W. eWatson
I'm converting a Tkinter program (Win XP) that uses widgets that allows the user to change default values of various parameters like start and stop time in hh:mm:ss, time of exposure in seconds, and whether certain options should be on or off. The initial values are set in the code. I can pretty

Re: Configuration files

2008-06-16 Thread Robert
Does ConfigParser allow writing configuration changes also? "Dennis Lee Bieber" <[EMAIL PROTECTED]> schreef in bericht news:[EMAIL PROTECTED] > On Sat, 14 Jun 2008 21:27:19 +0200, "Robert" <[EMAIL PROTECTED]> > declaimed the following in comp.lang.python: > > > What is the most Pythonic way to ma

Re: Configuration files

2008-06-15 Thread TheSaint
On 04:11, domenica 15 giugno 2008 Daniel Fetchinson wrote: > Check this out: http://www.voidspace.org.uk/python/configobj.html > Let me add: cfgparse, iniparse I've look at all to find a simple solution for my interest, but I realized not a good result. I'm using three of them ConfigParser, cfgpa

Re: Configuration files

2008-06-14 Thread Daniel Fetchinson
> What is the most Pythonic way to maintain a configuration file? > Are there any libraries mimicking registry / ini file writing that many > windows programming languages/environments offer? Check this out: http://www.voidspace.org.uk/python/configobj.html Cheers, Daniel -- Psss, psss, put it d

Configuration files

2008-06-14 Thread Robert
What is the most Pythonic way to maintain a configuration file? Are there any libraries mimicking registry / ini file writing that many windows programming languages/environments offer? Robert -- http://mail.python.org/mailman/listinfo/python-list

Re: Comments in configuration files

2005-01-23 Thread alex23
> I would like it to be editable, through a web browser or a GUI > application. With ConfigParser I can read the configuration file and > edit the options, but when I write the result all the comments are lost Hey Pierre, I came across a good review of a number of possible solutions for this at h

Re: Comments in configuration files

2005-01-22 Thread Tim Daneliuk
Pierre Quentel wrote: Bonjour, I am developing an application and I have a configuration file with a lot of comments to help the application users understand what the options mean I would like it to be editable, through a web browser or a GUI application. With ConfigParser I can read the config

Comments in configuration files

2005-01-22 Thread Pierre Quentel
Bonjour, I am developing an application and I have a configuration file with a lot of comments to help the application users understand what the options mean I would like it to be editable, through a web browser or a GUI application. With ConfigParser I can read the configuration file and edit

Re: Configuration Files

2004-12-26 Thread M.E.Farmer
>thanks for the replies, guys! Your welcome, glad I could help. >(Spending time on these newsgroups is giving me more questions that >answers heh ) Thats good as long as it motivates you to learn ;) M.E.Farmer -- http://mail.python.org/mailman/listinfo/python-list

Re: Configuration Files

2004-12-26 Thread flamesrock
thanks for the replies, guys! MEFarmer, that example helps remove a lot of the confusion, thanks! I've looked through the SDL but there are so many different ways to do it, I wasn't which one was hands down best And Mike, I wish they would stick explanations like that in the SDL! Would help make

Re: Configuration Files

2004-12-25 Thread M.E.Farmer
Here are two functions that show how to use ConfigParser. py>def ConfigWrite(key, value, section, cfgpath): ... import ConfigParser, pprint ... parser=ConfigParser.ConfigParser() ... cfg = open(cfgpath,'w') ... parser.add_section(section) ... Pretty = pprint.PrettyPrinter(

Re: Configuration Files

2004-12-25 Thread Mike Meyer
Aaron <[EMAIL PROTECTED]> writes: > Hi, > > I'm interested in creating a large number of configuration files which I > have no experience doing in python. The fields will be static for the most > part. But design changes and I might want to add new fields in the f

Re: Configuration Files

2004-12-25 Thread M.E.Farmer
Aaron wrote: > Hi, > > I'm interested in creating a large number of configuration files which I > have no experience doing in python. The fields will be static for the most > part. But design changes and I might want to add new fields in the future.. > > My question is -

Configuration Files

2004-12-25 Thread Aaron
Hi, I'm interested in creating a large number of configuration files which I have no experience doing in python. The fields will be static for the most part. But design changes and I might want to add new fields in the future.. My question is - whats the best module for creating, reading