Package PyFoam :: Package ThirdParty :: 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, encoding='utf-8', data=None, escape=1, loader_class=<class PyFoam.ThirdParty.pyratemp.LoaderFile at 0x110374f58>, parser_class=<class 'PyFoam.ThirdParty.pyratemp.Parser'>, renderer_class=<class 'PyFoam.ThirdParty.pyratemp.Renderer'>, eval_class=<class PyFoam.ThirdParty.pyratemp.EvalPseudoSandbox at 0x11037..., escape_func=<function escape at 0x110370a28>)
Load (+parse) a template.
source code
    Inherited from TemplateBase
 
__call__(self, **override)
Fill out/render the template.
source code
 
__str__(self)
Only here for completeness.
source code
 
__unicode__(self)
Alias for __call__().
source code
Method Details [hide private]

__init__(self, string=None, filename=None, parsetree=None, encoding='utf-8', data=None, escape=1, loader_class=<class PyFoam.ThirdParty.pyratemp.LoaderFile at 0x110374f58>, parser_class=<class 'PyFoam.ThirdParty.pyratemp.Parser'>, renderer_class=<class 'PyFoam.ThirdParty.pyratemp.Renderer'>, eval_class=<class PyFoam.ThirdParty.pyratemp.EvalPseudoSandbox at 0x11037..., escape_func=<function escape at 0x110370a28>)
(Constructor)

source code 

Load (+parse) a template.

:Parameters:

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