Aug-16-2017, 03:51 PM
Here is the code I try to improve:
I want to change "4097:" into "1:" without changing "service".
Something like:
Thanks for help.
def getEventFromId(self, service, eventid): event = None if self.epgcache is not None and eventid is not None: event = self.epgcache.lookupEventId(service.ref, eventid) return eventWhen I print service.ref.ToString(), I have '4097:1:5:23'
I want to change "4097:" into "1:" without changing "service".
Something like:
def getEventFromId(self, service, eventid): event = None if self.epgcache is not None and eventid is not None: service2 = service mywork=str(service) if mywork.startswith("4097:"): service2= [b]??? [/b]mywork.replace("4097:","1:",1) event = self.epgcache.lookupEventId(service2.ref, eventid) return eventI am also a bit confuse about the meaning of "service.ref" !
Thanks for help.