Commits

Andriy Kornatskyy committed f54618e

Added InlineExtension for wheezy.template; updated demo template.

  • Participants
  • Parent commits 20cd403

Comments (0)

Files changed (7)

demos/template/content/templates-wheezy/membership/signin.html

 @extends("shared/master.html")
 
 @def title():
-Sign In\
+Sign In
 @end
 
 @def content():

demos/template/content/templates-wheezy/membership/signup.html

 @extends("shared/master.html")
 
 @def title():
-Sign Up\
+Sign Up
 @end
 
 @def content():

demos/template/content/templates-wheezy/shared/master.html

                     <h1><a href="@path_for('default')">My Site</a></h1>
                 </div>
                 <div id="logindisplay">
-                    @include("shared/snippet/menu-signin.html")
-                    @include("shared/snippet/menu-locale.html")
+                    @inline("shared/snippet/menu-signin.html")
+                    @inline("shared/snippet/menu-locale.html")
                 </div>
                 <div id="menucontainer">
-                    @include("shared/snippet/menu-header.html")
+                    @inline("shared/snippet/menu-header.html")
                 </div>
             </div>
             <div id="main">
                 <div id="footer">Version @__version__</div>
             </div>
         </div>
-        @include("shared/snippet/script.html")
+        @inline("shared/snippet/script.html")
         @def script():
         @end
         @script()\

demos/template/development.ini

 [tenjin]
 inline-preprocessor-fallback = False
 
+[wheezy]
+inline-preprocessor-fallback = False
+
 [uwsgi]
 wsgi = app:main
 #uwsgi-socket = /tmp/uwsgi-test.sock
 no-default-app = False
 auto-procname = True
 procname-prefix = MySite-
-#limit-as = 70
+limit-as = 70
 buffer-size = 2048
 post-buffering = 1024
 limit-post = 1024

demos/template/setup.py

 install_requires = [
     'wheezy.core>=0.1.70',
     'wheezy.caching>=0.1.54',
-    'wheezy.html>=0.1.108',
+    'wheezy.html>=0.1.109',
     'wheezy.http>=0.1.236',
     'wheezy.routing>=0.1.124',
     'wheezy.security>=0.1.36',
     'wheezy.validation>=0.1.74',
-    'wheezy.web>=0.1.259',
+    'wheezy.web>=0.1.262',
 ]
 
 try:

demos/template/src/config.py

     })
     render_template = Jinja2Template(env)
 elif template_engine == 'wheezy.template':
+    from wheezy.html.ext.template import InlineExtension
     from wheezy.html.ext.template import WhitespaceExtension
     from wheezy.html.ext.template import WidgetExtension
     from wheezy.html.utils import format_value
     from wheezy.template.engine import Engine
     from wheezy.template.ext.core import CoreExtension
     from wheezy.template.loader import FileLoader
-    from wheezy.template.loader import uwsgi_autoreload
     from wheezy.web.templates import WheezyTemplate
     from public import __version__
     searchpath = ['content/templates-wheezy']
     engine = Engine(
-        loader=uwsgi_autoreload(
-            FileLoader(searchpath),
-            signum=10,
-            enabled=config.getint('uwsgi', 'python-auto-reload') > 0
-        ),
+        loader=FileLoader(searchpath),
         extensions=[
+            InlineExtension(searchpath, fallback=config.getboolean(
+                'wheezy', 'inline-preprocessor-fallback')),
             CoreExtension,
             WidgetExtension,
             WhitespaceExtension,
 install_requires = [
     'wheezy.core>=0.1.70',
     'wheezy.caching>=0.1.54',
-    'wheezy.html>=0.1.108',
+    'wheezy.html>=0.1.109',
     'wheezy.http>=0.1.236',
     'wheezy.routing>=0.1.124',
     'wheezy.security>=0.1.36',