convert radiotext in c++ part to utf8
[enigma2.git] / ServiceReference.py
index c4c2f46..787c5c4 100644 (file)
@@ -5,22 +5,30 @@ import NavigationInstance
 
 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):
-               info = iStaticServiceInformationPtr()
-               if NavigationInstance.instance.ServiceHandler.info(self.ref, info):
-                       info = None
-               return info
-       
        def __str__(self):
                return self.ref.toString()
        
        def getServiceName(self):
-               info = self.getStaticServiceInformation()
-               if not info:
-                       return None
-               
-               return info.getName(self.ref)
+               info = self.info()
+               return info and info.getName(self.ref) or ""
+
+       def play(self):
+               return self.serviceHandler.info(self.ref)
+       
+       def record(self):
+               return self.serviceHandler.record(self.ref)
+       
+       def list(self):
+               return self.serviceHandler.list(self.ref)
+       
+       def info(self):
+               return self.serviceHandler.info(self.ref)
+
+       def offlineOperations(self):
+               return self.serviceHandler.offlineOperations(self.ref)