Пример #1
0
    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()
Пример #2
0
    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()
Пример #3
0
    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()
Пример #4
0
 def __init__(self, path, extra_vars):
     self.loader = FileLoader(path, reload=True)
     self.extra_vars = extra_vars
Пример #5
0
 def prepare(self, filename, i18n=None, autoescape=False, **options):
     loader = FileLoader(None)
     loader._filename = self._filename
     template = loader.load(filename)
     return template
Пример #6
0
 def prepare(self, filename, i18n=None, autoescape=False, **options):
     loader = FileLoader(None)
     loader._filename = self._filename
     template = loader.load(filename)
     return template
Пример #7
0
 def __init__(self, path, extra_vars):
     self.loader = FileLoader(path, reload=True)
     self.extra_vars = extra_vars