# HG changeset patch # User Christophe de Vienne # Date 1408653768 -7200 # Node ID cf5b0d0f5731afa94650a6e6468eb17fb535cb20 # Parent 9b3b21b7ff3e92549b7587f8d6849f05ae837e3b [wsgi] add the --debug / -D option to the wsgi command diff -r 9b3b21b7ff3e -r cf5b0d0f5731 cwctl.py --- a/cwctl.py Mon Sep 08 10:55:30 2014 +0200 +++ b/cwctl.py Thu Aug 21 22:42:48 2014 +0200 @@ -1048,12 +1048,16 @@ return ('stdlib',) return ('stdlib', 'werkzeug') -class WSGIDebugStartHandler(InstanceCommand): +class WSGIStartHandler(InstanceCommand): """Start an interactive wsgi server """ name = 'wsgi' actionverb = 'started' arguments = '' options = ( + ("debug", + {'short': 'D', 'action': 'store_true', + 'default': False, + 'help': 'start server in debug mode.'}), ('method', {'short': 'm', 'type': 'choice', @@ -1063,16 +1067,16 @@ 'help': 'wsgi utility/method'}), ('loglevel', {'short': 'l', - 'type' : 'choice', + 'type': 'choice', 'metavar': '', - 'default': 'debug', + 'default': None, 'choices': ('debug', 'info', 'warning', 'error'), 'help': 'debug if -D is set, error otherwise', }), ) def wsgi_instance(self, appid): - config = cwcfg.config_for(appid, debugmode=1) + config = cwcfg.config_for(appid, debugmode=self['debug']) init_cmdline_log_threshold(config, self['loglevel']) assert config.name == 'all-in-one' meth = self['method'] @@ -1087,7 +1091,7 @@ for cmdcls in (ListCommand, CreateInstanceCommand, DeleteInstanceCommand, StartInstanceCommand, StopInstanceCommand, RestartInstanceCommand, - WSGIDebugStartHandler, + WSGIStartHandler, ReloadConfigurationCommand, StatusCommand, UpgradeInstanceCommand, ListVersionsInstanceCommand,