Skip to content

Releases: sqlalchemy/mako

0.4.0

02 Sep 18:49
Compare
Choose a tag to compare

0.4.0

Released: Sun Mar 6 2011

  • A 20% speedup for a basic two-page
    inheritance setup rendering
    a table of escaped data
    (see http://techspot.zzzeek.org/2010/11/19/quick-mako-vs.-jinja-speed-test/).
    A few configurational changes which
    affect those in the I-don't-do-unicode
    camp should be noted below.

  • The FastEncodingBuffer is now used
    by default instead of cStringIO or StringIO,
    regardless of whether output_encoding
    is set to None or not. FEB is faster than
    both. Only StringIO allows bytestrings
    of unknown encoding to pass right
    through, however - while it is of course
    not recommended to send bytestrings of unknown
    encoding to the output stream, this
    mode of usage can be re-enabled by
    setting the flag bytestring_passthrough
    to True.

  • disable_unicode mode requires that
    output_encoding be set to None - it also
    forces the bytestring_passthrough flag
    to True.

  • the <%namespace> tag raises an error
    if the 'template' and 'module' attributes
    are specified at the same time in
    one tag. A different class is used
    for each case which allows a reduction in
    runtime conditional logic and function
    call overhead.

    References: #156

  • the keys() in the Context, as well as
    it's internal _data dictionary, now
    include just what was specified to
    render() as well as Mako builtins
    'caller', 'capture'. The contents
    of builtin are no longer copied.
    Thanks to Daniel Lopez for pointing
    this out.

    References: #159

0.3.6

02 Sep 18:49
Compare
Choose a tag to compare

0.3.6

Released: Sat Nov 13 2010

  • Documentation is on Sphinx.

    References: #126

  • Beaker is now part of "extras" in
    setup.py instead of "install_requires".
    This to produce a lighter weight install
    for those who don't use the caching
    as well as to conform to Pyramid
    deployment practices.

    References: #154

  • The Beaker import (or attempt thereof)
    is delayed until actually needed;
    this to remove the performance penalty
    from startup, particularly for
    "single execution" environments
    such as shell scripts.

    References: #153

  • Patch to lexer to not generate an empty
    '' write in the case of backslash-ended
    lines.

    References: #155

  • Fixed missing **extra collection in
    setup.py which prevented setup.py
    from running 2to3 on install.

    References: #148

  • New flag on Template, TemplateLookup -
    strict_undefined=True, will cause
    variables not found in the context to
    raise a NameError immediately, instead of
    defaulting to the UNDEFINED value.

  • The range of Python identifiers that
    are considered "undefined", meaning they
    are pulled from the context, has been
    trimmed back to not include variables
    declared inside of expressions (i.e. from
    list comprehensions), as well as
    in the argument list of lambdas. This
    to better support the strict_undefined
    feature. The change should be
    fully backwards-compatible but involved
    a little bit of tinkering in the AST code,
    which hadn't really been touched for
    a couple of years, just FYI.

0.3.5

02 Sep 18:49
Compare
Choose a tag to compare

0.3.5

Released: Sun Oct 24 2010

  • The <%namespace> tag allows expressions
    for the file argument, i.e. with ${}.
    The context variable, if needed,
    must be referenced explicitly.

    References: #141

  • ${} expressions embedded in tags,
    such as <%foo:bar x="${...}">, 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. No idea whatsoever if the
    install_requires in setup.py also breaks GAE,
    couldn't get an answer on this.

    References: #151

0.3.4

02 Sep 18:49
Compare
Choose a tag to compare

0.3.4

Released: Tue Jun 22 2010

  • Now using MarkupSafe for HTML escaping,
    i.e. in place of cgi.escape(). Faster
    C-based implementation and also escapes
    single quotes for additional security.
    Supports the html attribute for
    the given expression as well.

    When using "disable_unicode" mode,
    a pure Python HTML escaper function
    is used which also quotes single quotes.

    Note that Pylons by default doesn't
    use Mako's filter - check your
    environment.py file.

  • Fixed call to "unicode.strip" in
    exceptions.text_error_template which
    is not Py3k compatible.

    References: #137

0.3.3

02 Sep 18:49
Compare
Choose a tag to compare

0.3.3

Released: Mon May 31 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.

    References: #135

  • Fixed sometimes incorrect usage of
    exc.class.name
    in html/text error templates when using
    Python 2.4

    References: #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.

    References: #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.

0.3.2

02 Sep 18:49
Compare
Choose a tag to compare

0.3.2

Released: Thu Mar 11 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

    References: #116

0.3.1

02 Sep 18:49
Compare
Choose a tag to compare

0.3.1

Released: Sun Mar 7 2010

  • Fixed incorrect dir name in setup.py

    References: #129

0.3.0

02 Sep 18:49
Compare
Choose a tag to compare

0.3.0

Released: Fri Mar 5 2010

  • Python 2.3 support is dropped.

    References: #123

  • Python 3 support is added ! See README.py3k
    for installation and testing notes.

    References: #119

  • Unit tests now run with nose.

    References: #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
    <%namespace:defname> tags.

    References: #99

  • RichTraceback(), html_error_template().render(),
    text_error_template().render() now accept "error"
    and "traceback" as optional arguments, and
    these are now actually used.

    References: #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 "%%".

    References: #112

  • Template accepts empty control structure, i.e.
    % if: %endif, etc.

    References: #94

  • The <%page args> 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.

    References: #116

  • defs declared within a <%namespace> 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.

    References: #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.

    References: #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.

    References: #73

0.2.5

02 Sep 18:49
Compare
Choose a tag to compare

0.2.5

Released: Mon Sep 7 2009

  • Added a "decorator" kw argument to <%def>,
    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.

    References: #101

  • Fixed namespace.getattr() to raise
    AttributeError on attribute not found
    instead of RuntimeError.

    References: #104

  • Added last_modified accessor to Template,
    returns the time.time() when the module
    was created.

    References: #97

  • Fixed lexing support for whitespace
    around '=' sign in defs.

    References: #102

  • Removed errant "lower()" in the lexer which
    was causing tags to compile with
    case-insensitive names, thus messing up
    custom <%call> names.

    References: #108

  • added "mako.version" attribute to
    the base module.

    References: #110

0.2.4

02 Sep 18:49
Compare
Choose a tag to compare

0.2.4

Released: Tue Dec 23 2008

  • Fixed compatibility with Jython 2.5b1.