'Fill in a template, putting any keyword arguments on the context.'

def fill_template(self, filename, **kwargs):

    self.get_user()
    if filename.endswith('.mako'):
        return self.fill_template_mako(filename, **kwargs)
    else:
        template = Template(file=os.path.join(self.app.config.template_path, filename), searchList=[kwargs, self.template_context, dict(caller=self, t=self, h=helpers, util=util, request=self.request, response=self.response, app=self.app)])
        return str(template)
