diff piecrust/templating/jinja/extensions.py @ 989:8adc27285d93

bake: Big pass on bake performance. - Reduce the amount of data passed between processes. - Make inter-process data simple objects to make it easier to test with alternatives to pickle. - Make sources have the basic requirement to be able to find a content item from an item spec (path). - Make Hoedown the default Markdown formatter.
author Ludovic Chabant <ludovic@chabant.com>
date Sun, 19 Nov 2017 14:29:17 -0800
parents cedefb806bfd
children 1857dbd4580f
line wrap: on
line diff
--- a/piecrust/templating/jinja/extensions.py	Fri Nov 03 23:14:56 2017 -0700
+++ b/piecrust/templating/jinja/extensions.py	Sun Nov 19 14:29:17 2017 -0800
@@ -146,19 +146,19 @@
         key = self.environment.piecrust_cache_prefix + name
 
         rcs = self.environment.app.env.render_ctx_stack
-        rdr_pass = rcs.current_ctx.current_pass_info
+        ri = rcs.current_ctx.render_info
 
         # try to load the block from the cache
         # if there is no fragment in the cache, render it and store
         # it in the cache.
         pair = self.environment.piecrust_cache.get(key)
         if pair is not None:
-            rdr_pass.used_source_names.update(pair[1])
+            ri['used_source_names'].update(pair[1])
             return pair[0]
 
-        prev_used = rdr_pass.used_source_names.copy()
+        prev_used = ri['used_source_names'].copy()
         rv = caller()
-        after_used = rdr_pass.used_source_names.copy()
+        after_used = ri['used_source_names'].copy()
         used_delta = after_used.difference(prev_used)
         self.environment.piecrust_cache[key] = (rv, used_delta)
         return rv