| 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 os | 8 import os |
| 9 from skypy.paths import Paths | 9 from skypy.paths import Paths |
| 10 import socket; | 10 import socket; |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 64 parser = argparse.ArgumentParser(description='Sky launcher/debugger') | 64 parser = argparse.ArgumentParser(description='Sky launcher/debugger') |
| 65 parser.add_argument('--gdb', action='store_true') | 65 parser.add_argument('--gdb', action='store_true') |
| 66 parser.add_argument('--use-osmesa', action='store_true') | 66 parser.add_argument('--use-osmesa', action='store_true') |
| 67 parser.add_argument('url', nargs='?', type=str) | 67 parser.add_argument('url', nargs='?', type=str) |
| 68 args = parser.parse_args() | 68 args = parser.parse_args() |
| 69 | 69 |
| 70 content_handlers = ['%s,%s' % (mime_type, 'mojo:sky_viewer') | 70 content_handlers = ['%s,%s' % (mime_type, 'mojo:sky_viewer') |
| 71 for mime_type in SUPPORTED_MIME_TYPES] | 71 for mime_type in SUPPORTED_MIME_TYPES] |
| 72 shell_command = [ | 72 shell_command = [ |
| 73 self.paths.mojo_shell_path, | 73 self.paths.mojo_shell_path, |
| 74 '--v=1', | |
| 75 '--content-handlers=%s' % ','.join(content_handlers), | 74 '--content-handlers=%s' % ','.join(content_handlers), |
| 76 '--url-mappings=mojo:window_manager=mojo:sky_debugger', | 75 '--url-mappings=mojo:window_manager=mojo:sky_debugger', |
| 77 'mojo:window_manager', | 76 'mojo:window_manager', |
| 78 ] | 77 ] |
| 79 if args.url: | 78 if args.url: |
| 80 url = args.url | 79 url = args.url |
| 81 if not urlparse.urlparse(url).scheme: | 80 if not urlparse.urlparse(url).scheme: |
| 82 url = self._start_http_server_for_file(url) | 81 url = self._start_http_server_for_file(url) |
| 83 | 82 |
| 84 prompt_args = '--args-for=mojo:sky_debugger_prompt %s' % url | 83 prompt_args = '--args-for=mojo:sky_debugger_prompt %s' % url |
| (...skipping 12 matching lines...) Expand all Loading... |
| 97 | 96 |
| 98 | 97 |
| 99 if __name__ == '__main__': | 98 if __name__ == '__main__': |
| 100 skydb = SkyDebugger() | 99 skydb = SkyDebugger() |
| 101 try: | 100 try: |
| 102 skydb.main() | 101 skydb.main() |
| 103 except (KeyboardInterrupt, SystemExit): | 102 except (KeyboardInterrupt, SystemExit): |
| 104 pass | 103 pass |
| 105 finally: | 104 finally: |
| 106 skydb.shutdown() | 105 skydb.shutdown() |
| OLD | NEW |