changeset 472:dc78ade3f320

bug: Fix copying of page assets during the bake. * The `Assetor` wasn't setting the "used assets" flag on the correct object. (I wonder why Python didn't complain about that) * The baker wasn't looking at the right input filename.
author Ludovic Chabant <ludovic@chabant.com>
date Tue, 14 Jul 2015 23:41:25 -0700
parents 5b57a189fd98
children eb3ace870708
files piecrust/baking/single.py piecrust/data/assetor.py
diffstat 2 files changed, 2 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/piecrust/baking/single.py	Tue Jul 14 23:13:16 2015 -0700
+++ b/piecrust/baking/single.py	Tue Jul 14 23:41:25 2015 -0700
@@ -136,11 +136,10 @@
                 logger.debug("Copying page assets to: %s" % out_assets_dir)
                 _ensure_dir_exists(out_assets_dir)
 
-                page_dirname = os.path.dirname(qualified_page.path)
                 page_pathname, _ = os.path.splitext(qualified_page.path)
                 in_assets_dir = page_pathname + ASSET_DIR_SUFFIX
                 for fn in os.listdir(in_assets_dir):
-                    full_fn = os.path.join(page_dirname, fn)
+                    full_fn = os.path.join(in_assets_dir, fn)
                     if os.path.isfile(full_fn):
                         dest_ap = os.path.join(out_assets_dir, fn)
                         logger.debug("  %s -> %s" % (full_fn, dest_ap))
--- a/piecrust/data/assetor.py	Tue Jul 14 23:13:16 2015 -0700
+++ b/piecrust/data/assetor.py	Tue Jul 14 23:41:25 2015 -0700
@@ -91,5 +91,5 @@
 
         cpi = self._page.app.env.exec_info_stack.current_page_info
         if cpi is not None:
-            cpi.render_ctx.used_assets = True
+            cpi.render_ctx.current_pass_info.used_assets = True