New Versions of Werkzeug and Jinja2
I'm happy to announce new versions of the WSGI utility library Werkzeug and the general purpose templating language Jinja in Version 2.
Over the last few months many improvements went into those libraries.
Werkzeug 0.4
Werkzeug 0.4 (codename Schraubenzieher) got many detail improvements, tons of new unittests and a better WSGI and HTTP compatibility:
Clientsupports an emptydataargument now.- Fixed a bug in
Response.applicationthat made it impossible to use it as method decorator. - The session system should work on Google's Appengine now
- The secure cookie works properly in load balanced environments with different cpu architectures now.
CacheControl.no_cacheandCacheControl.privatebehavior changed to reflect the possibilities of the HTTP RFC. Setting these attributes toNoneorTruenow sets the value to “the empty value”.- Fixed a bug in boolean attribute handling of the
htmlandxhtmlbuilders. - Added graceful error handling to the debugger pastebin feature and made it compatible with latest lodgeit.
- added a more list like interface to
Headers(slicing and indexing works now) - added
remove_entity_headerswhich removes all entity headers from a list of headers (or aHeadersobject) - the responses now automatically call
remove_entity_headersif the status code is 304. - fixed a bug with
Hrefquery parameter handling. Previously the last item of a call toHrefwas not handled properly if it was a dict. Headersnow support apopoperation to better work with environ properties.
Jinja 2.1
Jinja 2.1 (codename Yasuzō) is a new Jinja2 release with tons of new features. A lot of feedback went into improved and new features:
- The i18n extension looks up
foo.ugettextnow followed byfoo.gettextif an translations object is installed. This makes dealing with custom translations classes easier. - added a
sortfilter that works likedictsortbut for arbitrary sequences. - implemented a bytecode cache system that improves startup performance for forking applications. (see documentation for more details)
- Template contexts are now weakref-able.
- Inclusions and imports "with context" forward all variables now, not only the initial context.
- Added a cycle helper called
cycler. - Added a joining helper called
joiner. - added a
compile_expressionmethod to the environment that allows compiling of Jinja expressions into callable Python objects.
Furthermore many bugs where fixed:
- Fixed a bug with nested loops and the special loop variable. Before the change an inner loop overwrote the loop variable from the outer one after iteration.
- Fixed a bug with the i18n extension that caused the explicit pluralization block to look up the wrong variable.
- Fixed a limitation in the lexer that made
{{ foo.0.0 }}impossible. - Index based subscribing of variables with a constant value returns an undefined object now instead of raising an index error. This was a bug caused by eager optimizing.
- Fixed a confusing behavior with conditional extending. loops were partially executed under some conditions even though they were not part of a visible area.
Download the latest releases from the cheeseshop:
A new bugfix release of Jinja 1 will follow in the next days, there are some things that have to be figured out first.
Link to Werkzeug on Cheeseshop returns 404 error. easy_install script also installs Werkzeug 0.3.1
— Nick on Monday, November 24, 2008 9:52 #
Fixed the link. Thanks. Why easy_install is trying to download the wrong file I don't know. I'll try to debug that later that day.
— Armin Ronacher on Monday, November 24, 2008 16:07 #
Keep up the awesome work, many thanks from a very happy user.
— Martin Czura on Thursday, November 27, 2008 1:50 #
Thanks, Armin. I was waiting for the memcached wrapper's `key_prefix` argument that eventually made it to a release.
— Jochen Kupperschmidt on Saturday, November 29, 2008 18:31 #