From: Felix Domke Date: Mon, 10 Jul 2006 16:21:51 +0000 (+0000) Subject: optionally call callback with event argument X-Git-Tag: 2.6.0~3201 X-Git-Url: https://git.cweiske.de/enigma2.git/commitdiff_plain/cc5126538b58123908717b37816968071d603eb5?ds=inline optionally call callback with event argument --- diff --git a/lib/python/Components/PerServiceDisplay.py b/lib/python/Components/PerServiceDisplay.py index 500538c3..a36d4a60 100644 --- a/lib/python/Components/PerServiceDisplay.py +++ b/lib/python/Components/PerServiceDisplay.py @@ -6,12 +6,13 @@ from enigma import iPlayableService from enigma import eLabel, eSlider, eTimer class PerServiceBase(object): - def __init__(self, navcore, eventmap): + def __init__(self, navcore, eventmap, with_event=False): self.eventmap = eventmap self.navcore = navcore self.navcore.event.append(self.event) self.poll_timer = eTimer() self.poll_timer.timeout.get().append(self.poll) + self.with_event = with_event # start with stopped state, so simulate that self.event(iPlayableService.evEnd) @@ -23,7 +24,10 @@ class PerServiceBase(object): # loop up if we need to handle this event if self.eventmap.has_key(ev): # call handler - self.eventmap[ev]() + if self.with_event: + self.eventmap[ev](ev) + else: + self.eventmap[ev]() def enablePolling(self, interval=60000): if interval: