def read_template(self, template, instance, **kw): if self.is_page_template(template): template = ViewPageTemplateFile(template)(instance, **kw) else: with open(template, "r") as template: template = template.read() return template