Mercurial > piecrust2
view piecrust/admin/main.py @ 854:08e02c2a2a1a
core: Keep refactoring, this time to prepare for generator sources.
- Make a few APIs simpler.
- Content pipelines create their own jobs, so that generator sources can
keep aborting in `getContents`, but rely on their pipeline to generate
pages for baking.
author | Ludovic Chabant <ludovic@chabant.com> |
---|---|
date | Sun, 04 Jun 2017 23:34:28 -0700 |
parents | 5e91bc0e3b4d |
children |
line wrap: on
line source
import logging logger = logging.getLogger(__name__) def run_foodtruck(host=None, port=None, debug=False, extra_settings=None): es = {} if debug: es['DEBUG'] = True if extra_settings: es.update(extra_settings) from .web import create_foodtruck_app try: app = create_foodtruck_app(es) app.run(host=host, port=port, debug=debug, threaded=True) except SystemExit: # This is needed for Werkzeug's code reloader to be able to correctly # shutdown the child process in order to restart it (otherwise, SSE # generators will keep it alive). from . import pubutil logger.debug("Shutting down SSE generators from main...") pubutil.server_shutdown = True raise