| 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 from skypy.skyserver import SkyServer | 6 from skypy.skyserver import SkyServer |
| 7 import argparse | 7 import argparse |
| 8 import json | 8 import json |
| 9 import logging | 9 import logging |
| 10 import os | 10 import os |
| (...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 106 '--content-handlers=%s' % ','.join(content_handlers), | 106 '--content-handlers=%s' % ','.join(content_handlers), |
| 107 '--url-mappings=mojo:window_manager=mojo:kiosk_wm', | 107 '--url-mappings=mojo:window_manager=mojo:kiosk_wm', |
| 108 '--args-for=mojo:sky_debugger %d' % remote_command_port, | 108 '--args-for=mojo:sky_debugger %d' % remote_command_port, |
| 109 'mojo:sky_debugger', | 109 'mojo:sky_debugger', |
| 110 ] | 110 ] |
| 111 | 111 |
| 112 if args.url_or_path: | 112 if args.url_or_path: |
| 113 shell_args.append( | 113 shell_args.append( |
| 114 '--args-for=mojo:window_manager %s' % self._url_from_args(args)) | 114 '--args-for=mojo:window_manager %s' % self._url_from_args(args)) |
| 115 | 115 |
| 116 if args.trace_startup: |
| 117 shell_args.append('--trace-startup') |
| 118 |
| 116 # Map all mojo: urls to http: urls using the --origin command. | 119 # Map all mojo: urls to http: urls using the --origin command. |
| 117 build_dir_url = SkyServer.url_for_path( | 120 build_dir_url = SkyServer.url_for_path( |
| 118 remote_server_port, | 121 remote_server_port, |
| 119 self.pids['sky_server_root'], | 122 self.pids['sky_server_root'], |
| 120 self.pids['build_dir']) | 123 self.pids['build_dir']) |
| 121 | 124 |
| 122 # TODO(eseidel): We should do this on linux, but we need to fix | 125 # TODO(eseidel): We should do this on linux, but we need to fix |
| 123 # mojo http loading to be faster first. | 126 # mojo http loading to be faster first. |
| 124 if is_android: | 127 if is_android: |
| 125 shell_args += ['--origin=%s' % build_dir_url] | 128 shell_args += ['--origin=%s' % build_dir_url] |
| (...skipping 433 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 559 start_parser.add_argument('--gdb', action='store_true') | 562 start_parser.add_argument('--gdb', action='store_true') |
| 560 start_parser.add_argument('--command-port', type=int, | 563 start_parser.add_argument('--command-port', type=int, |
| 561 default=DEFAULT_SKY_COMMAND_PORT) | 564 default=DEFAULT_SKY_COMMAND_PORT) |
| 562 start_parser.add_argument('--use-osmesa', action='store_true', | 565 start_parser.add_argument('--use-osmesa', action='store_true', |
| 563 default=self._in_chromoting()) | 566 default=self._in_chromoting()) |
| 564 start_parser.add_argument('build_dir', type=str) | 567 start_parser.add_argument('build_dir', type=str) |
| 565 start_parser.add_argument('url_or_path', nargs='?', type=str, | 568 start_parser.add_argument('url_or_path', nargs='?', type=str, |
| 566 default=DEFAULT_URL) | 569 default=DEFAULT_URL) |
| 567 start_parser.add_argument('--show-command', action='store_true', | 570 start_parser.add_argument('--show-command', action='store_true', |
| 568 help='Display the shell command and exit') | 571 help='Display the shell command and exit') |
| 572 start_parser.add_argument('--trace-startup', action='store_true') |
| 569 start_parser.set_defaults(func=self.start_command) | 573 start_parser.set_defaults(func=self.start_command) |
| 570 | 574 |
| 571 stop_parser = subparsers.add_parser('stop', | 575 stop_parser = subparsers.add_parser('stop', |
| 572 help=('stop sky (as listed in %s)' % PID_FILE_PATH)) | 576 help=('stop sky (as listed in %s)' % PID_FILE_PATH)) |
| 573 stop_parser.set_defaults(func=self.stop_command) | 577 stop_parser.set_defaults(func=self.stop_command) |
| 574 | 578 |
| 575 pids_parser = subparsers.add_parser('pids', | 579 pids_parser = subparsers.add_parser('pids', |
| 576 help='dump the current skydb pids file') | 580 help='dump the current skydb pids file') |
| 577 pids_parser.set_defaults(func=self.pids_command) | 581 pids_parser.set_defaults(func=self.pids_command) |
| 578 | 582 |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 610 load_parser.set_defaults(func=self.load_command) | 614 load_parser.set_defaults(func=self.load_command) |
| 611 | 615 |
| 612 args = parser.parse_args() | 616 args = parser.parse_args() |
| 613 args.func(args) | 617 args.func(args) |
| 614 | 618 |
| 615 self._write_pid_file(PID_FILE_PATH, self.pids) | 619 self._write_pid_file(PID_FILE_PATH, self.pids) |
| 616 | 620 |
| 617 | 621 |
| 618 if __name__ == '__main__': | 622 if __name__ == '__main__': |
| 619 SkyDebugger().main() | 623 SkyDebugger().main() |
| OLD | NEW |