OLD | NEW |
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 # | 2 # |
3 # Copyright 2013 The Chromium Authors. All rights reserved. | 3 # Copyright 2013 The Chromium Authors. All rights reserved. |
4 # Use of this source code is governed by a BSD-style license that can be | 4 # Use of this source code is governed by a BSD-style license that can be |
5 # found in the LICENSE file. | 5 # found in the LICENSE file. |
6 | 6 |
7 """A class to keep track of devices across builds and report state.""" | 7 """A class to keep track of devices across builds and report state.""" |
8 import logging | 8 import logging |
9 import optparse | 9 import optparse |
10 import os | 10 import os |
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
190 server.quit() | 190 server.quit() |
191 except Exception as e: | 191 except Exception as e: |
192 print 'Failed to send alert email. Error: %s' % e | 192 print 'Failed to send alert email. Error: %s' % e |
193 | 193 |
194 | 194 |
195 def main(): | 195 def main(): |
196 parser = optparse.OptionParser() | 196 parser = optparse.OptionParser() |
197 parser.add_option('', '--out-dir', | 197 parser.add_option('', '--out-dir', |
198 help='Directory where the device path is stored', | 198 help='Directory where the device path is stored', |
199 default=os.path.join(constants.DIR_SOURCE_ROOT, 'out')) | 199 default=os.path.join(constants.DIR_SOURCE_ROOT, 'out')) |
200 parser.add_option('--no-provisioning-check', | 200 parser.add_option('--no-provisioning-check', action='store_true', |
201 help='Will not check if devices are provisioned properly.') | 201 help='Will not check if devices are provisioned properly.') |
202 parser.add_option('--device-status-dashboard', | 202 parser.add_option('--device-status-dashboard', |
203 help='Output device status data for dashboard.') | 203 help='Output device status data for dashboard.') |
204 options, args = parser.parse_args() | 204 options, args = parser.parse_args() |
205 if args: | 205 if args: |
206 parser.error('Unknown options %s' % args) | 206 parser.error('Unknown options %s' % args) |
207 devices = android_commands.GetAttachedDevices() | 207 devices = android_commands.GetAttachedDevices() |
208 # TODO(navabi): Test to make sure this fails and then fix call | 208 # TODO(navabi): Test to make sure this fails and then fix call |
209 offline_devices = android_commands.GetAttachedDevices(hardware=False, | 209 offline_devices = android_commands.GetAttachedDevices(hardware=False, |
210 emulator=False, | 210 emulator=False, |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
251 # devices with critically low battery or install speed. Remove those devices | 251 # devices with critically low battery or install speed. Remove those devices |
252 # from testing, allowing build to continue with good devices. | 252 # from testing, allowing build to continue with good devices. |
253 return 1 | 253 return 1 |
254 | 254 |
255 if not devices: | 255 if not devices: |
256 return 1 | 256 return 1 |
257 | 257 |
258 | 258 |
259 if __name__ == '__main__': | 259 if __name__ == '__main__': |
260 sys.exit(main()) | 260 sys.exit(main()) |
OLD | NEW |