X-Git-Url: https://git.cweiske.de/enigma2.git/blobdiff_plain/2a6cdce89409dc0275e23523c3807972a82f2cf7..3d3fb340f73559bde24e757f292632bb5208b009:/ServiceReference.py diff --git a/ServiceReference.py b/ServiceReference.py index 14ac5b29..11e28786 100644 --- a/ServiceReference.py +++ b/ServiceReference.py @@ -1,23 +1,22 @@ - -from enigma import * - -import NavigationInstance +from enigma import eServiceReference, eServiceCenter class ServiceReference(eServiceReference): def __init__(self, ref): - if isinstance(ref, str): - ref = eServiceReference(ref) - self.ref = ref + if not isinstance(ref, eServiceReference): + self.ref = eServiceReference(ref or "") + else: + self.ref = ref + self.serviceHandler = eServiceCenter.getInstance() - def getStaticServiceInformation(self): - return NavigationInstance.instance.ServiceHandler.info(self.ref) - def __str__(self): return self.ref.toString() def getServiceName(self): - info = self.getStaticServiceInformation() - if info is not None: - return None - - return info.getName(self.ref) + info = self.info() + return info and info.getName(self.ref) or "" + + def info(self): + return self.serviceHandler.info(self.ref) + + def list(self): + return self.serviceHandler.list(self.ref)