3 from Components.Sources.Source import Source
4 from ServiceReference import ServiceReference
11 def __init__(self, navcore,func=NOWNEXT):
14 self.navcore = navcore
15 self.epgcache = eEPGCache.getInstance()
17 def handleCommand(self,cmd):
21 if self.func is self.TITLE:
22 func = self.searchEvent
23 elif self.func is self.SERVICE:
24 func = self.getEPGofService
26 func = self.getEPGNowNext
28 return func(self.command)
30 def getEPGNowNext(self,cmd):
31 print "getting EPG NOWNEXT", cmd
32 events = self.epgcache.lookupEvent(['IBDTSERN',(cmd,0,0,-1)]);
34 return self.convert(events)
38 def getEPGofService(self,cmd):
39 print "getting EPG of Service", cmd
40 events = self.epgcache.lookupEvent(['IBDTSERN',(cmd,0,-1,-1)]);
42 return self.convert(events)
46 def searchEvent(self,cmd):
47 print "getting EPG by title",cmd
48 events = self.epgcache.search(('IBDTSERN',1024,eEPGCache.PARTIAL_TITLE_SEARCH,cmd,1));
51 return self.convert(events)
55 def convert(self,input):
56 #this is not nice, but ",',<,> and & are controlchars in xml and must be replaced
61 o.append(str(key).replace("<","<").replace(">",">").replace("&","&").replace("\"",""").replace("'","'"))
66 list = property(do_func)
67 lut = {"EventID": 0, "TimeStart": 1,"Duration": 2, "Title": 3, "Description": 4, "DescriptionExtended": 5, "ServiceReference": 6, "ServiceName": 7}