The web.template module currently only provides one function, pasrse(), used to parse a template.
| type='python', dict=None [,file=None][,template=None][,useCompiled='auto'][,swapTemplatePaths=None]) |
'python', 'cheetah', 'xyaptu' or 'dreamweaverMX'. A 'python' template is a string using the dictionary filling format.
None, template must be specified.
None, file must be specified.
None nothing is done. Otherwise can be set to (oldPath, newPath) to swap paths in the template itself before the parsing is done.
Simple example:
>>> import web.template
>>> print web.template.parse(dict={'w':'World!'}, template="Hello %(w)s")
Hello World!
This is the same as doing this in Python:
>>> print "Hello %(w)s"%{'w':'World!'}
Hello World!