|
From: Michael F. <fuz...@vo...> - 2008-01-27 03:57:00
|
Hello all,
I've been working on integrating the patch supplied by Arve that would
add a 'restore_default' method to ConfigObj sections.
Although it was a great reference implementation, I was unhappy with the
performance hit of parsing each check an extra time to retrieve the
default value. Instead I've implemented it with caching of parsed
checks. This should provide a general performance improvement for most
configspec handling.
This is now in subversion. The next step is to implement
'restore_default' on 'Section' (and probably a 'restore_defaults' as well).
The full changelog for validate currently stands at:
Improved performance with a parse cache.
New ``get_default_value`` method. Given a check it returns the default
value (converted to the correct type) or raises a ``KeyError`` if the
check doesn't specify a default.
Bugfix: A quoted 'None' as a default value is no longer treated as None,
but as the string 'None'.
Bugfix: we weren't unquoting keyword arguments of length two, so an
empty string didn't work as a default.
Bugfix: Strings no longer pass the 'is_list' check. Additionally, the
list checks always return lists.
Added 'tuple' check and corresponding 'is_tuple' function (which
always returns a tuple).
A couple of documentation bug fixes.
Removed CHANGELOG from module.
I've made one further change to ConfigObj:
ConfigObj will no longer attempt to import the ``validate`` module,
until/unless
you call ``ConfigObj.validate`` with ``preserve_errors=True``. This
makes it
faster to import.
All the best,
Michael Foord
http://www.manning.com/foord
|