def _setLatestRevisionAndUrl(self): printl("->", self, "S") boxType = getBoxtype() updateXmlDict = self.getUpdateXmlDict() updateType = self.getCurrentUpdateType() for update in updateXmlDict["valerie"]["updates"]["update"]: if update["type"] == updateType and update["system"] == "stb": if update["arch"] == boxType[2] and update["subarch"] == boxType[3]: self.latestRevision = str(update["revision"].replace("rev", "r")) self.revisionUrl = str(update["url"]) printl("<-", self, "C")
def __evEOF(self): printl("", self) if self.session is not None and self.session.nav is not None: service = self.session.nav.getCurrentService() boxtype = getBoxtype() if boxtype[2] != "sh4" and service and service.seek(): service.seek().seekTo(0) else: self.session.nav.playService(eServiceReference(4097, 0, self.getStillpicture()), forceRestart=True) else: printl("ARGGHHHH!!! self.session is not None and self.session.nav is not None", self, "E")
def doSeek(self, pts): seekable = self.getSeek() print "doSeek", seekable if seekable is None: return boxtype = getBoxtype() if boxtype[2] == "sh4": tenSec = 90000 * 10 #10sec pts -= tenSec #10sec before if pts >= tenSec: seekable.seekRelative(1, pts) else: seekable.seekTo(pts)
def _setUpdateXmlDict(self): printl("->", self, "S") if isInetAvailable(): boxType = getBoxtype() self.url = config.plugins.pvmc.url.value + config.plugins.pvmc.updatexml.value installedRevision = self.getInstalledRevision() printl("Checking URL: " + str(self.url), self) try: opener = urllib2.build_opener() opener.addheaders = [('User-agent', 'urllib2_val_' + boxType[1] + '_' + boxType[2] + '_' + boxType[3] + '_' + installedRevision)] f = opener.open(self.url) html = f.read() from Plugins.Extensions.PVMC.DMC_Plugins.DMC_SyncExtras.Xml2Dict import Xml2Dict updateXml = Xml2Dict("") updateXml.parse(html) self.updateXmlDict = updateXml.get() except Exception, e: printl("""Could not download HTTP Page (%s)""" % (e), self, "E")
except Exception, ex: printl("Exception(" + str(type(ex)) + "): " + str(ex), self, "E") def load(self): printl("->", self, "S") sys.path.append(config.plugins.pvmc.pluginfolderpath.value + "prebuild") try: self.ctypes = __import__("_ctypes") except Exception, ex: printl("self.ctypes import failed", self, "E") printl("Exception(" + str(type(ex)) + "): " + str(ex), self, "E") self.ctypes = None return False libname = "libshowiframe.so.0.0.0" self.finishShowSinglePic = None boxType = getBoxtype() printl("boxType = " + str(boxType), self, "I") if boxType[0] == "Azbox": libname = "libshowiframe.az.so.0.0.0" printl("LIB_PATH=" + str(config.plugins.pvmc.pluginfolderpath.value) + libname, self, "I") self.showiframe = self.ctypes.dlopen(config.plugins.pvmc.pluginfolderpath.value + libname) try: self.showSinglePic = self.ctypes.dlsym(self.showiframe, "showSinglePic") self.finishShowSinglePic = self.ctypes.dlsym(self.showiframe, "finishShowSinglePic") except Exception, ex: printl("Exception(" + str(type(ex)) + "): " + str(ex), self, "W") printl("self.ctypes.dlsym - FAILED!!! trying next ...", self, "W") try: self.showSinglePic = self.ctypes.dlsym(self.showiframe, "_Z13showSinglePicPKc") self.finishShowSinglePic = self.ctypes.dlsym(self.showiframe, "_Z19finishShowSinglePicv") except Exception, ex2: