| OLD | NEW |
| 1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
| 2 # Copyright 2015 The Chromium Authors. All rights reserved. | 2 # Copyright 2015 The Chromium Authors. All rights reserved. |
| 3 # Use of this source code is governed by a BSD-style license that can be | 3 # Use of this source code is governed by a BSD-style license that can be |
| 4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
| 5 | 5 |
| 6 import argparse | 6 import argparse |
| 7 import fcntl | 7 import fcntl |
| 8 import logging | 8 import logging |
| 9 import re | 9 import re |
| 10 import sys | 10 import sys |
| 11 | 11 |
| 12 from devil.android import device_errors | 12 from devil.android import device_errors |
| 13 from devil.android.sdk import adb_wrapper | |
| 14 from devil.utils import cmd_helper | |
| 15 from devil.utils import lsusb | 13 from devil.utils import lsusb |
| 16 from devil.utils import run_tests_helper | 14 from devil.utils import run_tests_helper |
| 17 | 15 |
| 18 _INDENTATION_RE = re.compile(r'^( *)') | 16 _INDENTATION_RE = re.compile(r'^( *)') |
| 19 _LSUSB_BUS_DEVICE_RE = re.compile(r'^Bus (\d{3}) Device (\d{3}):') | 17 _LSUSB_BUS_DEVICE_RE = re.compile(r'^Bus (\d{3}) Device (\d{3}):') |
| 20 _LSUSB_ENTRY_RE = re.compile(r'^ *([^ ]+) +([^ ]+) *([^ ].*)?$') | 18 _LSUSB_ENTRY_RE = re.compile(r'^ *([^ ]+) +([^ ]+) *([^ ].*)?$') |
| 21 _LSUSB_GROUP_RE = re.compile(r'^ *([^ ]+.*):$') | 19 _LSUSB_GROUP_RE = re.compile(r'^ *([^ ]+.*):$') |
| 22 | 20 |
| 23 _USBDEVFS_RESET = ord('U') << 8 | 20 | 21 _USBDEVFS_RESET = ord('U') << 8 | 20 |
| 24 | 22 |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 93 else: | 91 else: |
| 94 parser.error('Unable to determine target. ' | 92 parser.error('Unable to determine target. ' |
| 95 'Specify --serial or BOTH --bus and --device.') | 93 'Specify --serial or BOTH --bus and --device.') |
| 96 | 94 |
| 97 return 0 | 95 return 0 |
| 98 | 96 |
| 99 | 97 |
| 100 if __name__ == '__main__': | 98 if __name__ == '__main__': |
| 101 sys.exit(main()) | 99 sys.exit(main()) |
| 102 | 100 |
| OLD | NEW |