def platformDetect(self): printDBG("IPTVSetupImpl.platformDetect") self.setInfo( _("Detection of the platform."), _("Plugin can be run on one of the following platforms: sh4, mipsel, i686, armv7, armv5t." )) cmdTabs = [] for platform in self.supportedPlatforms: platformtesterPath = resolveFilename( SCOPE_PLUGINS, "Extensions/IPTVPlayer/bin/%s/platformtester" % platform) try: os_chmod(platformtesterPath, 0777) except Exception: printExc() cmdTabs.append(platformtesterPath + " 2>&1 ") def _platformValidator(code, data): printDBG("IPTVSetupImpl._platformValidator") if "Test platform OK" in data: return True, False else: return False, True self.workingObj = CCmdValidator(self.platformDetectFinished, _platformValidator, cmdTabs) self.workingObj.start()
def binaryDetect(self, ret=None): printDBG("IPTVSetupImpl.binaryDetect") self.setInfoFromStepHelper('detection') self.workingObj = CCmdValidator(self.binaryDetectFinished, self.stepHelper.getDetectValidator(), self.stepHelper.getDetectCmds()) self.workingObj.start()
def binaryInstall(self, ret=None): printDBG("IPTVSetupImpl.binaryInstall") self.setInfoFromStepHelper('install') cmd = self.stepHelper.getInstallCmdBuilder()(self.stepHelper.getName(), self._binaryInstallPath, self.tmpDir) self.workingObj = CCmdValidator(self.binaryInstallFinished, self.stepHelper.getInstallValidator(), [cmd]) self.workingObj.start()
def getFFmpegVer(self): printDBG("IPTVSetupImpl.getFFmpegVer") self.setInfo(_("Detection of the ffmpeg version."), None) def _verValidator(code, data): if 0 == code: return True, False else: return False, True self.workingObj = CCmdValidator(self.getFFmpegVerFinished, _verValidator, ['ffmpeg -version']) self.workingObj.start()
def binaryDownload(self): self.setInfoFromStepHelper('download') cmdTabs = [] for server in self.resourceServers: cmd = self.stepHelper.getDownloadCmdBuilder()( self.stepHelper.getName(), self.platform, self.openSSLVersion, server, self.tmpDir) cmdTabs.append(cmd) self.workingObj = CCmdValidator(self.binaryDownloadFinished, self.stepHelper.getDownloadValidator(), cmdTabs) self.workingObj.start()
def getGstreamerVer(self): printDBG("IPTVSetupImpl.getGstreamerVer") self.setInfo(_("Detection of the gstreamer version."), None) def _verValidator(code, data): if 'GStreamer Core Library version 0.10' in data: return True, False else: return False, True self.workingObj = CCmdValidator(self.getGstreamerVerFinished, _verValidator, ['gst-launch --gst-version']) self.workingObj.start()
def getOpenssl1Ver(self): printDBG("IPTVSetupImpl.getOpenssl1Ver") self.setInfo(_("Detection of the OpenSSL 1.0.0 version."), None) def _verValidator(code, data): if '1.0.0' in data: return True, False else: return False, True verCmdTab = [] verCmdTab.append('grep OPENSSL_1.0.0 "%s"' % self.libSSLPath) self.workingObj = CCmdValidator(self.getOpenssl1Finished, _verValidator, verCmdTab) self.workingObj.start()
def getGstreamerVer(self): printDBG("IPTVSetupImpl.getGstreamerVer") self.setInfo(_("Detection of the gstreamer version."), None) def _verValidator(code, data): if 'GStreamer Core Library version ' in data: return True, False else: return False, True verCmdTab = [] if 'sh4' != self.platform: verCmdTab.append('gst-launch-1.0 --gst-version') verCmdTab.append('gst-launch --gst-version') self.workingObj = CCmdValidator(self.getGstreamerVerFinished, _verValidator, verCmdTab) self.workingObj.start()
def getOpensslVersion(self): printDBG("IPTVSetupImpl.getOpensslVersion") self.setInfo( _("Detection of the OpenSSL version."), _("OpenSSL lib is needed by wget and rtmpdump utilities.")) def _verValidator(code, data): if code == 0: return True, False else: return False, True verCmdTab = [] verCmdTab.append('openssl version -a') self.workingObj = CCmdValidator(self.getOpensslVersionFinished, _verValidator, verCmdTab) self.workingObj.start()
def getGstreamerVer(self, arg=None): printDBG( "IPTVSetupImpl.getGstreamerVer >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> [%s]" % os_getpid()) self.setInfo(_("Detection of the gstreamer version."), None) def _verValidator(code, data): if 'libgstbase-' in data: return True, False elif 'GStreamer Core Library version ' in data: return True, False else: return False, True verCmdTab = [] verCmdTab.append('cat /proc/%s/maps | grep libgst' % os_getpid()) verCmdTab.append('gst-launch-1.0 --gst-version') verCmdTab.append('gst-launch --gst-version') self.workingObj = CCmdValidator(self.getGstreamerVerFinished, _verValidator, verCmdTab) self.workingObj.start()