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

Unified Diff: build/android/buildbot/bb_device_status_check.py

Issue 284953002: If no battery information, do not try to split. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address nits. Created 6 years, 7 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 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/buildbot/bb_device_status_check.py
diff --git a/build/android/buildbot/bb_device_status_check.py b/build/android/buildbot/bb_device_status_check.py
index 94c741fe13d739da9e949e28dd0125b290dc889e..d064633ae94aaf0ba1d2623d15e6093f1742316a 100755
--- a/build/android/buildbot/bb_device_status_check.py
+++ b/build/android/buildbot/bb_device_status_check.py
@@ -63,6 +63,12 @@ def DeviceInfo(serial, options):
return lambda_function(found[0])
return 'Unknown'
+ def _GetBatteryInfo(battery):
+ if not battery:
+ return 'No battery info.'
+ battery_info = battery.split('\n')
+ return battery_info[0] + '\n '.join(battery_info[1:])
+
ac_power = _GetData('AC powered: (\w+)', battery)
battery_level = _GetData('level: (\d+)', battery)
imei_slice = _GetData('Device ID = (\d+)',
@@ -71,7 +77,7 @@ def DeviceInfo(serial, options):
report = ['Device %s (%s)' % (serial, device_type),
' Build: %s (%s)' %
(device_build, device_adb.old_interface.GetBuildFingerprint()),
- ' %s' % '\n '.join(battery.split('\n')),
+ ' %s' % _GetBatteryInfo(battery),
' IMEI slice: %s' % imei_slice,
' Wifi IP: %s' % device_adb.old_interface.GetWifiIP(),
'']
« 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