changeset 858:58e28ba02fb7

refactor: Fix a few more pieces of code using the old APIs.
author Ludovic Chabant <ludovic@chabant.com>
date Thu, 08 Jun 2017 08:50:33 -0700
parents d231a10d18f9
children 86994e076be4
files piecrust/rendering.py piecrust/templating/jinja/extensions.py
diffstat 2 files changed, 3 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/piecrust/rendering.py	Thu Jun 08 08:49:33 2017 -0700
+++ b/piecrust/rendering.py	Thu Jun 08 08:50:33 2017 -0700
@@ -348,7 +348,7 @@
             output = engine.renderFile(full_names, layout_data)
     except TemplateNotFoundError as ex:
         logger.exception(ex)
-        msg = "Can't find template for page: %s\n" % page.path
+        msg = "Can't find template for page: %s\n" % page.content_item.spec
         msg += "Looked for: %s" % ', '.join(full_names)
         raise Exception(msg) from ex
 
--- a/piecrust/templating/jinja/extensions.py	Thu Jun 08 08:49:33 2017 -0700
+++ b/piecrust/templating/jinja/extensions.py	Thu Jun 08 08:50:33 2017 -0700
@@ -128,9 +128,8 @@
     def _cache_support(self, name, caller):
         key = self.environment.piecrust_cache_prefix + name
 
-        exc_stack = self.environment.app.env.exec_info_stack
-        render_ctx = exc_stack.current_page_info.render_ctx
-        rdr_pass = render_ctx.current_pass_info
+        rcs = self.environment.app.env.render_ctx_stack
+        rdr_pass = rcs.current_ctx.current_pass_info
 
         # try to load the block from the cache
         # if there is no fragment in the cache, render it and store