1 from Components.Sources.Source import Source
2 from ServiceReference import ServiceReference
3 from enigma import eServiceCenter, eServiceReference, eEPGCache
10 def __init__(self, navcore,func=NOW):
13 self.navcore = navcore
14 self.epgcache = eEPGCache.getInstance()
16 def handleCommand(self,cmd):
20 if self.func is self.TITLE:
21 func = self.searchEvent
22 elif self.func is self.SERVICE:
23 func = self.getEPGofService
27 return func(self.command)
29 def getEPGNow(self,bouqetref):
30 print "getting EPG NOW", bouqetref
31 serviceHandler = eServiceCenter.getInstance()
32 list = serviceHandler.list(eServiceReference(bouqetref))
33 services = list and list.getContent('S')
35 for service in services:
36 search.append((service,0,-1))
37 events = self.epgcache.lookupEvent(search);
43 def getEPGofService(self,cmd):
44 print "getting EPG of Service", cmd
45 events = self.epgcache.lookupEvent(['IBDTSERN',(cmd,0,-1,-1)]);
51 def searchEvent(self,cmd):
52 print "getting EPG by title",cmd
53 events = self.epgcache.search(('IBDTSERN',256,eEPGCache.PARTIAL_TITLE_SEARCH,cmd,1));
59 list = property(do_func)
60 lut = {"EventID": 0, "TimeStart": 1,"Duration": 2, "Title": 3, "Description": 4, "DescriptionExtended": 5, "ServiceReference": 6, "ServiceName": 7 }