X-Git-Url: https://git.cweiske.de/enigma2.git/blobdiff_plain/1557c715e461d5a7deb04bb008c6497441351bbe..2a8ecd871020fdd668cf5500460e5a6e7851b4b0:/lib/python/Components/Sources/EventInfo.py diff --git a/lib/python/Components/Sources/EventInfo.py b/lib/python/Components/Sources/EventInfo.py index 20e5f104..a4bc874f 100644 --- a/lib/python/Components/Sources/EventInfo.py +++ b/lib/python/Components/Sources/EventInfo.py @@ -1,9 +1,8 @@ from Components.PerServiceDisplay import PerServiceBase -from Tools.Event import Event +from Components.Element import cached from enigma import iPlayableService from Source import Source -from time import time class EventInfo(PerServiceBase, Source, object): NOW = 0 @@ -19,14 +18,12 @@ class EventInfo(PerServiceBase, Source, object): }, with_event=True) self.now_or_next = now_or_next - + + @cached def getEvent(self): - if self.cache is None: - service = self.navcore.getCurrentService() - info = service and service.info() - self.cache = (True, info and info.getEvent(self.now_or_next)) # we always store a tuple for negative caching - - return self.cache[1] + service = self.navcore.getCurrentService() + info = service and service.info() + return info and info.getEvent(self.now_or_next) event = property(getEvent)