1 from Converter import Converter
2 from Components.Element import cached
3 from enigma import iServiceInformation
5 class ServiceTime(Converter, object):
10 def __init__(self, type):
11 Converter.__init__(self, type)
13 self.type = self.ENDTIME
14 elif type == "StartTime":
15 self.type = self.STARTTIME
16 elif type == "Duration":
17 self.type = self.DURATION
19 raise str("'%s' is not <StartTime|EndTime|Duration> for eEventTime converter" % type)
23 service = self.source.service
24 info = self.source.info
26 if not info or not service:
29 if self.type == self.STARTTIME:
30 return info.getInfo(service, iServiceInformation.sTimeCreate)
31 elif self.type == self.ENDTIME:
32 begin = info.getInfo(service, iServiceInformation.sTimeCreate)
33 len = info.getLength(service)
35 elif self.type == self.DURATION:
36 return info.getLength(service)
38 time = property(getTime)