Commits

Andriy Kornatskyy  committed dfcfc0c

Added autoreload feature for wheezy.template.

  • Participants
  • Parent commits f54618e

Comments (0)

Files changed (2)

File demos/template/development.ini

 [tenjin]
 inline-preprocessor-fallback = False
 
-[wheezy]
+[wheezy.template]
+auto-reload = False
 inline-preprocessor-fallback = False
 
 [uwsgi]

File demos/template/src/config.py

     from wheezy.html.utils import html_escape
     from wheezy.template.engine import Engine
     from wheezy.template.ext.core import CoreExtension
+    from wheezy.template.loader import autoreload
     from wheezy.template.loader import FileLoader
     from wheezy.web.templates import WheezyTemplate
     from public import __version__
     searchpath = ['content/templates-wheezy']
-    engine = Engine(
+    engine = autoreload(Engine(
         loader=FileLoader(searchpath),
         extensions=[
             InlineExtension(searchpath, fallback=config.getboolean(
-                'wheezy', 'inline-preprocessor-fallback')),
+                'wheezy.template', 'inline-preprocessor-fallback')),
             CoreExtension,
             WidgetExtension,
             WhitespaceExtension,
-        ])
+        ]), enabled=config.get('wheezy.template', 'auto-reload'))
     engine.global_vars.update({
         'format_value': format_value,
         'h': html_escape,