October 21st, 2010· The tag allows expressions for the `file` argument, i.e. with ${}. The `context` variable, if needed, must be referenced explicitly. [ticket:141]
· ${} expressions embedded in tags, such as , now allow multiline Python expressions. - Fixed previously non-covered regular expression, such that using a ${} expression inside of a tag element that doesn't allow them raises a CompileException instead of silently failing.
· Added a try/except around "import markupsafe". This to support GAE which can't run markupsafe. [ticket:151] No idea whatsoever if the install_requires in setup.py also breaks GAE, couldn't get an answer on this.
May 31st, 2010· Added conditional to RichTraceback such that if no traceback is passed and sys.exc_info() has been reset, the formatter just returns blank for the "traceback" portion. [ticket:135]
· Fixed sometimes incorrect usage of exc.__class__.__name__ in html/text error templates when using Python 2.4 [ticket:131]
· Fixed broken @property decorator on template.last_modified
· Fixed error formatting when a stacktrace line contains no line number, as in when inside an eval/exec-generated function. [ticket:132]
· When a .py is being created, the tempfile where the source is stored temporarily is now made in the same directory as that of the .py file. This ensures that the two files share the same filesystem, thus avoiding cross-filesystem synchronization issues. Thanks to Charles Cazabon.
March 12th, 2010· Calling a def from the top, via template.get_def(...).render() now checks the argument signature the same way as it did in 0.2.5, so that TypeError is not raised. reopen of [ticket:116]
March 6th, 2010· Python 2.3 support is dropped. [ticket:123]
· Python 3 support is added ! See README.py3k for installation and testing notes. [ticket:119] - Unit tests now run with nose. [ticket:127]
· Source code escaping has been simplified. In particular, module source files are now generated with the Python "magic encoding comment", and source code is passed through mostly unescaped, except for that code which is regenerated from parsed Python source. This fixes usage of unicode in tags. [ticket:99]
· RichTraceback(), html_error_template().render(), text_error_template().render() now accept "error" and "traceback" as optional arguments, and these are now actually used. [ticket:122] - The exception output generated when format_exceptions=True will now be as a Python unicode if it occurred during render_unicode(), or an encoded string if during render().
· A percent sign can be emitted as the first non-whitespace character on a line by escaping it as in "%%". [ticket:112] - Template accepts empty control structure, i.e. % if: %endif, etc. [ticket:94]
· The tag can now be used in a base inheriting template - the full set of render() arguments are passed down through the inherits chain. Undeclared arguments go into **pageargs as usual. [ticket:116]
· defs declared within a section, an uncommon feature, have been improved. The defs no longer get doubly-rendered in the body() scope, and now allow local variable assignment without breakage. [ticket:109]
· Windows paths are handled correctly if a Template is passed only an absolute filename (i.e. with c: drive etc.) and no URI - the URI is converted to a forward-slash path and module_directory is treated as a windows path. [ticket:128]
· TemplateLookup raises TopLevelLookupException for a given path that is a directory, not a filename, instead of passing through to the template to generate IOError. [ticket:73]
September 8th, 2009· Added a "decorator" kw argument to , allows custom decoration functions to wrap rendering callables. Mainly intended for custom caching algorithms, not sure what other uses there may be (but there may be). Examples are in the "filtering" docs.
· When Mako creates subdirectories in which to store templates, it uses the more permissive mode of 0775 instead of 0750, helping out with certain multi-process scenarios. Note that the mode is always subject to the restrictions of the existing umask. [ticket:101]
· Fixed namespace.__getattr__() to raise AttributeError on attribute not found instead of RuntimeError. [ticket:104]
· Added last_modified accessor to Template, returns the time.time() when the module was created. [ticket:97]
· Fixed lexing support for whitespace around '=' sign in defs. [ticket:102]
· Removed errant "lower()" in the lexer which was causing tags to compile with case-insensitive names, thus messing up custom names. [ticket:108]
· added "mako.__version__" attribute to the base module. [ticket:110]
December 23rd, 2008· Fixed compatibility with Jython 2.5b1
November 24th, 2008· the syntax described at http://techspot.zzzeek.org/?p=28 has now been added as a built in syntax, and is recommended as a more modern syntax versus . The Êll tag itself will always remain, with presenting a more HTML-like alternative to calling defs, both plain and nested. Many examples of the new syntax are in the "Calling a def with embedded content" section of the docs.
· added support for Jython 2.5.
· cache module now uses Beaker's CacheManager object directly, so that all cache types are included. memcached is available as both "ext:memcached" and "memcached", the latter for backwards compatibility.
· added "cache" accessor to Template, Namespace. e.g. ${local.cache.get('somekey')} or template.cache.invalidate_body()
· added "cache_enabled=True" flag to Template, TemplateLookup. Setting this to False causes cache operations to "pass through" and execute every time; this flag should be integrated in Pylons with its own cache_enabled configuration setting.
· the Cache object now supports invalidate_def(name), invalidate_body(), invalidate_closure(name), invalidate(key), which will remove the given key from the cache, if it exists. The cache arguments (i.e. storage type) are derived from whatever has been already persisted for that template. [ticket:92]
· For cache changes to work fully, Beaker 1.1 is required. 1.0.1 and up will work as well with the exception of cache expiry. Note that Beaker 1.1 is **required** for applications which use dynamically generated keys, since previous versions will permanently store state in memory for each individual key, thus consuming all available memory for an arbitrarily large number of distinct keys.
· fixed bug whereby an template with args named the same as a __builtin__ would not honor the default value specified in [ticket:93]
· fixed the html_error_template not handling tracebacks from normal .py files with a magic encoding comment [ticket:88]
· RichTraceback() now accepts an optional traceback object to be used in place of sys.exc_info()[2]. html_error_template() and text_error_template() accept an optional render()-time argument "traceback" which is passed to the RichTraceback object.
· added ModuleTemplate class, which allows the construction of a Template given a Python module generated by a previous Template. This allows Python modules alone to be used as templates with no compilation step. Source code and template source are optional but allow error reporting to work correctly.
· fixed Python 2.3 compat. in mako.pyparser [ticket:90]
· fix Babel 0.9.3 compatibility; stripping comment tags is now optional (and enabled by default).