comparison piecrust/commands/builtin/serving.py @ 169:f3aa511eef99

serve: Add option to use the debugger without `--debug`.
author Ludovic Chabant <ludovic@chabant.com>
date Sat, 03 Jan 2015 18:06:52 -0800
parents 50b65c700c96
children d7a548ebcd58
comparison
equal deleted inserted replaced
168:56d6b17e057b 169:f3aa511eef99
20 help="The host for the web server", 20 help="The host for the web server",
21 default='localhost') 21 default='localhost')
22 parser.add_argument('--use-reloader', 22 parser.add_argument('--use-reloader',
23 help="Restart the server when PieCrust code changes", 23 help="Restart the server when PieCrust code changes",
24 action='store_true') 24 action='store_true')
25 parser.add_argument('--use-debugger',
26 help="Show the debugger when an error occurs",
27 action='store_true')
25 28
26 def run(self, ctx): 29 def run(self, ctx):
27 server = Server( 30 server = Server(
28 ctx.app.root_dir, 31 ctx.app.root_dir,
29 host=ctx.args.address, 32 host=ctx.args.address,
30 port=ctx.args.port, 33 port=ctx.args.port,
31 debug=ctx.args.debug, 34 debug=(ctx.args.debug or ctx.args.use_debugger),
32 use_reloader=ctx.args.use_reloader) 35 use_reloader=ctx.args.use_reloader)
33 server.run() 36 server.run()
34 37