Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(139)

Side by Side Diff: sky/tools/shelldb

Issue 1200993002: Update README.md and HACKING.md and resulting yak shave. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 #!/usr/bin/env python 1 #!/usr/bin/env python
2 # Copyright 2015 The Chromium Authors. All rights reserved. 2 # Copyright 2015 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 hashlib 8 import hashlib
9 import json 9 import json
10 import logging 10 import logging
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after
167 if os.path.commonprefix([path, SRC_ROOT]) == SRC_ROOT: 167 if os.path.commonprefix([path, SRC_ROOT]) == SRC_ROOT:
168 server_root = SRC_ROOT 168 server_root = SRC_ROOT
169 else: 169 else:
170 server_root = os.path.dirname(path) 170 server_root = os.path.dirname(path)
171 logging.warn( 171 logging.warn(
172 '%s is outside of mojo root, using %s as server root' % 172 '%s is outside of mojo root, using %s as server root' %
173 (path, server_root)) 173 (path, server_root))
174 return server_root 174 return server_root
175 175
176 def _sky_server_for_args(self, args, packages_root): 176 def _sky_server_for_args(self, args, packages_root):
177 # FIXME: This is a hack. sky_server should just take a build_dir
178 # not a magical "configuration" name.
179 configuration = os.path.basename(os.path.normpath(args.build_dir))
180 server_root = self._server_root_for_url(args.url_or_path) 177 server_root = self._server_root_for_url(args.url_or_path)
181 sky_server = SkyServer(SKY_SERVER_PORT, configuration, server_root, pack ages_root) 178 sky_server = SkyServer(SKY_SERVER_PORT, server_root, packages_root)
182 return sky_server 179 return sky_server
183 180
184 def _find_remote_pid_for_package(self, package): 181 def _find_remote_pid_for_package(self, package):
185 ps_output = subprocess.check_output([ADB_PATH, 'shell', 'ps']) 182 ps_output = subprocess.check_output([ADB_PATH, 'shell', 'ps'])
186 for line in ps_output.split('\n'): 183 for line in ps_output.split('\n'):
187 fields = line.split() 184 fields = line.split()
188 if fields and fields[-1] == package: 185 if fields and fields[-1] == package:
189 return fields[1] 186 return fields[1]
190 return None 187 return None
191 188
(...skipping 324 matching lines...) Expand 10 before | Expand all | Expand 10 after
516 args = parser.parse_args() 513 args = parser.parse_args()
517 pids = Pids.read_from(PID_FILE_PATH, PID_FILE_KEYS) 514 pids = Pids.read_from(PID_FILE_PATH, PID_FILE_KEYS)
518 exit_code = args.func(args, pids) 515 exit_code = args.func(args, pids)
519 # We could do this with an at-exit handler instead? 516 # We could do this with an at-exit handler instead?
520 pids.write_to(PID_FILE_PATH) 517 pids.write_to(PID_FILE_PATH)
521 sys.exit(exit_code) 518 sys.exit(exit_code)
522 519
523 520
524 if __name__ == '__main__': 521 if __name__ == '__main__':
525 SkyShellRunner().main() 522 SkyShellRunner().main()
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698