Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Adding a profile command-line option

  • Loading branch information...
commit 8f4778a86eab39b3abe16da28f6ecf4a6512aaff 1 parent 1670f24
Jason Baker authored
Showing with 15 additions and 0 deletions.
  1. +15 −0 shrapnel/command.py
View
15 shrapnel/command.py
@@ -7,6 +7,7 @@
Copyright (c) 2010 Medium Entertainment, Inc. All rights reserved.
"""
+import config
import logging
import logging.handlers
import optparse
@@ -68,10 +69,24 @@ def run(self):
help = "The path to a file which will contain the server's informational log messages."
)
+ parser.add_option('--profile',
+ action='store_true',
+ dest='profile',
+ default=None,
+ help='Turn profiling on',
+ )
+ parser.add_option('--no-profile',
+ action='store_false',
+ dest='profile',
+ help='Turn profiling off',
+ )
+
for args, kwargs in self.cmd_options:
parser.add_option(*args, **kwargs)
self.options, args = parser.parse_args()
+ if self.options.profile is not None:
+ config.instance('app')['profile']=self.options.profile
os.chdir(self.path)
# tornado.locale.load_translations(
Please sign in to comment.
Something went wrong with that request. Please try again.