lib/template.py
changeset 11 fa216534ae45
parent 8 0ce1f471e9d7
child 21 b05979822dee
equal deleted inserted replaced
10:d83b10c210e3 11:fa216534ae45
    58         Render the given template, returning the output, or raising a TemplateError
    58         Render the given template, returning the output, or raising a TemplateError
    59     """
    59     """
    60 
    60 
    61     try :
    61     try :
    62         return tpl.render(**params)
    62         return tpl.render(**params)
       
    63     
       
    64     # a template may render other templates
       
    65     except TemplateError :
       
    66         raise
    63 
    67 
    64     except :
    68     except :
    65         raise TemplateError("Template render failed", status='500 Internal Server Error', details=exceptions.text_error_template().render())
    69         details = exceptions.text_error_template().render()
       
    70 
       
    71         raise TemplateError("Template render failed", status='500 Internal Server Error', details=details)
    66 
    72 
    67 def render (name, **params) :
    73 def render (name, **params) :
    68     """
    74     """
    69         Render a template, using lookup() on the given name
    75         Render a template, using lookup() on the given name
    70     """
    76     """