Add ICU message format support
[chromium-blink-merge.git] / tools / memory_inspector / start_web_ui
blob3d0f8d81858ecd7362e28dfde91b48aaaab5195b
1 #!/usr/bin/env python
2 # Copyright 2014 The Chromium Authors. All rights reserved.
3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file.
6 import argparse
7 import logging
9 from memory_inspector.frontends import www_server
12 DEFAULT_HTTP_PORT = 8089
15 def _ParseArguments():
16 parser = argparse.ArgumentParser(description='Start the memory inspector.')
17 parser.add_argument(
18 '-p', '--port',
19 type=int,
20 default=DEFAULT_HTTP_PORT,
21 help='the port on which the memory inspector server will run')
22 parser.add_argument(
23 '-n', '--no-browser',
24 action='store_true',
25 default=False,
26 help=('start the memory inspector server without launching the web-based '
27 'frontend'))
28 return parser.parse_args()
31 if __name__ == '__main__':
32 options = _ParseArguments()
33 logging.getLogger().setLevel(logging.WARNING)
34 print 'Serving on port %d' % options.port
35 if not options.no_browser:
36 import webbrowser
37 webbrowser.open('http://127.0.0.1:%d' % options.port)
38 www_server.Start(options.port)