return x and x[1]
def moveToService(self,serviceref):
+ if not serviceref:
+ return
index = 0
refstr = serviceref.toString()
for x in self.list:
index += 1
def moveToEventId(self, eventId):
+ if not eventId:
+ return
index = 0
for x in self.list:
if x[1] == eventId:
self.current = 0
def selectService(self, service):
- self.current = 0
- while self.services[self.current].ref != service:
- self.current += 1
+ if not self.length:
+ self.current = -1
+ else:
+ self.current = 0
+ while self.services[self.current].ref != service:
+ self.current += 1
def nextService(self):
+ if not self.length:
+ return
if self.current+1 < self.length:
self.current += 1
else:
self.current = 0
def prevService(self):
+ if not self.length:
+ return
if self.current-1 > -1:
self.current -= 1
else:
self.current = self.length - 1
def currentService(self):
+ if not self.length:
+ return None
return self.services[self.current]
class InfoBarEPG: