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
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
27;: {'class': 'logging.StreamHandler',
> > > > 'level': 'INFO',
> > > > 'stream': 'ext://sys.stdout'},
> > > > 'file': {'c
e': {'class': 'logging.StreamHandler',
> > > 'level': 'INFO',
> > > 'stream': 'ext://sys.stdout'},
> > > 'file': {'class'
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
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'
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
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
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
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
>&
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
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 =
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
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
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&
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"
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
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': '\\
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
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]
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]+'"
<'+
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
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
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
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']:
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
`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
`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
`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.
`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=
`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>`_
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
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'
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
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
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
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
37 matches
Mail list logo