Chameleon v2.10 Release Notes
Release Date: 2012-10-12 // over 11 years ago-
๐ Deprecations:
- ๐ The
fast_translate
function has been deprecated. Instead, the default translation function is now always a function that simply interpolates the mapping onto the message default or id.
The motivation is that since version 2.9, the
context
argument is non-trivial: theecontext
mapping is passed. This breaks an expectation on the Zope platform that thecontext
parameter is the HTTP request. Previously, with Chameleon this parameter was simply not provided and so that did not cause issues as such.- The
ast24
module has been renamed toast25
. This should help clear up any confusion that Chameleon 2.x might be support a Python interpreter less than version 2.5 (it does not).
๐ Features:
The
ProxyExpr
expression class (and hence theload:
expression type) is now a TALES-expression. In practical terms, this means that the expression type (which computes a string result using the standard"${...}"
interpolation syntax and proxies the result through a function) now supports fallback using the pipe operator ("|"
). This fixes issue #128.An attempt to interpolate using the empty string as the expression (i.e.
${}
) now does nothing: the string${}
is simply output as is.โ Added support for adding, modifying, and removing attributes using a dictionary expression in
tal:attributes
(analogous to Genshi'spy:attrs
directive)::
In the example above,
name
is an identifier, whilevalue
andattrs
are Python expressions. However,attrs
must evaluate to a Python dictionary object (more concisely, the value must implement the dictionary API-methodsupdate()
anditems()
).Optimizations:
- In order to cut down on the size of the compiled function objects, some conversion and quoting statements have been put into functions. In one measurement, the reduction was 35%. The benchmark suite does not report of an increased render time (actually slightly decreased).
๐ Bugfixes:
๐ป An exception is now raised if a trivial string is passed for
metal:fill-slot
. This fixes issue #89.An empty string is now never translated. Not really a bug, but it's been reported in as an issue (#92) because some translation frameworks handle this case incorrectly.
The template module loader (file cache) now correctly encodes generated template source code as UTF-8. This fixes issue #125.
๐ Fixed issue where a closure might be reused unsafely in nested template rendering.
Fixed markup class
__repr__
method. This fixes issue #124.โ Added missing return statement to fix printing the non-abbreviated filename in case of an exception. [tomo]
- ๐ The