Mercurial > piecrust2
comparison piecrust/sources/mixins.py @ 885:13e8b50a2113
publish: Fix publishers API and add a simple "copy" publisher.
author | Ludovic Chabant <ludovic@chabant.com> |
---|---|
date | Tue, 20 Jun 2017 21:12:35 -0700 |
parents | fddaf43424e2 |
children |
comparison
equal
deleted
inserted
replaced
884:18b3e2acd069 | 885:13e8b50a2113 |
---|---|
19 """ | 19 """ |
20 def _getRelatedAssetsContents(self, item): | 20 def _getRelatedAssetsContents(self, item): |
21 spec_no_ext, _ = os.path.splitext(item.spec) | 21 spec_no_ext, _ = os.path.splitext(item.spec) |
22 assets_dir = spec_no_ext + assets_suffix | 22 assets_dir = spec_no_ext + assets_suffix |
23 try: | 23 try: |
24 asset_files = osutil.listdir(assets_dir) | 24 asset_files = list(osutil.listdir(assets_dir)) |
25 except OSError: | 25 except (OSError, FileNotFoundError): |
26 return None | 26 return None |
27 | 27 |
28 assets = [] | 28 assets = [] |
29 for f in asset_files: | 29 for f in asset_files: |
30 fpath = os.path.join(assets_dir, f) | 30 fpath = os.path.join(assets_dir, f) |