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

Side by Side Diff: appengine/third_party/python-adb/adb/contrib/high.py

Issue 2618043002: swarming: Roll py-adb to 75477ebf4fb8b906707f35e5fb385a9203256bef (Closed)
Patch Set: Created 3 years, 11 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 | « appengine/third_party/python-adb/adb/common.py ('k') | 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 # coding=utf-8 1 # coding=utf-8
2 # Copyright 2015 Google Inc. All rights reserved. 2 # Copyright 2015 Google Inc. All rights reserved.
3 # 3 #
4 # Licensed under the Apache License, Version 2.0 (the "License"); 4 # Licensed under the Apache License, Version 2.0 (the "License");
5 # you may not use this file except in compliance with the License. 5 # you may not use this file except in compliance with the License.
6 # You may obtain a copy of the License at 6 # You may obtain a copy of the License at
7 # 7 #
8 # http://www.apache.org/licenses/LICENSE-2.0 8 # http://www.apache.org/licenses/LICENSE-2.0
9 # 9 #
10 # Unless required by applicable law or agreed to in writing, software 10 # Unless required by applicable law or agreed to in writing, software
(...skipping 284 matching lines...) Expand 10 before | Expand all | Expand 10 after
295 - on_error: callback when an internal failure occurs. 295 - on_error: callback when an internal failure occurs.
296 - as_root: if True, restarts adbd as root if possible. 296 - as_root: if True, restarts adbd as root if possible.
297 297
298 Returns one of: 298 Returns one of:
299 - list of HighDevice instances. 299 - list of HighDevice instances.
300 - None if adb is unavailable. 300 - None if adb is unavailable.
301 """ 301 """
302 with _ADB_KEYS_LOCK: 302 with _ADB_KEYS_LOCK:
303 if not _ADB_KEYS: 303 if not _ADB_KEYS:
304 return [] 304 return []
305
306 # Skip devices that don't expose a serial number.
307 device_matcher = lambda device: device.serial_number is not None
308
305 # Create unopened handles for all usb devices. 309 # Create unopened handles for all usb devices.
306 handles = list( 310 handles = list(
307 common.UsbHandle.FindDevicesSafe( 311 common.UsbHandle.FindDevicesSafe(
308 adb_commands_safe.DeviceIsAvailable, timeout_ms=default_timeout_ms)) 312 adb_commands_safe.DeviceIsAvailable, timeout_ms=default_timeout_ms,
313 device_matcher=device_matcher))
309 314
310 return _ConnectFromHandles(handles, banner=banner, 315 return _ConnectFromHandles(handles, banner=banner,
311 default_timeout_ms=default_timeout_ms, 316 default_timeout_ms=default_timeout_ms,
312 auth_timeout_ms=auth_timeout_ms, on_error=on_error, 317 auth_timeout_ms=auth_timeout_ms, on_error=on_error,
313 as_root=as_root, enable_resets=enable_resets) 318 as_root=as_root, enable_resets=enable_resets)
314 319
315 320
316 def GetRemoteDevices(banner, endpoints, default_timeout_ms, auth_timeout_ms, 321 def GetRemoteDevices(banner, endpoints, default_timeout_ms, auth_timeout_ms,
317 on_error=None, as_root=False): 322 on_error=None, as_root=False):
318 """Returns the list of devices available. 323 """Returns the list of devices available.
(...skipping 683 matching lines...) Expand 10 before | Expand all | Expand 10 after
1002 return out 1007 return out
1003 1008
1004 @classmethod 1009 @classmethod
1005 def _Connect(cls, constructor, **kwargs): 1010 def _Connect(cls, constructor, **kwargs):
1006 """Called by either ConnectDevice or Connect.""" 1011 """Called by either ConnectDevice or Connect."""
1007 if not kwargs.get('rsa_keys'): 1012 if not kwargs.get('rsa_keys'):
1008 with _ADB_KEYS_LOCK: 1013 with _ADB_KEYS_LOCK:
1009 kwargs['rsa_keys'] = _ADB_KEYS[:] 1014 kwargs['rsa_keys'] = _ADB_KEYS[:]
1010 device = constructor(**kwargs) 1015 device = constructor(**kwargs)
1011 return HighDevice(device, _InitCache(device)) 1016 return HighDevice(device, _InitCache(device))
OLDNEW
« no previous file with comments | « appengine/third_party/python-adb/adb/common.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698