Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(14)

Side by Side Diff: devil/devil/utils/update_mapping.py

Issue 2162963002: [polymer] Merge of master into polymer10-migration (Closed) Base URL: git@github.com:catapult-project/catapult.git@polymer10-migration
Patch Set: Merge polymer10-migration int polymer10-merge Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « devil/devil/utils/find_usb_devices.py ('k') | devil/devil/utils/usb_hubs.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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())
OLDNEW
« no previous file with comments | « devil/devil/utils/find_usb_devices.py ('k') | devil/devil/utils/usb_hubs.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698