Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(87)

Side by Side Diff: mojo/devtools/common/mojo_run

Issue 1964903002: Disable output buffering in devtools scripts. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 #!/usr/bin/env python 1 #!/usr/bin/env python
2 # Copyright 2014 The Chromium Authors. All rights reserved. 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 3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file. 4 # found in the LICENSE file.
5 5
6 import argparse 6 import argparse
7 import logging 7 import logging
8 import sys 8 import sys
9 9
10 from devtoolslib import shell_arguments 10 from devtoolslib import shell_arguments
11 from devtoolslib import shell_config 11 from devtoolslib import shell_config
12 from devtoolslib.utils import disable_output_buffering
12 13
13 _DESCRIPTION = """Runner for Mojo applications. 14 _DESCRIPTION = """Runner for Mojo applications.
14 15
15 Any arguments not recognized by the script will be passed on as shell arguments. 16 Any arguments not recognized by the script will be passed on as shell arguments.
16 17
17 Important shell arguments include: 18 Important shell arguments include:
18 "--args-for=<mojo-app-url> <arguments>" 19 "--args-for=<mojo-app-url> <arguments>"
19 "--content-handlers=<handlers>" 20 "--content-handlers=<handlers>"
20 "--disable-cache" 21 "--disable-cache"
21 "--enable-multiprocess" 22 "--enable-multiprocess"
(...skipping 19 matching lines...) Expand all
41 42
42 Returns: 43 Returns:
43 Arguments that need to be appended to the shell argument list in order to 44 Arguments that need to be appended to the shell argument list in order to
44 run with the debugger. 45 run with the debugger.
45 """ 46 """
46 shell.forward_host_port_to_shell(_MOJO_DEBUGGER_PORT) 47 shell.forward_host_port_to_shell(_MOJO_DEBUGGER_PORT)
47 return ['%s %d' % (_DEBUGGER_URL, _MOJO_DEBUGGER_PORT)] 48 return ['%s %d' % (_DEBUGGER_URL, _MOJO_DEBUGGER_PORT)]
48 49
49 50
50 def main(): 51 def main():
52 disable_output_buffering()
51 logging.basicConfig() 53 logging.basicConfig()
52 54
53 parser = argparse.ArgumentParser( 55 parser = argparse.ArgumentParser(
54 formatter_class=argparse.RawDescriptionHelpFormatter, 56 formatter_class=argparse.RawDescriptionHelpFormatter,
55 description=_DESCRIPTION) 57 description=_DESCRIPTION)
56 shell_config.add_shell_arguments(parser) 58 shell_config.add_shell_arguments(parser)
57 59
58 parser.add_argument('--embed', type=str, 60 parser.add_argument('--embed', type=str,
59 help='Url to be embedded in the window manager.') 61 help='Url to be embedded in the window manager.')
60 parser.add_argument('--debugger', action="store_true", 62 parser.add_argument('--debugger', action="store_true",
(...skipping 20 matching lines...) Expand all
81 83
82 if script_args.verbose: 84 if script_args.verbose:
83 print "Shell arguments: " + str(shell_args) 85 print "Shell arguments: " + str(shell_args)
84 86
85 shell.run(shell_args) 87 shell.run(shell_args)
86 return 0 88 return 0
87 89
88 90
89 if __name__ == "__main__": 91 if __name__ == "__main__":
90 sys.exit(main()) 92 sys.exit(main())
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698