Re: using configobj string interpolation and logging.config.dictConfig

2017-05-30 Thread Tim Williams
after loading the INI file. The following works just fine for me. It doesn't address the issue of config.dict() string interpolating the format key, but it does what I want it to do and that's my bottom line. Test script: import logging, logging.config, logging.handlers impor

Re: using configobj string interpolation and logging.config.dictConfig

2017-05-26 Thread Peter Otten
Tim Williams wrote: > I've spent too much time trying to track this down. I'll just hard-code my > filename in my INI file. Maybe I'll get back to it, but I need to move on. The only alternative I see would be to build your own InterpolationEngine which understands some kind of escaping so that

Re: using configobj string interpolation and logging.config.dictConfig

2017-05-26 Thread Tim Williams
27;: {'class': 'logging.StreamHandler', > > > > 'level': 'INFO', > > > > 'stream': 'ext://sys.stdout'}, > > > > 'file': {'c

Re: using configobj string interpolation and logging.config.dictConfig

2017-05-26 Thread Tim Williams
e': {'class': 'logging.StreamHandler', > > > 'level': 'INFO', > > > 'stream': 'ext://sys.stdout'}, > > > 'file': {'class'

Re: using configobj string interpolation and logging.config.dictConfig

2017-05-26 Thread Tim Williams
27;logging.FileHandler', > > 'filename': 'C:/TestData/test.log', > >'level': 'WARN'}}, > > 'level': 'INFO', > > 'levelname': 'LEVELNAME', > > 'loggers': {'root': {'handlers': ['file', 'console'], 'level': 'INFO'}}, > > 'message': 'MESSAGE', > > 'version': 1} > > > > I get the expected output. > > I'm at home now, so I don't have my environment, but if I do a c.dict() I get > the error about asctime also. If I just pass in the dict object or do a > 'dict(config['loggng'])', I don't get that. (Back at work.) Looking at the non-interpolation of '%(asctime)s', etc again, I'm wondering that myself. Maybe this is a bug in configobj? That doesn't make sense though. I'm wondering if the keyword 'format' has something to do with it. -- https://mail.python.org/mailman/listinfo/python-list

Re: using configobj string interpolation and logging.config.dictConfig

2017-05-25 Thread Tim Williams
On Thursday, May 25, 2017 at 5:16:13 PM UTC-4, Peter Otten wrote: > Tim Williams wrote: > > > On Wednesday, May 24, 2017 at 5:47:37 PM UTC-4, Peter Otten wrote: > >> Tim Williams wrote: > >> > >> > Just as a followup, if I use 'unrepr=True'

Re: using configobj string interpolation and logging.config.dictConfig

2017-05-25 Thread Peter Otten
Tim Williams wrote: > On Wednesday, May 24, 2017 at 5:47:37 PM UTC-4, Peter Otten wrote: >> Tim Williams wrote: >> >> > Just as a followup, if I use 'unrepr=True' in my ConfigObj, I don't >> > have to convert the strings. >> >> I

using configobj string interpolation and logging.config.dictConfig (was Re: dictConfig: logging.StreamHandler object is not iterable.)

2017-05-25 Thread Tim Williams
On Wednesday, May 24, 2017 at 5:47:37 PM UTC-4, Peter Otten wrote: > Tim Williams wrote: > > > Just as a followup, if I use 'unrepr=True' in my ConfigObj, I don't have > > to convert the strings. > > I'd keep it simple and would use JSON... I look

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
the parsing (instead it >> parses perfectly port to a string)? >> >> sample.py: >> from configobj import ConfigObj >> >> conf = ConfigObj('sample.conf', configspec='sample.spec') >> >> sample.conf: >> port = some_string >&

Re: configobj validation

2012-03-19 Thread Andrea Crotti
e.py: from configobj import ConfigObj conf = ConfigObj('sample.conf', configspec='sample.spec') sample.conf: port = some_string sample.spec: port = integer(0, 10) PS. using configobj 4.7.2 I now checked the repo and configobj seems also quite dead (2 years ago last versio

configobj validation

2012-03-19 Thread Andrea Crotti
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 configobj import ConfigObj conf =

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 t

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/p

configobj

2012-01-31 Thread Andrea Crotti
I have a couple of questions about configobj, which I'm happily trying to use for this project. The first question is, how do I make a very long list of things? Suppose I have declared in a spec file. val = string_list now I would like to do val = one, two, three but that&

Re: A question regd configobj

2009-05-22 Thread Gabriel Genellina
En Thu, 21 May 2009 08:23:36 -0300, Srijayanth Sridhar escribió: I am wondering if it is possible to have hexadecimal strings in a ini file and have configobj parse it correctly. for eg: moonw...@trantor:~/python/config$ cat foo foo="\x96\x97" . . . a=ConfigObj("foo"

Re: A question regd configobj

2009-05-21 Thread Dave Angel
Srijayanth Sridhar wrote: Hello, I am wondering if it is possible to have hexadecimal strings in a ini file and have configobj parse it correctly. for eg: moonw...@trantor:~/python/config$ cat foo foo="\x96\x97" . . . a=ConfigObj("foo") a ConfigObj({'f

A question regd configobj

2009-05-21 Thread Srijayanth Sridhar
Hello, I am wondering if it is possible to have hexadecimal strings in a ini file and have configobj parse it correctly. for eg: moonw...@trantor:~/python/config$ cat foo foo="\x96\x97" . . . >>> a=ConfigObj("foo") >>> a ConfigObj({'foo': '\\

ANN: ConfigObj 4.6.0 and Validate 1.0.0 released

2009-04-17 Thread Fuzzyman
Finally a fresh release ConfigObj and Validate. * ConfigObj Home page: http://www.voidspace.org.uk/python/configobj.html * Validate Home page: http://www.voidspace.org.uk/python/validate.html **ConfigObj** is a simple to use but powerful Python library for the reading and writing of

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]

ConfigObj quoting issues

2008-06-02 Thread Roopesh
Hi, I am using ConfigObj to write email addresses, as a list. I am using email module functions to extract email addresses: to_address = header.get_all('To', []) address_list = getaddresses(to_address) to = map(lambda address: '"'+address[0]+'" <'+

ANN: ConfigObj 4.5.2 and validate 0.3.2

2008-02-27 Thread Fuzzyman
There was a bug in release 4.5.1 of ConfigObj, so there is now an updated release: * `ConfigObj 4.5.2 <http://www.voidspace.org.uk/python/ configobj.html>`_ * `Validate 0.3.2 <http://www.voidspace.org.uk/python/validate.html>`_ The bug affected the use of ``None`` as a defa

ANN: ConfigObj 4.5.1 and validate 0.3.1

2008-02-07 Thread Fuzzyman
After one year and two days since the last release, there is a new release of ConfigObj. * ConfigObj 4.5.1 http://www.voidspace.org.uk/python/configobj.html> * Validate 0.3.1 http://www.voidspace.org.uk/python/validate.html This release adds a few new features, plus has several bugfixes

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(pa

configobj - use of

2007-05-24 Thread Bruce
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 instance for s in c['sec1']:

[ANN] ConfigObj 4.4.0 and Validate 0.2.3

2007-02-04 Thread Fuzzyman
Updated versions of both `ConfigObj <http://www.voidspace.org.uk/ python/configobj.html>`_ and `Validate <http://www.voidspace.org.uk/ python/validate.html>`_ are now available. * `ConfigObj 4.4.0 <http://www.voidspace.org.uk/cgi-bin/voidspace/ downman.py?file=configobj-4.4.0.zip

[ANN] ConfigObj 4.3.2 Released

2006-06-04 Thread Fuzzyman
`ConfigObj 4.3.2 <http://www.voidspace.org.uk/python/configobj.html>`_ has just been released. You can download it from `configobj-4.3.2.zip <http://www.voidspace.org.uk/cgi-bin/voidspace/downman.py?file=configobj-4.3.2.zip>`_. ConfigObj is a config file reader and writer. It has *ma

[ANN] ConfigObj 4.3.2 Released

2006-06-04 Thread Fuzzyman
`ConfigObj 4.3.2 <http://www.voidspace.org.uk/python/configobj.html>`_ has just been released. You can download it from `configobj-4.3.2.zip <http://www.voidspace.org.uk/cgi-bin/voidspace/downman.py?file=configobj-4.3.2.zip>`_. This is a bugfix and minor feature enhancement release

[ANN] ConfigObj 4.3.1 & validate 0.2.2

2006-04-29 Thread Fuzzyman
`ConfigObj 4.3.1 <http://www.voidspace.org.uk/python/configobj.html>`_ and `validate 0.2.2 <http://www.voidspace.org.uk/python/validate.html>`_ are now available. These are both minor bugfix/feature enhancement releases. What is New in ConfigObj ? Changes since **ConfigObj** 4.3.

ANN: ConfigObj 4.3.0

2006-04-07 Thread Fuzzyman
`ConfigObj 4.3.0 <http://www.voidspace.org.uk/python/configobj.html>`_ is now released. This has several bugfixes, as well as *several* major feature enhancements. You can download it from : `ConfigObj-4.3.0.zip 244Kb <http://www.voidspace.org.uk/cgi-bin/voidspace/downman.py?file=

[ANN] ConfigObj 4.2.0

2006-02-19 Thread Fuzzyman
`ConfigObj 4.2.0 <http://www.voidspace.org.uk/python/configobj.html>`_ is now available. The main improvements are *full* Unicode support,a s well as the addition of the 'convenience' `Section Methods <http://www.voidspace.org.uk/python/configobj.html#section-methods>`_

Unicode Support for ConfigObj (config file reader) Now in SVN

2006-01-31 Thread Fuzzyman
Hello All, I've added (optional) unicode support for ConfigObj. This is now available from SVN. You can specify an encoding to decode the config file on reading. This maps to an encoding attribute on the ConfigObj instance that is also used for writing (and can be changed). You can find

ANN: ConfigObj 4.0.0 Final and Pythonutils 0.2.3

2005-10-18 Thread Fuzzyman
ConfigObj 4.0.0 final and Pythonutils 0.2.3 have just hit the streets. http://www.voidspace.org.uk/python/configobj.html http://www.voidspace.org.uk/python/pythonutils.html They are both pure Python modules - the source distributions include full documentation, which is also online. What'

Pythonutils 0.2.2 , ConfigObj 4.0.0 Beta 5, odict 0.1.1

2005-09-15 Thread Fuzzyman
onfigObj__ - now up to beta 5. This fixes another couple of bugs - we aim to get out of beta someday.. All this is my way of saying that *odict 0.1.2*, *pythonutils 0.2.2*, and *ConfigObj beta 5*, are all available from the `Voidspace Modules`__ page. __ http://www.voidspace.org.uk/python/python

ANN: ConfigObj 4.0.0 Beta 4

2005-09-08 Thread Fuzzyman
Hello Pythoneers, ConfigObj 4.0.0 has a beta 4 release. This fixes a couple of moderately serious bugs - so it's worth switching to. http://cheeseshop.python.org/pypi/ConfigObj http://www.voidspace.org.uk/python/configobj.html http://www.voidspace.org.uk/cgi-bin/voidspace/downman.py

[ANN] ConfigObj Update and New PythonUtils Package

2005-03-10 Thread Fuzzyman
ConfigObj has had another update - now version 3.3.0 Several of the Voidspace PythonUtils modules have been packaged together as the 'Voidspace Pythonutils Package'. This makes it easier to release packages that depend on ConfigObj and the other modules. This update includes several imp

[ANN] ConfigObj update - v3.2.5

2005-02-15 Thread fuzzyman
ConfigObj has had another update - now version 3.2.5 This update includes 3 bugfixes and several new features. Because of the bugfixes it's reccomended for all users. New features include - lines can now be broken over two or more lines, initial and final comments in a config file are pres