Mako

Hyperfast and lightweight templating for the Python platform
Download

Mako Ranking & Summary

Advertisement

  • Rating:
  • License:
  • Freeware
  • Price:
  • FREE
  • Publisher Name:
  • Mike Bayer
  • Publisher web site:
  • http://www.sqlalchemy.org/
  • Operating Systems:
  • Mac OS X
  • File Size:
  • 222 KB

Mako Tags


Mako Description

Hyperfast and lightweight templating for the Python platform Mako is a free template library written in Python that will provide a familiar, non-XML syntax which compiles into Python modules for maximum performance. Mako's syntax and API borrows from the best ideas of many others, including Django templates, Cheetah, Myghty, and Genshi. Conceptually, Mako is an embedded Python (i.e. Python Server Page) language, which refines the familiar ideas of componentized layout and inheritance to produce one of the most straightforward and flexible models available, while also maintaining close ties to Python calling and scoping semantics. Here are some key features of "Mako": · Super-simple API. For basic usage, just one class, Template is needed. · Insanely Fast. Standard template features: · control structures constructed from real Python code (i.e. loops, conditionals) · straight Python blocks, inline or at the module-level · plain old includes Callable blocks: · can access variables from their enclosing scope as well as the template's request context · can be nested arbitrarily · can specify regular Python argument signatures · outer-level callable blocks can be called by other templates or controller code (i.e. "method call") · Calls to functions can define any number of sub-blocks of content which are accessible to the called function (i.e. "component-call-with-content"). This is the basis for nestable custom tags. Inheritance: · supports "multi-zoned" inheritance - define any number of areas in the base template to be overridden. · supports "chaining" style inheritance - call next.body() to call the "inner" content. · the full inheritance hierarchy is navigable in both directions (i.e. parent and child) from anywhere in the chain. · inheritance is dynamic ! Specify a function instead of a filename to calculate inheritance on the fly for every request. What's New in This Release: · 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. · Fixed namespace.__getattr__() to raise AttributeError on attribute not found instead of RuntimeError. · Added last_modified accessor to Template, returns the time.time() when the module was created. · Fixed lexing support for whitespace around '=' sign in defs. · Removed errant "lower()" in the lexer which was causing tags to compile with case-insensitive names, thus messing up custom names. · added "mako.__version__" attribute to the base module.


Mako Related Software