Mercurial > piecrust2
diff piecrust/serving.py @ 39:2f717f961996
Better error reporting and cache validation.
Fix the processor pipeline in the preview server.
Move the `pages` route to first position.
author | Ludovic Chabant <ludovic@chabant.com> |
---|---|
date | Thu, 21 Aug 2014 22:28:22 -0700 |
parents | 617191dec18e |
children | 73956224eb67 |
line wrap: on
line diff
--- a/piecrust/serving.py Thu Aug 21 10:56:17 2014 -0700 +++ b/piecrust/serving.py Thu Aug 21 22:28:22 2014 -0700 @@ -42,11 +42,12 @@ # Bake all the assets so we know what we have, and so we can serve # them to the client. We need a temp app for this. app = PieCrust(root_dir=self.root_dir, debug=self.debug) + mounts = app.assets_dirs self._out_dir = os.path.join(app.cache_dir, 'server') self._skip_patterns = app.config.get('baker/skip_patterns') self._force_patterns = app.config.get('baker/force_patterns') pipeline = ProcessorPipeline( - app, self._out_dir, + app, mounts, self._out_dir, skip_patterns=self._skip_patterns, force_patterns=self._force_patterns) self._record = pipeline.run() @@ -112,10 +113,11 @@ # Yep, we know about this URL because we processed an asset that # maps to it... make sure it's up to date by re-processing it # before serving. - asset_in_path = os.path.join(app.root_dir, entry.rel_input) + mounts = app.assets_dirs + asset_in_path = entry.path asset_out_path = os.path.join(self._out_dir, rel_req_path) pipeline = ProcessorPipeline( - app, self._out_dir, + app, mounts, self._out_dir, skip_patterns=self._skip_patterns, force_patterns=self._force_patterns) pipeline.run(asset_in_path)