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

Unified Diff: devil/devil/android/device_utils.py

Issue 1776013005: [DO NOT COMMIT] Refactor systrace to support new clock sync design (Closed) Base URL: git@github.com:catapult-project/catapult@master
Patch Set: fix categories issue Created 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | systrace/bin/systrace » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: devil/devil/android/device_utils.py
diff --git a/devil/devil/android/device_utils.py b/devil/devil/android/device_utils.py
index 57c3f81c48c30fde6e46ed56812c249cc979c660..b92a65cfab6dfb6225adc1faf8288ec5ec2b33c9 100644
--- a/devil/devil/android/device_utils.py
+++ b/devil/devil/android/device_utils.py
@@ -713,7 +713,7 @@ class DeviceUtils(object):
@decorators.WithTimeoutAndRetriesFromInstance()
def RunShellCommand(self, cmd, check_return=False, cwd=None, env=None,
as_root=False, single_line=False, large_output=False,
- timeout=None, retries=None):
+ timeout=None, retries=None, split_lines=True):
"""Run an ADB shell command.
The command to run |cmd| should be a sequence of program arguments or else
@@ -750,6 +750,7 @@ class DeviceUtils(object):
this large output will be truncated.
timeout: timeout in seconds
retries: number of retries
+ split_lines: Whether to split the output into a list of lines.
Returns:
If single_line is False, the output of the command as a list of lines,
@@ -824,9 +825,12 @@ class DeviceUtils(object):
# "su -c sh -c" allows using shell features in |cmd|
cmd = self._Su('sh -c %s' % cmd_helper.SingleQuote(cmd))
- output = handle_large_output(cmd, large_output).splitlines()
+ output = handle_large_output(cmd, large_output)
- if single_line:
+ if split_lines:
+ output = output.splitlines()
+
+ if split_lines and single_line:
if not output:
return ''
elif len(output) == 1:
« no previous file with comments | « no previous file | systrace/bin/systrace » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698