# HG changeset patch # User Ludovic Chabant # Date 1431064004 25200 # Node ID aade4ea57e7f166b8ced5ba3ec65815d5ff3da4e # Parent fa3ee8a8ee2d6f32752955070102d34a34c126a6 serve: Add ability to suppress the debug info window programmatically. diff -r fa3ee8a8ee2d -r aade4ea57e7f piecrust/serving/server.py --- a/piecrust/serving/server.py Thu May 07 21:37:38 2015 -0700 +++ b/piecrust/serving/server.py Thu May 07 22:46:44 2015 -0700 @@ -54,11 +54,12 @@ class Server(object): def __init__(self, root_dir, - debug=False, sub_cache_dir=None, + debug=False, sub_cache_dir=None, enable_debug_info=True, static_preview=True, run_sse_check=None): self.root_dir = root_dir self.debug = debug self.sub_cache_dir = sub_cache_dir + self.enable_debug_info = enable_debug_info self.run_sse_check = run_sse_check self.static_preview = static_preview self._out_dir = None @@ -123,6 +124,7 @@ app.config.set('site/root', '/') app.config.set('server/is_serving', True) if (app.config.get('site/enable_debug_info') and + self.enable_debug_info and '!debug' in request.args): app.config.set('site/show_debug_info', True)