some python import cleanups
[enigma2.git] / ServiceReference.py
1 from enigma import eServiceReference, eServiceCenter
2
3 import NavigationInstance
4
5 class ServiceReference(eServiceReference):
6         def __init__(self, ref):
7                 if not isinstance(ref, eServiceReference):
8                         self.ref = eServiceReference(ref or "")
9                 else:
10                         self.ref = ref
11                 self.serviceHandler = eServiceCenter.getInstance()
12
13         def __str__(self):
14                 return self.ref.toString()
15         
16         def getServiceName(self):
17                 info = self.info()
18                 return info and info.getName(self.ref) or ""
19
20         def info(self):
21                 return self.serviceHandler.info(self.ref)
22
23         def list(self):
24                 return self.serviceHandler.list(self.ref)