#!/usr/bin/env python # -*- coding: utf-8 -*- # # see benchsimple.py # configuration for SimpleTal dummywriter = """ output=[] class dummy: def write(self, _): output.append(_) pass dummywriter = dummy() """ config = { "template" : """\

""", "module" : "simpletal", "import" : "from simpletal import simpleTAL, simpleTALES" + dummywriter, "complete" : """ output = [] context = simpleTALES.Context(allowPythonPath=True) context.globals.update(context_dict) t = simpleTAL.compileHTMLTemplate(template) t.expand(context, dummywriter) r = "".join(output)""", "parse" : "t = simpleTAL.compileHTMLTemplate(template)", "render" : """ output = [] context = simpleTALES.Context(allowPythonPath=True) context.globals.update(context_dict) t.expand(context, dummywriter) r = "".join(output) """ } #-----------------------------------------