| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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()) |
| OLD | NEW |