|
From: <fuz...@vo...> - 2006-06-07 23:27:07
|
{ran_emo} `ConfigObj 4.3.2 <http://www.voidspace.org.uk/python/configobj.html>`_ had over two hundred downloads in the first forty-eight hours. That's nice. {sm;:-p}
Also it looks like **ConfigObj 4.3.1** got turned into a `debian package <http://groups.google.com/group/linux.debian.changes.devel/browse_thread/thread/dbf3448d173485fc/40b01451b0719e44>`_ only hours before I released 4.3.2. {sm;:lol:}
More importantly, there are now eggs up on the `cheeseshop <http://cheeseshop.python.org/pypi/ConfigObj/4.3.2>`_, so `Turbogears <http://www.turbogears.org>`_ users (and anyone else) should be able to install ConfigObj using `setuptools <http://peak.telecommunity.com/DevCenter/setuptools>`_. These eggs also contain `validate <http://www.voidspace.org.uk/python/validate.html>`_.
The current release *should* address the issues in `this Turbogears ticket <http://trac.turbogears.org/turbogears/ticket/863>`_.
There are two proposals to improve `string substitution <http://www.voidspace.org.uk/python/configobj.html#interpolation>`_ [#]_ in ConfigObj.
The first is to allow `PEP 292 <http://www.python.org/dev/peps/pep-0292/>`_ string substitution.
Currently ConfigObj uses `ConfigParser <http://docs.python.org/lib/module-ConfigParser.html>`_ style interpolation :
| ``foodir = %(something)``
| ``foodir = %(dir)s/whatever``
**PEP 292** (along with lots of other languages) uses :
| ``foodir = $something``
| ``foodir = ${something}/whatever``
This is much better, but for backwards compatibility the ``ConfigParser`` style substitution would need to be the default. The `interpolation option <http://www.voidspace.org.uk/python/configobj.html#interpolate>`_ would then need to have several options :
* ``True`` - ConfigParser style
* ``False`` - off
* ``ConfigParser`` - guess {sm;:-)}
* ``Template`` - PEP 292 style
This is more complicated than it was. {sm;:???:}
Everyone who has commented on this has said that it is a good idea, so this will probably make its way into the next version of ConfigObj. Many thanks to Robin Munn for the suggestion, code and documentation. It does leave an issue of recursive interpolation and ``$$`` which is used in PEP 292 substitution to escape the ``$`` sign. Maybe I should just get rid of recursive interpolation ?
The second change is *slightly* more controversial. Currently ConfigObj does interpolation from the **DEFAULT** section of the current section, parent section or root section.
A couple of users have suggested that using the current section first would be better ? This *could* break backwards incompatibility, but as I don't use string substitution at all it doesn't affect me. Anyone else got any thoughts ?
.. [#] Also called interpolation. |