| 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 | 13 from devil.utils import cmd_helper |
| 15 from devil.utils import run_tests_helper | 14 from devil.utils import run_tests_helper |
| 16 | 15 |
| 17 _INDENTATION_RE = re.compile(r'^( *)') | 16 _INDENTATION_RE = re.compile(r'^( *)') |
| 18 _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}):') |
| 19 _LSUSB_ENTRY_RE = re.compile(r'^ *([^ ]+) +([^ ]+) *([^ ].*)?$') | 18 _LSUSB_ENTRY_RE = re.compile(r'^ *([^ ]+) +([^ ]+) *([^ ].*)?$') |
| 20 _LSUSB_GROUP_RE = re.compile(r'^ *([^ ]+.*):$') | 19 _LSUSB_GROUP_RE = re.compile(r'^ *([^ ]+.*):$') |
| 21 | 20 |
| 22 _USBDEVFS_RESET = ord('U') << 8 | 20 | 21 _USBDEVFS_RESET = ord('U') << 8 | 20 |
| 23 | 22 |
| (...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 158 else: | 157 else: |
| 159 parser.error('Unable to determine target. ' | 158 parser.error('Unable to determine target. ' |
| 160 'Specify --serial or BOTH --bus and --device.') | 159 'Specify --serial or BOTH --bus and --device.') |
| 161 | 160 |
| 162 return 0 | 161 return 0 |
| 163 | 162 |
| 164 | 163 |
| 165 if __name__ == '__main__': | 164 if __name__ == '__main__': |
| 166 sys.exit(main()) | 165 sys.exit(main()) |
| 167 | 166 |
| OLD | NEW |