Package spade :: Module pyratemp :: Class Template
[hide private]
[frames] | no frames]

Class Template

source code


Template-User-Interface.

:Usage:
    ::
        t = Template(...)  (<- see __init__)
        output = t(...)    (<- see TemplateBase.__call__)

:Example:
    see module-docstring

Instance Methods [hide private]
 
__init__(self, string=None, filename=None, parsetree=None, data=None, encoding='utf-8', escape=0)
Load (+parse) a template.
source code

Inherited from TemplateBase: __call__, __str__, __unicode__

Method Details [hide private]

__init__(self, string=None, filename=None, parsetree=None, data=None, encoding='utf-8', escape=0)
(Constructor)

source code 

Load (+parse) a template.

:Parameter:

  • string,filename,parsetree: a template-string, filename of a template to load, or a template-parsetree. (only one of these 3 is allowed)
  • data: data to fill into the template by default (dictionary). This data may later be overridden when rendering the template.
  • encoding: encoding of the template-files (only used for "filename")
  • escape: default-escaping for the template, may be overwritten by the template!
Overrides: TemplateBase.__init__