aboutsummaryrefslogtreecommitdiffstats
path: root/mako/cache.py
diff options
context:
space:
mode:
Diffstat (limited to 'mako/cache.py')
-rw-r--r--mako/cache.py16
1 files changed, 8 insertions, 8 deletions
diff --git a/mako/cache.py b/mako/cache.py
index 1af17dd..57821d7 100644
--- a/mako/cache.py
+++ b/mako/cache.py
@@ -4,7 +4,8 @@
# This module is part of Mako and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
-from mako import compat, util
+from mako import compat
+from mako import util
_cache_plugins = util.PluginLoader("mako.cache")
@@ -90,9 +91,8 @@ class Cache(object):
return creation_function()
return self.impl.get_or_create(
- key,
- creation_function,
- **self._get_cache_kw(kw, context))
+ key, creation_function, **self._get_cache_kw(kw, context)
+ )
def set(self, key, value, **kw):
r"""Place a value in the cache.
@@ -141,7 +141,7 @@ class Cache(object):
template.
"""
- self.invalidate('render_body', __M_defname='render_body')
+ self.invalidate("render_body", __M_defname="render_body")
def invalidate_def(self, name):
"""Invalidate the cached content of a particular ``<%def>`` within this
@@ -149,7 +149,7 @@ class Cache(object):
"""
- self.invalidate('render_%s' % name, __M_defname='render_%s' % name)
+ self.invalidate("render_%s" % name, __M_defname="render_%s" % name)
def invalidate_closure(self, name):
"""Invalidate a nested ``<%def>`` within this template.
@@ -165,7 +165,7 @@ class Cache(object):
self.invalidate(name, __M_defname=name)
def _get_cache_kw(self, kw, context):
- defname = kw.pop('__M_defname', None)
+ defname = kw.pop("__M_defname", None)
if not defname:
tmpl_kw = self.template.cache_args.copy()
tmpl_kw.update(kw)
@@ -177,7 +177,7 @@ class Cache(object):
self._def_regions[defname] = tmpl_kw
if context and self.impl.pass_context:
tmpl_kw = tmpl_kw.copy()
- tmpl_kw.setdefault('context', context)
+ tmpl_kw.setdefault("context", context)
return tmpl_kw