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

Side by Side Diff: scripts/run_cmd.py

Issue 196793015: A little more print debugging (Closed) Base URL: https://skia.googlesource.com/buildbot.git@master
Patch Set: Created 6 years, 9 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 (c) 2014 The Chromium Authors. All rights reserved. 2 # Copyright (c) 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 6
7 """Run a command and report its results in machine-readable format.""" 7 """Run a command and report its results in machine-readable format."""
8 8
9 9
10 import collections 10 import collections
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after
165 165
166 166
167 def _launch_cmd(cmd): 167 def _launch_cmd(cmd):
168 """Launch the given command. Non-blocking. 168 """Launch the given command. Non-blocking.
169 169
170 Args: 170 Args:
171 cmd: list of strings; command to run. 171 cmd: list of strings; command to run.
172 Returns: 172 Returns:
173 subprocess.Popen instance. 173 subprocess.Popen instance.
174 """ 174 """
175 print ' '.join(cmd)
epoger 2014/03/13 17:42:45 I would be tempted to print '_launch_cmd(): %s'
175 return subprocess.Popen(cmd, shell=False, stderr=subprocess.PIPE, 176 return subprocess.Popen(cmd, shell=False, stderr=subprocess.PIPE,
176 stdout=subprocess.PIPE) 177 stdout=subprocess.PIPE)
177 178
178 179
179 def _get_result(popen): 180 def _get_result(popen):
180 """Get the results from a running process. Blocks until the process completes. 181 """Get the results from a running process. Blocks until the process completes.
181 182
182 Args: 183 Args:
183 popen: subprocess.Popen instance. 184 popen: subprocess.Popen instance.
184 Returns: 185 Returns:
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after
349 setattr(options, cmd, args) 350 setattr(options, cmd, args)
350 except IndexError: 351 except IndexError:
351 parser.print_usage() 352 parser.print_usage()
352 sys.exit(1) 353 sys.exit(1)
353 return options 354 return options
354 355
355 356
356 if '__main__' == __name__: 357 if '__main__' == __name__:
357 parsed_args = parse_args() 358 parsed_args = parse_args()
358 run(parsed_args.cmd).print_results(pretty=parsed_args.pretty) 359 run(parsed_args.cmd).print_results(pretty=parsed_args.pretty)
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