def _iprof_exec(options):
"""
Called from a command line to instance based profile data in a web page.
"""
if options.file[0].endswith('.py'):
if len(options.file) > 1:
print("iprofview can only process a single python file.", file=sys.stderr)
sys.exit(-1)
_iprof_py_file(options)
options.file = ['iprof.0']
if not options.noshow:
app = _Application(options)
app.listen(options.port)
print("starting server on port %d" % options.port)
serve_thread = _startThread(tornado.ioloop.IOLoop.current().start)
launch_thread = _startThread(lambda: _launch_browser(options.port))
while serve_thread.isAlive():
serve_thread.join(timeout=1)
评论列表
文章目录