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

Unified Diff: tools/telemetry/telemetry/core/platform/linux_platform_backend.py

Issue 660893002: [Telemetry] Implement automatic installation of optional openCV dependecy. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: nits Created 6 years, 2 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
Index: tools/telemetry/telemetry/core/platform/linux_platform_backend.py
diff --git a/tools/telemetry/telemetry/core/platform/linux_platform_backend.py b/tools/telemetry/telemetry/core/platform/linux_platform_backend.py
index 54fde65707b7e81da791bab67dc4d8b1a485da6b..a61d93a1b06dc03ce40930356484d88d00465a26 100644
--- a/tools/telemetry/telemetry/core/platform/linux_platform_backend.py
+++ b/tools/telemetry/telemetry/core/platform/linux_platform_backend.py
@@ -96,6 +96,13 @@ class LinuxPlatformBackend(
raise NotImplementedError(
'Please teach Telemetry how to install ' + application)
+ def InstallPythonModule(self, module):
+ if module == 'cv2':
+ self._InstallOpenCV()
+ else:
+ raise NotImplementedError(
+ 'Please teach Telemetry how to install python module ' + module)
+
def CanMonitorPower(self):
return self._power_monitor.CanMonitorPower()
@@ -154,6 +161,12 @@ class LinuxPlatformBackend(
'You may proceed by manually building and installing dummynet for ' \
'your kernel. See: http://info.iet.unipi.it/~luigi/dummynet/'
+ def _InstallOpenCV(self):
+ # This package is installed by install-build-deps.sh, so bots should never
+ # reach this. Only those running the standalone telemetry library should
+ # hit this, unless there's a bug.
+ subprocess.check_call(['sudo', 'apt-get', '-q', 'install', 'python-opencv'])
+
def _InstallBinary(self, bin_name, fallback_package=None):
bin_path = support_binaries.FindPath(
bin_name, self.GetArchName(), self.GetOSName())

Powered by Google App Engine
This is Rietveld 408576698