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.paths import Paths | 6 from skypy.paths import Paths |
7 from skypy.skyserver import SkyServer | 7 from skypy.skyserver import SkyServer |
8 import argparse | 8 import argparse |
9 import logging | 9 import logging |
10 import os | 10 import os |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
47 return os.environ.get('CHROME_REMOTE_DESKTOP_SESSION', False) | 47 return os.environ.get('CHROME_REMOTE_DESKTOP_SESSION', False) |
48 | 48 |
49 def main(self): | 49 def main(self): |
50 logging.basicConfig(level=logging.INFO) | 50 logging.basicConfig(level=logging.INFO) |
51 | 51 |
52 parser = argparse.ArgumentParser(description='Sky launcher/debugger') | 52 parser = argparse.ArgumentParser(description='Sky launcher/debugger') |
53 parser.add_argument('--gdb', action='store_true') | 53 parser.add_argument('--gdb', action='store_true') |
54 parser.add_argument('--use-osmesa', action='store_true', | 54 parser.add_argument('--use-osmesa', action='store_true', |
55 default=self._in_chromoting()) | 55 default=self._in_chromoting()) |
56 parser.add_argument('url_or_path', nargs='?', type=str) | 56 parser.add_argument('url_or_path', nargs='?', type=str) |
57 parser.add_argument('--show-command', action='store_true', | |
58 help='Display the shell command and exit') | |
57 configuration.add_arguments(parser) | 59 configuration.add_arguments(parser) |
58 args = parser.parse_args() | 60 args = parser.parse_args() |
59 | 61 |
60 self.paths = Paths(os.path.join('out', args.configuration)) | 62 self.paths = Paths(os.path.join('out', args.configuration)) |
61 | 63 |
62 content_handlers = ['%s,%s' % (mime_type, 'mojo:sky_viewer') | 64 content_handlers = ['%s,%s' % (mime_type, 'mojo:sky_viewer') |
63 for mime_type in SUPPORTED_MIME_TYPES] | 65 for mime_type in SUPPORTED_MIME_TYPES] |
64 shell_command = [ | 66 shell_command = [ |
65 self.paths.mojo_shell_path, | 67 self.paths.mojo_shell_path, |
66 '--v=1', | 68 '--v=1', |
(...skipping 15 matching lines...) Expand all Loading... | |
82 | 84 |
83 if args.gdb: | 85 if args.gdb: |
84 shell_command = ['gdb', '--args'] + shell_command | 86 shell_command = ['gdb', '--args'] + shell_command |
85 | 87 |
86 if server_root: | 88 if server_root: |
87 with SkyServer(self.paths, HTTP_PORT, args.configuration, | 89 with SkyServer(self.paths, HTTP_PORT, args.configuration, |
88 server_root): | 90 server_root): |
89 subprocess.check_call(shell_command) | 91 subprocess.check_call(shell_command) |
90 else: | 92 else: |
91 subprocess.check_call(shell_command) | 93 subprocess.check_call(shell_command) |
94 if args.show_command: | |
95 print " ".join(shell_command) | |
96 else: | |
97 subprocess.check_call(shell_command) | |
98 | |
99 def shutdown(self): | |
eseidel
2015/01/08 19:30:29
This code looks unused?
hansmuller1
2015/01/08 21:31:14
It looks the result of a bad merge (mine). You rem
| |
100 print "Quitting" | |
101 if self._sky_server: | |
102 self._sky_server.terminate() | |
92 | 103 |
93 | 104 |
94 if __name__ == '__main__': | 105 if __name__ == '__main__': |
95 SkyDebugger().main() | 106 SkyDebugger().main() |
OLD | NEW |