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

Side by Side Diff: sky/tools/skydb

Issue 790793011: Make skydb start url error out nicely (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 11 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 skypy.paths 6 import skypy.paths
7 from skypy.skyserver import SkyServer 7 from skypy.skyserver import SkyServer
8 import argparse 8 import argparse
9 import json 9 import json
10 import logging 10 import logging
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after
134 134
135 def _create_paths_for_build_dir(self, build_dir): 135 def _create_paths_for_build_dir(self, build_dir):
136 # skypy.paths.Paths takes a root-relative build_dir argument. :( 136 # skypy.paths.Paths takes a root-relative build_dir argument. :(
137 abs_build_dir = os.path.abspath(build_dir) 137 abs_build_dir = os.path.abspath(build_dir)
138 root_relative_build_dir = os.path.relpath(abs_build_dir, SRC_ROOT) 138 root_relative_build_dir = os.path.relpath(abs_build_dir, SRC_ROOT)
139 return skypy.paths.Paths(root_relative_build_dir) 139 return skypy.paths.Paths(root_relative_build_dir)
140 140
141 def start_command(self, args): 141 def start_command(self, args):
142 # FIXME: Lame that we use self for a command-specific variable. 142 # FIXME: Lame that we use self for a command-specific variable.
143 self.paths = self._create_paths_for_build_dir(args.build_dir) 143 self.paths = self._create_paths_for_build_dir(args.build_dir)
144
145 self.stop_command(None) # Quit any existing process. 144 self.stop_command(None) # Quit any existing process.
146 self.pids = {} # Clear out our pid file. 145 self.pids = {} # Clear out our pid file.
147 146
147 if not os.path.exists(self.paths.mojo_shell_path):
148 print "mojo_shell not found in build_dir '%s'" % args.build_dir
149 print "Are you sure you sure that's a valid build_dir location?"
150 print "See skydb start --help for more info"
151 sys.exit(2)
152
148 # FIXME: This is probably not the right way to compute is_android 153 # FIXME: This is probably not the right way to compute is_android
149 # from the build directory? 154 # from the build directory?
150 gn_args = gn_args_from_build_dir(args.build_dir) 155 gn_args = gn_args_from_build_dir(args.build_dir)
151 is_android = 'android_sdk_version' in gn_args 156 is_android = 'android_sdk_version' in gn_args
152 157
153 sky_server = self.sky_server_for_args(args) 158 sky_server = self.sky_server_for_args(args)
154 self.pids['sky_server_pid'] = sky_server.start() 159 self.pids['sky_server_pid'] = sky_server.start()
155 self.pids['sky_server_port'] = sky_server.port 160 self.pids['sky_server_port'] = sky_server.port
156 self.pids['sky_server_root'] = sky_server.root 161 self.pids['sky_server_root'] = sky_server.root
157 162
(...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after
374 load_parser.set_defaults(func=self.load_command) 379 load_parser.set_defaults(func=self.load_command)
375 380
376 args = parser.parse_args() 381 args = parser.parse_args()
377 args.func(args) 382 args.func(args)
378 383
379 self._write_pid_file(PID_FILE_PATH, self.pids) 384 self._write_pid_file(PID_FILE_PATH, self.pids)
380 385
381 386
382 if __name__ == '__main__': 387 if __name__ == '__main__':
383 SkyDebugger().main() 388 SkyDebugger().main()
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698