Re: configobj validation

2012-03-21 Thread Andrea Crotti
On 03/21/2012 11:40 AM, Diez B. Roggisch wrote: Andrea Crotti writes: It works - so why do you bother? And I'm not sure about the above code - AFAIK, validation is a two-step thing: http://www.voidspace.org.uk/python/articles/configobj.shtml#validation Diez I don't agree, if you write code

Re: configobj validation

2012-03-21 Thread Diez B. Roggisch
Andrea Crotti writes: > On 03/19/2012 12:59 PM, Andrea Crotti wrote: >> I seemed to remember that type validation and type conversion worked >> out of the box, but now >> I can't get it working anymore. >> >> Shouldn't this simple example actually fail the parsing (instead it >> parses perfectly

Re: configobj validation

2012-03-19 Thread Andrea Crotti
On 03/19/2012 12:59 PM, Andrea Crotti wrote: I seemed to remember that type validation and type conversion worked out of the box, but now I can't get it working anymore. Shouldn't this simple example actually fail the parsing (instead it parses perfectly port to a string)? sample.py: from co

Re: configobj

2012-02-01 Thread Andrea Crotti
On 02/01/2012 12:21 AM, Terry Reedy wrote: On 1/31/2012 11:06 AM, Andrea Crotti wrote: I have a couple of questions about configobj, which I'm happily trying to use for this project. When asking about 3rd party modules, please include a url, so we can be sure of what you mean and even take a

Re: configobj

2012-01-31 Thread Terry Reedy
On 1/31/2012 11:06 AM, Andrea Crotti wrote: I have a couple of questions about configobj, which I'm happily trying to use for this project. When asking about 3rd party modules, please include a url, so we can be sure of what you mean and even take a look. Is www.voidspace.org.uk/python/config

Re: ConfigObj quoting issues

2008-06-03 Thread TheSaint
On 14:25, martedì 03 giugno 2008 Roopesh wrote: > This error is because of the presence of \', \", \n etc. > > I had to do the following to make it work. > address[i].replace("\'",'').replace('\"','').replace('\n','') > it's rather ugly :) I suggest use re module as follow: import re address[i]

Re: configobj - use of

2007-05-24 Thread Steve Holden
Bruce wrote: > I assume that you know the module configobj. I use it like this: > I have a config_file : > > [sec1] > [[subsec1]] > a = 1 > b = 2 > [[subsec2]] > a = 3 > b = 1 > > .. ans so on > > Then in the code I have c = configobj.ConfigObj(path_to_config file) > > then I go like for instan