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

Side by Side Diff: build/android/pylib/cmd_helper.py

Issue 10693110: [android] Split top-level scripts and libraries from build/android. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Added __init__.py and enable_asserts.py. Created 8 years, 5 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 | Annotate | Revision Log
OLDNEW
1 #!/usr/bin/python 1 #!/usr/bin/python
2 # 2 #
3 # Copyright (c) 2012 The Chromium Authors. All rights reserved. 3 # Copyright (c) 2012 The Chromium Authors. All rights reserved.
4 # Use of this source code is governed by a BSD-style license that can be 4 # Use of this source code is governed by a BSD-style license that can be
5 # found in the LICENSE file. 5 # found in the LICENSE file.
6 6
7 """A wrapper for subprocess to make calling shell commands easier.""" 7 """A wrapper for subprocess to make calling shell commands easier."""
8 8
9 9
10 import logging 10 import logging
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 Prints the command's stderr to logger (which defaults to stdout). 43 Prints the command's stderr to logger (which defaults to stdout).
44 """ 44 """
45 logging.info(str(args) + ' ' + (cwd or '')) 45 logging.info(str(args) + ' ' + (cwd or ''))
46 p = subprocess.Popen(args=args, cwd=cwd, stdout=subprocess.PIPE, 46 p = subprocess.Popen(args=args, cwd=cwd, stdout=subprocess.PIPE,
47 stderr=subprocess.PIPE, shell=shell) 47 stderr=subprocess.PIPE, shell=shell)
48 stdout, stderr = p.communicate() 48 stdout, stderr = p.communicate()
49 if stderr: 49 if stderr:
50 logging.critical(stderr) 50 logging.critical(stderr)
51 logging.info(stdout[:4096]) # Truncate output longer than 4k. 51 logging.info(stdout[:4096]) # Truncate output longer than 4k.
52 return stdout 52 return stdout
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698