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()) |