Mercurial > piecrust2
comparison piecrust/serving/wrappers.py @ 852:4850f8c21b6e
core: Start of the big refactor for PieCrust 3.0.
* Everything is a `ContentSource`, including assets directories.
* Most content sources are subclasses of the base file-system source.
* A source is processed by a "pipeline", and there are 2 built-in pipelines,
one for assets and one for pages. The asset pipeline is vaguely functional,
but the page pipeline is completely broken right now.
* Rewrite the baking process as just running appropriate pipelines on each
content item. This should allow for better parallelization.
author | Ludovic Chabant <ludovic@chabant.com> |
---|---|
date | Wed, 17 May 2017 00:11:48 -0700 |
parents | b91fe30ae7aa |
children | 1bb0d973dc69 |
comparison
equal
deleted
inserted
replaced
851:2c7e57d80bba | 852:4850f8c21b6e |
---|---|
1 import os | 1 import os |
2 import signal | 2 import signal |
3 import logging | 3 import logging |
4 import urllib.request | |
5 | 4 |
6 | 5 |
7 logger = logging.getLogger(__name__) | 6 logger = logging.getLogger(__name__) |
8 | 7 |
9 | 8 |
97 app_wrapper.run() | 96 app_wrapper.run() |
98 | 97 |
99 | 98 |
100 def _get_piecrust_server(appfactory, run_sse_check=None): | 99 def _get_piecrust_server(appfactory, run_sse_check=None): |
101 from piecrust.serving.middlewares import ( | 100 from piecrust.serving.middlewares import ( |
102 StaticResourcesMiddleware, PieCrustDebugMiddleware) | 101 StaticResourcesMiddleware, PieCrustDebugMiddleware) |
103 from piecrust.serving.server import WsgiServer | 102 from piecrust.serving.server import WsgiServer |
104 app = WsgiServer(appfactory) | 103 app = WsgiServer(appfactory) |
105 app = StaticResourcesMiddleware(app) | 104 app = StaticResourcesMiddleware(app) |
106 app = PieCrustDebugMiddleware( | 105 app = PieCrustDebugMiddleware( |
107 app, appfactory, run_sse_check=run_sse_check) | 106 app, appfactory, run_sse_check=run_sse_check) |
108 return app | 107 return app |
109 | 108 |