1 # -*- coding: utf-8 -*-
2 from Components.Converter.Converter import Converter
3 from enigma import iServiceInformation, iPlayableService
4 from Components.Element import cached
6 class ServiceName(Converter, object):
11 def __init__(self, type):
12 Converter.__init__(self, type)
13 if type == "Provider":
14 self.type = self.PROVIDER
15 elif type == "Reference":
16 self.type = self.REFERENCE
20 def getServiceInfoValue(self, info, what):
21 v = info.getInfo(what)
24 return info.getInfoString(what)
28 service = self.source.service
29 info = service and service.info()
33 if self.type == self.NAME:
34 return info.getName().replace('\xc2\x86', '').replace('\xc2\x87', '')
35 elif self.type == self.PROVIDER:
36 return self.getServiceInfoValue(info, iServiceInformation.sProvider)
37 elif self.type == self.REFERENCE:
38 return self.getServiceInfoValue(info, iServiceInformation.sServiceref)
40 text = property(getText)
42 def changed(self, what):
43 if what[0] != self.CHANGED_SPECIFIC or what[1] in [iPlayableService.evStart]:
44 Converter.changed(self, what)