| 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 import datetime | 5 import datetime |
| 6 import logging | 6 import logging |
| 7 import os | 7 import os |
| 8 import shutil | 8 import shutil |
| 9 import tempfile | 9 import tempfile |
| 10 import threading | 10 import threading |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 83 logcat_file = os.path.join( | 83 logcat_file = os.path.join( |
| 84 self._logcat_output_dir, | 84 self._logcat_output_dir, |
| 85 '%s_%s' % (d.adb.GetDeviceSerial(), | 85 '%s_%s' % (d.adb.GetDeviceSerial(), |
| 86 datetime.datetime.utcnow().strftime('%Y%m%dT%H%M%S'))) | 86 datetime.datetime.utcnow().strftime('%Y%m%dT%H%M%S'))) |
| 87 monitor = logcat_monitor.LogcatMonitor( | 87 monitor = logcat_monitor.LogcatMonitor( |
| 88 d.adb, clear=True, output_file=logcat_file) | 88 d.adb, clear=True, output_file=logcat_file) |
| 89 self._logcat_monitors.append(monitor) | 89 self._logcat_monitors.append(monitor) |
| 90 monitor.Start() | 90 monitor.Start() |
| 91 | 91 |
| 92 @property | 92 @property |
| 93 def blacklist(self): |
| 94 return self._blacklist |
| 95 |
| 96 @property |
| 93 def concurrent_adb(self): | 97 def concurrent_adb(self): |
| 94 return self._concurrent_adb | 98 return self._concurrent_adb |
| 95 | 99 |
| 96 @property | 100 @property |
| 97 def devices(self): | 101 def devices(self): |
| 98 if not self._devices: | 102 if not self._devices: |
| 99 raise device_errors.NoDevicesError() | 103 raise device_errors.NoDevicesError() |
| 100 return self._devices | 104 return self._devices |
| 101 | 105 |
| 102 @property | 106 @property |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 134 [m.output_file for m in self._logcat_monitors]) | 138 [m.output_file for m in self._logcat_monitors]) |
| 135 shutil.rmtree(self._logcat_output_dir) | 139 shutil.rmtree(self._logcat_output_dir) |
| 136 | 140 |
| 137 def BlacklistDevice(self, device, reason='local_device_failure'): | 141 def BlacklistDevice(self, device, reason='local_device_failure'): |
| 138 device_serial = device.adb.GetDeviceSerial() | 142 device_serial = device.adb.GetDeviceSerial() |
| 139 if self._blacklist: | 143 if self._blacklist: |
| 140 self._blacklist.Extend([device_serial], reason=reason) | 144 self._blacklist.Extend([device_serial], reason=reason) |
| 141 with self._devices_lock: | 145 with self._devices_lock: |
| 142 self._devices = [d for d in self._devices if str(d) != device_serial] | 146 self._devices = [d for d in self._devices if str(d) != device_serial] |
| 143 | 147 |
| OLD | NEW |