| 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 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 137 else: | 137 else: |
| 138 shell_command = [self.paths.mojo_shell_path] + shell_args | 138 shell_command = [self.paths.mojo_shell_path] + shell_args |
| 139 | 139 |
| 140 return shell_command | 140 return shell_command |
| 141 | 141 |
| 142 def sky_server_for_args(self, args): | 142 def sky_server_for_args(self, args): |
| 143 # FIXME: This is a hack. sky_server should just take a build_dir | 143 # FIXME: This is a hack. sky_server should just take a build_dir |
| 144 # not a magical "configuration" name. | 144 # not a magical "configuration" name. |
| 145 configuration = os.path.basename(os.path.normpath(self.paths.build_dir)) | 145 configuration = os.path.basename(os.path.normpath(self.paths.build_dir)) |
| 146 server_root = self._server_root_for_url(args.url_or_path) | 146 server_root = self._server_root_for_url(args.url_or_path) |
| 147 sky_server = SkyServer(self.paths, SKY_SERVER_PORT, | 147 sky_server = SkyServer(SKY_SERVER_PORT, configuration, server_root) |
| 148 configuration, server_root) | |
| 149 return sky_server | 148 return sky_server |
| 150 | 149 |
| 151 def _create_paths_for_build_dir(self, build_dir): | 150 def _create_paths_for_build_dir(self, build_dir): |
| 152 # skypy.paths.Paths takes a root-relative build_dir argument. :( | 151 # skypy.paths.Paths takes a root-relative build_dir argument. :( |
| 153 abs_build_dir = os.path.abspath(build_dir) | 152 abs_build_dir = os.path.abspath(build_dir) |
| 154 root_relative_build_dir = os.path.relpath(abs_build_dir, SRC_ROOT) | 153 root_relative_build_dir = os.path.relpath(abs_build_dir, SRC_ROOT) |
| 155 return skypy.paths.Paths(root_relative_build_dir) | 154 return skypy.paths.Paths(root_relative_build_dir) |
| 156 | 155 |
| 157 def _find_remote_pid_for_package(self, package): | 156 def _find_remote_pid_for_package(self, package): |
| 158 ps_output = subprocess.check_output([ADB_PATH, 'shell', 'ps']) | 157 ps_output = subprocess.check_output([ADB_PATH, 'shell', 'ps']) |
| (...skipping 441 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 600 load_parser.set_defaults(func=self.load_command) | 599 load_parser.set_defaults(func=self.load_command) |
| 601 | 600 |
| 602 args = parser.parse_args() | 601 args = parser.parse_args() |
| 603 args.func(args) | 602 args.func(args) |
| 604 | 603 |
| 605 self._write_pid_file(PID_FILE_PATH, self.pids) | 604 self._write_pid_file(PID_FILE_PATH, self.pids) |
| 606 | 605 |
| 607 | 606 |
| 608 if __name__ == '__main__': | 607 if __name__ == '__main__': |
| 609 SkyDebugger().main() | 608 SkyDebugger().main() |
| OLD | NEW |