OLD | NEW |
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 | 2 |
3 # Copyright 2016 The Chromium Authors. All rights reserved. | 3 # Copyright 2016 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 import argparse | 7 import argparse |
8 import sys | 8 import sys |
9 | 9 |
10 from devil.utils import battor_device_mapping | 10 from devil.utils import battor_device_mapping |
(...skipping 10 matching lines...) Expand all Loading... |
21 'mapping between phone serial numbers and BattOr serial numbers\n' | 21 'mapping between phone serial numbers and BattOr serial numbers\n' |
22 'Mapping is based on which physical ports on the USB hubs the\n' | 22 'Mapping is based on which physical ports on the USB hubs the\n' |
23 'devices are plugged in to. For instance, if there are two hubs,\n' | 23 'devices are plugged in to. For instance, if there are two hubs,\n' |
24 'the phone connected to port N on the first hub is mapped to the\n' | 24 'the phone connected to port N on the first hub is mapped to the\n' |
25 'BattOr connected to port N on the second hub, for each N.') | 25 'BattOr connected to port N on the second hub, for each N.') |
26 parser = argparse.ArgumentParser(usage=usage, description=desc) | 26 parser = argparse.ArgumentParser(usage=usage, description=desc) |
27 parser.add_argument('-o', '--output', dest='out_file', | 27 parser.add_argument('-o', '--output', dest='out_file', |
28 default='mapping.json', type=str, | 28 default='mapping.json', type=str, |
29 action='store', help='mapping file name') | 29 action='store', help='mapping file name') |
30 parser.add_argument('-u', '--hub', dest='hub_types', | 30 parser.add_argument('-u', '--hub', dest='hub_types', |
31 action='append', choices=['plugable_7port'], | 31 action='append', choices=['plugable_7port', |
| 32 'plugable_7port_usb3_part2', |
| 33 'plugable_7port_usb3_part3'], |
32 help='USB hub types.') | 34 help='USB hub types.') |
33 options = parser.parse_args() | 35 options = parser.parse_args() |
34 if not options.hub_types: | 36 if not options.hub_types: |
35 options.hub_types = ['plugable_7port'] | 37 options.hub_types = ['plugable_7port', 'plugable_7port_usb3_part2', |
| 38 'plugable_7port_usb3_part3'] |
36 return options | 39 return options |
37 | 40 |
38 def main(): | 41 def main(): |
39 options = parse_options() | 42 options = parse_options() |
40 battor_device_mapping.GenerateSerialMapFile(options.out_file, | 43 battor_device_mapping.GenerateSerialMapFile(options.out_file, |
41 options.hub_types) | 44 options.hub_types) |
42 | 45 |
43 if __name__ == "__main__": | 46 if __name__ == "__main__": |
44 sys.exit(main()) | 47 sys.exit(main()) |
OLD | NEW |