lib/template.py
changeset 21 b05979822dee
parent 11 fa216534ae45
child 26 9d3beac1b196
equal deleted inserted replaced
20:d40c339d3778 21:b05979822dee
    53     except :
    53     except :
    54         raise TemplateError("Template broken: %r" % (path, ), status='500 Internal Server Error', details=exceptions.text_error_template().render())
    54         raise TemplateError("Template broken: %r" % (path, ), status='500 Internal Server Error', details=exceptions.text_error_template().render())
    55 
    55 
    56 def render_template (tpl, **params) :
    56 def render_template (tpl, **params) :
    57     """
    57     """
    58         Render the given template, returning the output, or raising a TemplateError
    58         Render the given template, returning the output as a unicode string, or raising a TemplateError
    59     """
    59     """
    60 
    60 
    61     try :
    61     try :
    62         return tpl.render(**params)
    62         return tpl.render_unicode(**params)
    63     
    63     
    64     # a template may render other templates
    64     # a template may render other templates
    65     except TemplateError :
    65     except TemplateError :
    66         raise
    66         raise
    67 
    67