Andriy Kornatskyy avatar Andriy Kornatskyy committed 69bdaa5

Applied changes related to mako inline preprocessor.

Comments (0)

Files changed (4)

demos/template/development.ini

 [mako]
 filesystem-checks = False
 module-directory = /tmp/mako_modules
-inline-preprocessor-enabled = True
+inline-preprocessor-fallback = False
 
 [jinja2]
 auto-reload = False

demos/template/setup.py

 install_requires = [
     'wheezy.core>=0.1.70',
     'wheezy.caching>=0.1.54',
-    'wheezy.html>=0.1.92',
+    'wheezy.html>=0.1.94',
     'wheezy.http>=0.1.236',
     'wheezy.routing>=0.1.124',
     'wheezy.security>=0.1.36',

demos/template/src/config.py

 """
 
 import os
-import sys
 
 from datetime import timedelta
 
 
-PY3 = sys.version_info[0] >= 3
-
-if PY3:  # pragma: nocover
+try:  # pragma: nocover
+    from ConfigParser import ConfigParser
+    config = ConfigParser()
+except ImportError:  # pragma: nocover
     from configparser import ConfigParser
     config = ConfigParser(strict=False)
-else:  # pragma: nocover
-    from ConfigParser import ConfigParser
-    config = ConfigParser()
 
 from wheezy.caching import MemoryCache
 from wheezy.core.collections import defaultdict
         'CRYPTO_VALIDATION_KEY': config.get('crypto', 'validation-key')
 })
 
-#template_engine = os.getenv('TEMPLATE_ENGINE', 'mako')
 template_engine = os.getenv('TEMPLATE_ENGINE', 'tenjin')
 if template_engine == 'mako':
     from wheezy.html.ext.mako import inline_preprocessor
             filesystem_checks=config.getboolean('mako', 'filesystem-checks'),
             directories=directories,
             cache_factory=cache_factory,
-            default_filters=[],
-            imports=[PY3 and 's=str' or 's=unicode'],
             preprocessor=[
-                inline_preprocessor(directories, enabled=config.getboolean(
-                    'mako', 'inline-preprocessor-enabled')),
+                inline_preprocessor(directories, config.getboolean(
+                    'mako', 'inline-preprocessor-fallback')),
                 widget_preprocessor,
                 whitespace_preprocessor,
             ])
 install_requires = [
     'wheezy.core>=0.1.70',
     'wheezy.caching>=0.1.54',
-    'wheezy.html>=0.1.92',
+    'wheezy.html>=0.1.94',
     'wheezy.http>=0.1.236',
     'wheezy.routing>=0.1.124',
     'wheezy.security>=0.1.36',
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.