Advertisement
SharkyEXE

Untitled

Jun 17th, 2018
342
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.67 KB | None | 0 0
  1. def findPiconprovsat(self, service):
  2. name = self.getOrbitalPosition(service)
  3. serviceName = name.upper()
  4. searchPaths = ['/media/hdd/piconSat/', '/media/usb/piconSat/', '/usr/share/enigma2/piconSat/', '/media/sda1/piconSat/', '/media/sdb1/piconSat/']
  5. for path in searchPaths:
  6. pngname = path + serviceName + '.png'
  7. if fileExists(pngname):
  8. return pngname
  9. pngname = path + 'picon_default.png'
  10. if fileExists(pngname):
  11. return pngname
  12. pngname = resolveFilename(SCOPE_CURRENT_SKIN, 'picon_default.png')
  13. if fileExists(pngname):
  14. return pngname
  15. else:
  16. return resolveFilename(SCOPE_SKIN_IMAGE, 'skin_default/picon_default.png')
  17.  
  18. def getOrbitalPosition(self, ref):
  19. service = self.source.service
  20. if isinstance(service, iPlayableServicePtr):
  21. info = service and service.info()
  22. ref = None
  23. else: # reference
  24. info = service and self.source.info
  25. ref = service
  26. if info is None:
  27. return ""
  28. if ref:
  29. transponder_info = info.getInfoObject(ref, iServiceInformation.sTransponderData)
  30. else:
  31. transponder_info = info.getInfoObject(iServiceInformation.sTransponderData)
  32. if ref:
  33. refString = ref.toString().lower()
  34. if "%3a//" in refString:
  35. return _("Stream")
  36. if refString.startswith("1:134:"):
  37. return _("Altern")
  38. if transponder_info and "orbital_position" in transponder_info.keys():
  39. pos = int(transponder_info["orbital_position"])
  40. direction = 'E'
  41. if pos > 1800:
  42. pos = 3600 - pos
  43. direction = 'W'
  44. return "%d%d%s" % (pos/10, pos%10, direction)
  45. return "picon_default"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement