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

Unified 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build/android/screenshot.py
diff --git a/build/android/screenshot.py b/build/android/screenshot.py
index fb1aee1d985aaedef0c47c22605328ff4ca969bd..74d6856efc67e5ed306a7c4776bc3e4157615dd1 100755
--- a/build/android/screenshot.py
+++ b/build/android/screenshot.py
@@ -14,6 +14,7 @@ import sys
from pylib import android_commands
from pylib import screenshot
from pylib.device import device_utils
+from pylib.device import adb_wrapper
jbudorick 2014/12/16 18:14:20 nit: either switch to adb_wrapper.AdbWrapper.GetDe
Ian Wen 2014/12/16 18:48:37 Done.
def _PrintMessage(heading, eol='\n'):
sys.stdout.write('%s%s' % (heading, eol))
@@ -69,9 +70,13 @@ def main():
if options.verbose:
logging.getLogger().setLevel(logging.DEBUG)
- if not options.device and len(android_commands.GetAttachedDevices()) > 1:
+ devices = android_commands.GetAttachedDevices()
+
+ if not options.device and len(devices) > 1:
parser.error('Multiple devices are attached. '
'Please specify device serial number with --device.')
+ elif not options.device and len(devices) == 1:
+ options.device = devices[0]
if len(args) > 1:
parser.error('Too many positional arguments.')
« 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