Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def findPiconprovsat(self, service):
- name = self.getOrbitalPosition(service)
- serviceName = name.upper()
- searchPaths = ['/media/hdd/piconSat/', '/media/usb/piconSat/', '/usr/share/enigma2/piconSat/', '/media/sda1/piconSat/', '/media/sdb1/piconSat/']
- for path in searchPaths:
- pngname = path + serviceName + '.png'
- if fileExists(pngname):
- return pngname
- pngname = path + 'picon_default.png'
- if fileExists(pngname):
- return pngname
- pngname = resolveFilename(SCOPE_CURRENT_SKIN, 'picon_default.png')
- if fileExists(pngname):
- return pngname
- else:
- return resolveFilename(SCOPE_SKIN_IMAGE, 'skin_default/picon_default.png')
- def getOrbitalPosition(self, ref):
- service = self.source.service
- if isinstance(service, iPlayableServicePtr):
- info = service and service.info()
- ref = None
- else: # reference
- info = service and self.source.info
- ref = service
- if info is None:
- return ""
- if ref:
- transponder_info = info.getInfoObject(ref, iServiceInformation.sTransponderData)
- else:
- transponder_info = info.getInfoObject(iServiceInformation.sTransponderData)
- if ref:
- refString = ref.toString().lower()
- if "%3a//" in refString:
- return _("Stream")
- if refString.startswith("1:134:"):
- return _("Altern")
- if transponder_info and "orbital_position" in transponder_info.keys():
- pos = int(transponder_info["orbital_position"])
- direction = 'E'
- if pos > 1800:
- pos = 3600 - pos
- direction = 'W'
- return "%d%d%s" % (pos/10, pos%10, direction)
- return "picon_default"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement