mirror of
https://github.com/reddit-archive/reddit.git
synced 2026-01-24 22:38:09 -05:00
Move toggle for template caching into its own .ini flag.
This commit is contained in:
@@ -8,8 +8,10 @@
|
||||
# -- debug and configuation flags --
|
||||
# global debug flag -- displays pylons stacktrace rather than 500 page on error when true
|
||||
debug = true
|
||||
# enables/disables template caching and whitespace removal (for development)
|
||||
template_debug = true
|
||||
# enables/disables whitespace removal (for development)
|
||||
template_debug = false
|
||||
# enables/disables compiled template caching and template file mtime checking
|
||||
reload_templates = true
|
||||
# use uncompressed static files (out of /static/js and /static/css)
|
||||
# rather than compressed files out of /static (for development if true)
|
||||
uncompressedJS = true
|
||||
|
||||
@@ -68,7 +68,7 @@ def load_environment(global_conf={}, app_conf={}, setup_globals=True):
|
||||
#tmpl_options['myghty.escapes'] = dict(l=webhelpers.auto_link, s=webhelpers.simple_format)
|
||||
|
||||
tmpl_options = config['buffet.template_options']
|
||||
tmpl_options['mako.filesystem_checks'] = g.debug
|
||||
tmpl_options['mako.filesystem_checks'] = getattr(g, 'reload_templates', False)
|
||||
tmpl_options['mako.default_filters'] = ["mako_websafe"]
|
||||
tmpl_options['mako.imports'] = \
|
||||
["from r2.lib.filters import websafe, unsafe, mako_websafe",
|
||||
|
||||
@@ -79,6 +79,7 @@ class Globals(object):
|
||||
'log_start',
|
||||
'sqlprinting',
|
||||
'template_debug',
|
||||
'reload_templates',
|
||||
'uncompressedJS',
|
||||
'enable_doquery',
|
||||
'use_query_cache',
|
||||
|
||||
@@ -175,11 +175,11 @@ class Templated(object):
|
||||
from r2.config.templates import tpm
|
||||
from pylons import g
|
||||
|
||||
debug = g.template_debug
|
||||
use_cache = not g.reload_templates
|
||||
template = None
|
||||
try:
|
||||
template = tpm.get(self.render_class,
|
||||
style, cache = not debug)
|
||||
style, cache = use_cache)
|
||||
except AttributeError:
|
||||
self._notfound(style)
|
||||
return template
|
||||
|
||||
Reference in New Issue
Block a user