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

Unified Diff: appengine/third_party/python-adb/adb/adb_protocol.py

Issue 2279033003: swarming: Bump python-adb to 6e66b... (Closed) Base URL: https://github.com/luci/luci-py.git@master
Patch Set: Created 4 years, 4 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
Index: appengine/third_party/python-adb/adb/adb_protocol.py
diff --git a/appengine/third_party/python-adb/adb/adb_protocol.py b/appengine/third_party/python-adb/adb/adb_protocol.py
index 5099b5ab7a1d0860a058b329c0b5a366aee830ed..7606177f007c3a1c4f301bad2db7d6a62c5adb2b 100644
--- a/appengine/third_party/python-adb/adb/adb_protocol.py
+++ b/appengine/third_party/python-adb/adb/adb_protocol.py
@@ -249,7 +249,7 @@ class _AdbConnection(object):
return i
def _Add(self, message):
- self._queue.put(message.data)
+ self._queue.put(message)
def _Close(self):
self._queue.put(StopIteration())
@@ -326,6 +326,7 @@ class _AdbConnection(object):
self._HasClosed()
return
if cmd_name == 'OKAY':
+ self._yielder._Add(message)
return
if cmd_name == 'WRTE':
try:
@@ -348,9 +349,12 @@ class _AdbConnection(object):
def Write(self, data):
self._Write('WRTE', data)
- def ReadUntil(self, _):
+ def ReadUntil(self, finish_command='WRTE'):
try:
- return 'WRTE', self._yielder.next()
+ while True:
+ message = self._yielder.next()
+ if message.header.command_name == finish_command:
+ return message
except StopIteration:
raise InvalidResponseError('Never got \'WRTE\'', '<N/A>')
@@ -465,7 +469,8 @@ class AdbConnectionManager(object):
return self.Open('%s:%s' % (service, command), timeout_ms).__iter__()
def Command(self, service, command='', timeout_ms=None):
- return ''.join(self.StreamingCommand(service, command, timeout_ms))
+ return ''.join(msg.data for msg in self.StreamingCommand(service, command,
+ timeout_ms))
def ReadAndDispatch(self, timeout_ms=None):
"""Receive a response from the device."""
« no previous file with comments | « appengine/third_party/python-adb/README.swarming ('k') | appengine/third_party/python-adb/adb/contrib/adb_commands_safe.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698