class KajikiRenderer(object): def __init__(self, path, extra_vars): self.loader = FileLoader(path, reload=True) self.extra_vars = extra_vars def render(self, template_path, namespace): Template = self.loader.import_(template_path) stream = Template(self.extra_vars.make_ns(namespace)) return stream.render()
class KajikiRenderer(object): ''' Defines the builtin ``Kajiki`` renderer. ''' def __init__(self, path, extra_vars): self.loader = FileLoader(path, reload=True) self.extra_vars = extra_vars def render(self, template_path, namespace): ''' Implements ``Kajiki`` rendering. ''' Template = self.loader.import_(template_path) stream = Template(self.extra_vars.make_ns(namespace)) return stream.render()
def __init__(self, path, extra_vars): self.loader = FileLoader(path, reload=True) self.extra_vars = extra_vars
def prepare(self, filename, i18n=None, autoescape=False, **options): loader = FileLoader(None) loader._filename = self._filename template = loader.load(filename) return template