Mercurial > piecrust2
comparison piecrust/baking/baker.py @ 11:617191dec18e
Fixes for Windows, make `findPagePath` return a ref path.
author | Ludovic Chabant <ludovic@chabant.com> |
---|---|
date | Mon, 18 Aug 2014 16:47:44 -0700 |
parents | 343d08ef5668 |
children | 923699e816d0 |
comparison
equal
deleted
inserted
replaced
10:cd35d356ccce | 11:617191dec18e |
---|---|
72 elif ext: | 72 elif ext: |
73 bake_path.append(decoded_uri) | 73 bake_path.append(decoded_uri) |
74 else: | 74 else: |
75 bake_path.append(decoded_uri + '.html') | 75 bake_path.append(decoded_uri + '.html') |
76 | 76 |
77 return os.path.join(*bake_path) | 77 return os.path.normpath(os.path.join(*bake_path)) |
78 | 78 |
79 def bake(self, factory, route, taxonomy_name=None, taxonomy_term=None): | 79 def bake(self, factory, route, taxonomy_name=None, taxonomy_term=None): |
80 page = factory.buildPage() | 80 page = factory.buildPage() |
81 | 81 |
82 pagination_filter = None | 82 pagination_filter = None |
153 try: | 153 try: |
154 logger.debug(" p%d -> %s" % (cur_sub, out_path)) | 154 logger.debug(" p%d -> %s" % (cur_sub, out_path)) |
155 ctx, rp = self._bakeSingle(page, sub_uri, cur_sub, out_path, | 155 ctx, rp = self._bakeSingle(page, sub_uri, cur_sub, out_path, |
156 pagination_filter, custom_data) | 156 pagination_filter, custom_data) |
157 except Exception as ex: | 157 except Exception as ex: |
158 logger.exception("Error baking page '%s' for URI '%s': %s" % | 158 raise Exception("Error baking page '%s' for URI '%s'." % |
159 (page.ref_spec, uri, ex)) | 159 (page.ref_spec, uri)) from ex |
160 raise | |
161 | 160 |
162 cur_record_entry.out_uris.append(sub_uri) | 161 cur_record_entry.out_uris.append(sub_uri) |
163 cur_record_entry.out_paths.append(out_path) | 162 cur_record_entry.out_paths.append(out_path) |
164 cur_record_entry.used_source_names |= ctx.used_source_names | 163 cur_record_entry.used_source_names |= ctx.used_source_names |
165 cur_record_entry.used_taxonomy_terms |= ctx.used_taxonomy_terms | 164 cur_record_entry.used_taxonomy_terms |= ctx.used_taxonomy_terms |