| 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 |
| (...skipping 29 matching lines...) Expand all Loading... |
| 40 | 40 |
| 41 | 41 |
| 42 def _configure_debugger(shell): | 42 def _configure_debugger(shell): |
| 43 """Configures mojo:debugger to run and sets up port forwarding for its http | 43 """Configures mojo:debugger to run and sets up port forwarding for its http |
| 44 server if the shell is running on a device. | 44 server if the shell is running on a device. |
| 45 | 45 |
| 46 Returns: | 46 Returns: |
| 47 Arguments that need to be appended to the shell argument list in order to | 47 Arguments that need to be appended to the shell argument list in order to |
| 48 run with the debugger. | 48 run with the debugger. |
| 49 """ | 49 """ |
| 50 shell.ForwardHostPortToShell(_MOJO_DEBUGGER_PORT) | 50 shell.forward_host_port_to_shell(_MOJO_DEBUGGER_PORT) |
| 51 return ['mojo:debugger %d' % _MOJO_DEBUGGER_PORT] | 51 return ['mojo:debugger %d' % _MOJO_DEBUGGER_PORT] |
| 52 | 52 |
| 53 | 53 |
| 54 def main(): | 54 def main(): |
| 55 logging.basicConfig() | 55 logging.basicConfig() |
| 56 | 56 |
| 57 parser = argparse.ArgumentParser(usage=_USAGE, description=_DESCRIPTION) | 57 parser = argparse.ArgumentParser(usage=_USAGE, description=_DESCRIPTION) |
| 58 shell_config.add_shell_arguments(parser) | 58 shell_config.add_shell_arguments(parser) |
| 59 | 59 |
| 60 parser.add_argument('--no-debugger', action="store_true", | 60 parser.add_argument('--no-debugger', action="store_true", |
| (...skipping 19 matching lines...) Expand all Loading... |
| 80 print ' pass --no-debugger to skip spawning mojo:debugger.' | 80 print ' pass --no-debugger to skip spawning mojo:debugger.' |
| 81 shell_args.extend(_configure_debugger(shell)) | 81 shell_args.extend(_configure_debugger(shell)) |
| 82 | 82 |
| 83 shell_args = shell_arguments.append_to_argument(shell_args, '--url-mappings=', | 83 shell_args = shell_arguments.append_to_argument(shell_args, '--url-mappings=', |
| 84 'mojo:window_manager=%s' % | 84 'mojo:window_manager=%s' % |
| 85 script_args.window_manager) | 85 script_args.window_manager) |
| 86 | 86 |
| 87 if script_args.verbose: | 87 if script_args.verbose: |
| 88 print "Shell arguments: " + str(shell_args) | 88 print "Shell arguments: " + str(shell_args) |
| 89 | 89 |
| 90 shell.Run(shell_args) | 90 shell.run(shell_args) |
| 91 return 0 | 91 return 0 |
| 92 | 92 |
| 93 | 93 |
| 94 if __name__ == "__main__": | 94 if __name__ == "__main__": |
| 95 sys.exit(main()) | 95 sys.exit(main()) |
| OLD | NEW |