- add missing files
[enigma2.git] / ServiceReference.py
1
2 from enigma import *
3
4 import NavigationInstance
5
6 class ServiceReference(eServiceReference):
7         def __init__(self, ref):
8                 if isinstance(ref, str):
9                         ref = eServiceReference(ref)
10                 self.ref = ref
11
12         def getStaticServiceInformation(self):
13                 info = iStaticServiceInformationPtr()
14                 if NavigationInstance.instance.ServiceHandler.info(self.ref, info):
15                         info = None
16                 return info
17         
18         def __str__(self):
19                 return self.ref.toString()
20         
21         def getServiceName(self):
22                 info = self.getStaticServiceInformation()
23                 if not info:
24                         return None
25                 
26                 return info.getName(self.ref)