Mercurial > piecrust2
comparison piecrust/baking/single.py @ 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 | 21e26ed867b6 |
children | eb3ace870708 |
comparison
equal
deleted
inserted
replaced
471:5b57a189fd98 | 472:dc78ade3f320 |
---|---|
134 out_assets_dir += out_name_noext | 134 out_assets_dir += out_name_noext |
135 | 135 |
136 logger.debug("Copying page assets to: %s" % out_assets_dir) | 136 logger.debug("Copying page assets to: %s" % out_assets_dir) |
137 _ensure_dir_exists(out_assets_dir) | 137 _ensure_dir_exists(out_assets_dir) |
138 | 138 |
139 page_dirname = os.path.dirname(qualified_page.path) | |
140 page_pathname, _ = os.path.splitext(qualified_page.path) | 139 page_pathname, _ = os.path.splitext(qualified_page.path) |
141 in_assets_dir = page_pathname + ASSET_DIR_SUFFIX | 140 in_assets_dir = page_pathname + ASSET_DIR_SUFFIX |
142 for fn in os.listdir(in_assets_dir): | 141 for fn in os.listdir(in_assets_dir): |
143 full_fn = os.path.join(page_dirname, fn) | 142 full_fn = os.path.join(in_assets_dir, fn) |
144 if os.path.isfile(full_fn): | 143 if os.path.isfile(full_fn): |
145 dest_ap = os.path.join(out_assets_dir, fn) | 144 dest_ap = os.path.join(out_assets_dir, fn) |
146 logger.debug(" %s -> %s" % (full_fn, dest_ap)) | 145 logger.debug(" %s -> %s" % (full_fn, dest_ap)) |
147 shutil.copy(full_fn, dest_ap) | 146 shutil.copy(full_fn, dest_ap) |
148 | 147 |