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

Unified Diff: build/android/pylib/device/adb_wrapper.py

Issue 909833002: [Android] Add IterShell command to iterate over output lines (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 10 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build/android/pylib/device/adb_wrapper.py
diff --git a/build/android/pylib/device/adb_wrapper.py b/build/android/pylib/device/adb_wrapper.py
index 7d11671212d236fcb9a4d6a7dc738775ef93d29f..de611ee0756d0f274c0b5ced827edc4a36d8e1a0 100644
--- a/build/android/pylib/device/adb_wrapper.py
+++ b/build/android/pylib/device/adb_wrapper.py
@@ -253,6 +253,20 @@ class AdbWrapper(object):
command, output, status=status, device_serial=self._device_serial)
return output
+ def IterShell(self, command, timeout):
jbudorick 2015/02/09 14:21:38 My concern here is that we don't do the same exit
perezju 2015/02/09 16:39:12 We had the same discussion regarding Logcat :) 1.
jbudorick 2015/02/09 16:39:59 Well, at least I'm consistent :)
+ """Runs a shell command and returns an iterator over its output lines.
+
+ Args:
+ command: A string with the shell command to run.
+ timeout: Timeout in seconds.
+
+ Yields:
+ The output of the command line by line.
+ """
+ args = ['shell', command]
+ return cmd_helper.IterCmdOutputLines(
+ self._BuildAdbCmd(args, self._device_serial), timeout=timeout)
+
def Ls(self, path, timeout=_DEFAULT_TIMEOUT, retries=_DEFAULT_RETRIES):
"""List the contents of a directory on the device.
« 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