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

Side by Side Diff: build/android/screenshot.py

Issue 804963003: Put screenshot.py back to work (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years 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 | « no previous file | no next file » | 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 (c) 2012 The Chromium Authors. All rights reserved. 3 # Copyright (c) 2012 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 """Takes a screenshot or a screen video capture from an Android device.""" 7 """Takes a screenshot or a screen video capture from an Android device."""
8 8
9 import logging 9 import logging
10 import optparse 10 import optparse
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
65 parser.add_option_group(video_options) 65 parser.add_option_group(video_options)
66 66
67 (options, args) = parser.parse_args() 67 (options, args) = parser.parse_args()
68 68
69 if options.verbose: 69 if options.verbose:
70 logging.getLogger().setLevel(logging.DEBUG) 70 logging.getLogger().setLevel(logging.DEBUG)
71 71
72 if not options.device and len(android_commands.GetAttachedDevices()) > 1: 72 if not options.device and len(android_commands.GetAttachedDevices()) > 1:
73 parser.error('Multiple devices are attached. ' 73 parser.error('Multiple devices are attached. '
74 'Please specify device serial number with --device.') 74 'Please specify device serial number with --device.')
75 elif not options.device and len(android_commands.GetAttachedDevices()) == 1:
jbudorick 2014/12/16 02:18:51 Couple of problems in here: - We're no longer usi
Ian Wen 2014/12/16 18:11:52 Did a small improvement by storing it locally. How
76 options.device = android_commands.GetAttachedDevices()[0]
75 77
76 if len(args) > 1: 78 if len(args) > 1:
77 parser.error('Too many positional arguments.') 79 parser.error('Too many positional arguments.')
78 host_file = args[0] if args else options.file 80 host_file = args[0] if args else options.file
79 device = device_utils.DeviceUtils(options.device) 81 device = device_utils.DeviceUtils(options.device)
80 82
81 if options.video: 83 if options.video:
82 _CaptureVideo(device, host_file, options) 84 _CaptureVideo(device, host_file, options)
83 else: 85 else:
84 _CaptureScreenshot(device, host_file) 86 _CaptureScreenshot(device, host_file)
85 return 0 87 return 0
86 88
87 89
88 if __name__ == '__main__': 90 if __name__ == '__main__':
89 sys.exit(main()) 91 sys.exit(main())
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698