To build this version for a Dreambox, you will need a recent OE (branch "opendreambox...
[enigma2.git] / ServiceReference.py
1 from enigma import eServiceReference, eServiceCenter
2
3 class ServiceReference(eServiceReference):
4         def __init__(self, ref):
5                 if not isinstance(ref, eServiceReference):
6                         self.ref = eServiceReference(ref or "")
7                 else:
8                         self.ref = ref
9                 self.serviceHandler = eServiceCenter.getInstance()
10
11         def __str__(self):
12                 return self.ref.toString()
13
14         def getServiceName(self):
15                 info = self.info()
16                 return info and info.getName(self.ref) or ""
17
18         def info(self):
19                 return self.serviceHandler.info(self.ref)
20
21         def list(self):
22                 return self.serviceHandler.list(self.ref)
23
24         def getType(self):
25                 return self.ref.type
26
27         def getPath(self):
28                 return self.ref.getPath()
29
30         def getFlags(self):
31                 return self.ref.flags
32
33         def isRecordable(self):
34                 ref = self.ref
35                 return ref.flags & eServiceReference.isGroup or (ref.type == eServiceReference.idDVB and ref.getPath() == "")