Beispiel #1
0
 def default_render(self, source, **kwargs):
     '''
     Render template from *source* with kwargs as context variables/options.
     
     For rendering options, please see *tori.render*.
     
     Example: self.default_render('shiroyuki.html', author='juti noppornpitak', direct_rendering=False)
     '''
     response.headers['Platform'] = base.getVersion() + " (Tori %s)" % __version__
     kwargs['base_uri'] = base_uri
     return render(source, **kwargs)
Beispiel #2
0
 def response(responseContent):
     substitutions = {
         'version':      base.getVersion(),
         'response':     responseContent
     }
     return minify_content(render(UserInterface.TEMPLATE, direct_rendering=False, **substitutions), True)