[llvm-commits] [zorg] r156111 - /zorg/trunk/llvmlab/llvmlab/llvmlabtool/main.py
Daniel Dunbar
daniel at zuster.org
Thu May 3 15:11:38 PDT 2012
Author: ddunbar
Date: Thu May 3 17:11:38 2012
New Revision: 156111
URL: http://llvm.org/viewvc/llvm-project?rev=156111&view=rev
Log:
llvmlab runserver: Add --reloader, --debugger, and --profiler options.
Modified:
zorg/trunk/llvmlab/llvmlab/llvmlabtool/main.py
Modified: zorg/trunk/llvmlab/llvmlab/llvmlabtool/main.py
URL: http://llvm.org/viewvc/llvm-project/zorg/trunk/llvmlab/llvmlab/llvmlabtool/main.py?rev=156111&r1=156110&r2=156111&view=diff
==============================================================================
--- zorg/trunk/llvmlab/llvmlab/llvmlabtool/main.py (original)
+++ zorg/trunk/llvmlab/llvmlab/llvmlabtool/main.py Thu May 3 17:11:38 2012
@@ -139,13 +139,25 @@
import llvmlab
from optparse import OptionParser, OptionGroup
parser = OptionParser("%%prog %s [options]" % name)
+ parser.add_option("", "--reloader", dest="reloader", default=False,
+ action="store_true", help="use WSGI reload monitor")
+ parser.add_option("", "--debugger", dest="debugger", default=False,
+ action="store_true", help="use WSGI debugger")
+ parser.add_option("", "--profiler", dest="profiler", default=False,
+ action="store_true", help="enable WSGI profiler")
(opts, args) = parser.parse_args(args)
if len(args) != 0:
parser.error("invalid number of arguments")
- instance = llvmlab.ui.app.App.create_standalone()
- instance.run()
+ app = llvmlab.ui.app.App.create_standalone()
+ if opts.debugger:
+ app.debug = True
+ if opts.profiler:
+ app.wsgi_app = werkzeug.contrib.profiler.ProfilerMiddleware(
+ app.wsgi_app, stream = open('profiler.log', 'w'))
+ app.run(use_reloader = opts.reloader,
+ use_debugger = opts.debugger)
def action_import_users(name, args):
"""import users from SVN information"""
More information about the llvm-commits
mailing list