Package genshi :: Package template :: Module markup :: Class MarkupTemplate

Class MarkupTemplate

   object --+    
            |    
base.Template --+
                |
               MarkupTemplate

Implementation of the template language for XML-based templates.

>>> tmpl = MarkupTemplate('''<ul xmlns:py="http://genshi.edgewall.org/">
...   <li py:for="item in items">${item}</li>
... </ul>''')
>>> print tmpl.generate(items=[1, 2, 3])
<ul>
  <li>1</li><li>2</li><li>3</li>
</ul>
Nested Classes

Inherited from base.Template: __metaclass__

Instance Methods

Inherited from base.Template: __getstate__, __init__, __repr__, __setstate__, generate

Inherited from object: __delattr__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __setattr__, __str__

Class Variables
  DIRECTIVE_NAMESPACE = <Namespace "http://genshi.edgewall.org/">
  XINCLUDE_NAMESPACE = <Namespace "http://www.w3.org/2001/XInclu...
  directives = ["right" ction-MethodDetails">
Method Details

__init__(self, name, search_path)
(Constructor)

 
Create the exception.
Parameters:
  • name - the filename of the template
  • search_path - the search path used to lookup the template
Overrides: object.__init__

./usr/share/doc/python-genshi-doc/html/api/genshi.template.markup-module.html0000644000000000000000000001054611035162124026204 0ustar rootroot genshi.template.markup
Package genshi :: Package template :: Module markup

Module markup

Markup templating engine.
Classes
  MarkupTemplate
Implementation of the template language for XML-based templates.