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

Unified Diff: tools/skpbench/_adb_path.py

Issue 2360473002: Add hardware monitoring to skpbench (Closed)
Patch Set: Add hardware monitoring to skpbench Created 4 years, 3 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 | « tools/skpbench/_adb.py ('k') | tools/skpbench/_hardware.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/skpbench/_adb_path.py
diff --git a/tools/skpbench/_adb_path.py b/tools/skpbench/_adb_path.py
index 377ba12490f3308607c658bf6969794dea5d8686..47eb7de17eddca702792c59b03a36fb16379a5ff 100644
--- a/tools/skpbench/_adb_path.py
+++ b/tools/skpbench/_adb_path.py
@@ -3,15 +3,15 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
-import _adb
+from _adb import Adb
import re
import subprocess
-__ADB_DEVICE_SERIAL = None
+__ADB = None
-def set_device_serial(device_serial):
- global __ADB_DEVICE_SERIAL
- __ADB_DEVICE_SERIAL = device_serial
+def init(device_serial):
+ global __ADB
+ __ADB = Adb(device_serial)
def join(*pathnames):
return '/'.join(pathnames)
@@ -20,14 +20,13 @@ def basename(pathname):
return pathname.rsplit('/', maxsplit=1)[-1]
def find_skps(skps):
- escapedskps = [re.sub(r'([^a-zA-Z0-9_\*\?\[\!\]])', r'\\\1', x) # Keep globs.
+ escapedskps = [re.sub(r'([^a-zA-Z0-9_/\.\*\?\[\!\]])', r'\\\1', x)
for x in skps]
- pathnames = _adb.check('''
+ return __ADB.check_lines('''\
for PATHNAME in %s; do
if [ -d "$PATHNAME" ]; then
ls "$PATHNAME"/*.skp
else
echo "$PATHNAME"
fi
- done''' % ' '.join(escapedskps), device_serial=__ADB_DEVICE_SERIAL)
- return re.split('[\r\n]+', pathnames)
+ done''' % ' '.join(escapedskps))
« no previous file with comments | « tools/skpbench/_adb.py ('k') | tools/skpbench/_hardware.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698