| OLD | NEW |
| 1 # Copyright 2014 The Chromium Authors. All rights reserved. | 1 # Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
| 3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
| 4 | 4 |
| 5 """Provides a variety of device interactions based on adb. | 5 """Provides a variety of device interactions based on adb. |
| 6 | 6 |
| 7 Eventually, this will be based on adb_wrapper. | 7 Eventually, this will be based on adb_wrapper. |
| 8 """ | 8 """ |
| 9 # pylint: disable=unused-argument | 9 # pylint: disable=unused-argument |
| 10 | 10 |
| (...skipping 1410 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1421 from which DeviceUtils instances can be constructed. If None, | 1421 from which DeviceUtils instances can be constructed. If None, |
| 1422 all attached devices will be used. | 1422 all attached devices will be used. |
| 1423 async: If true, returns a Parallelizer that runs operations | 1423 async: If true, returns a Parallelizer that runs operations |
| 1424 asynchronously. | 1424 asynchronously. |
| 1425 | 1425 |
| 1426 Returns: | 1426 Returns: |
| 1427 A Parallelizer operating over |devices|. | 1427 A Parallelizer operating over |devices|. |
| 1428 """ | 1428 """ |
| 1429 if not devices: | 1429 if not devices: |
| 1430 devices = adb_wrapper.AdbWrapper.GetDevices() | 1430 devices = adb_wrapper.AdbWrapper.GetDevices() |
| 1431 if not devices: |
| 1432 raise device_errors.NoDevicesError() |
| 1431 devices = [d if isinstance(d, cls) else cls(d) for d in devices] | 1433 devices = [d if isinstance(d, cls) else cls(d) for d in devices] |
| 1432 if async: | 1434 if async: |
| 1433 return parallelizer.Parallelizer(devices) | 1435 return parallelizer.Parallelizer(devices) |
| 1434 else: | 1436 else: |
| 1435 return parallelizer.SyncParallelizer(devices) | 1437 return parallelizer.SyncParallelizer(devices) |
| OLD | NEW |