Aug-16-2017, 03:51 PM
Here is the code I try to improve:
When I print service.ref.ToString(), I have '4097:1:5:23'
I want to change "4097:" into "1:" without changing "service".
Something like:
I am also a bit confuse about the meaning of "service.ref" !
Thanks for help.
1 2 3 4 5 |
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 event |
I want to change "4097:" into "1:" without changing "service".
Something like:
1 2 3 4 5 6 7 8 9 |
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 event |
Thanks for help.