TemplateInterface

A common templating interface for Python applications
Download

TemplateInterface Ranking & Summary

Advertisement

  • Rating:
  • License:
  • MIT/X Consortium Lic...
  • Price:
  • FREE
  • Publisher Name:
  • Alice Bevan-McGregor
  • Publisher web site:
  • http://www.python-turbomail.org/

TemplateInterface Tags


TemplateInterface Description

A common templating interface for Python applications TemplateInterface is a common templating interface for Python, especially web applications.Simple usage: >>> from cti.core import Engines >>> render = Engines() >>> render.json("Hello world!") ('application/json', '"Hello world!"') >>> render.yaml(dict(name="world", statement="Hello!", test=)) ('application/x-yaml', 'name: world statement: Hello! test: ') >>> render.sprintf(dict(name="world"), string="Hello %(name)s!") ('text/plain', 'Hello world!')Framework usage: >>> from cti.core import Engines >>> render = Engines('genshi') >>> content_type, content = render('myapp.templates.foo') >>> content_type, content = render('myapp/templates/foo.html') >>> content_type, content = render('./templates/foo.html') Requirements: · Python


TemplateInterface Related Software