diff options
| author | Felix Domke <tmbinc@elitedvb.net> | 2006-08-09 00:26:15 +0000 |
|---|---|---|
| committer | Felix Domke <tmbinc@elitedvb.net> | 2006-08-09 00:26:15 +0000 |
| commit | 9d3112aad388b4369a339b851aa2507a02bb2d4f (patch) | |
| tree | 744d27b53a25921978f8df8b1b1c2c836caa442c /lib/python/Components/Sources/EventInfo.py | |
| parent | ab2ae6bd08a0ef13fc7462d51fc3a9ab15509b17 (diff) | |
| download | enigma2-9d3112aad388b4369a339b851aa2507a02bb2d4f.tar.gz enigma2-9d3112aad388b4369a339b851aa2507a02bb2d4f.zip | |
fix caching
Diffstat (limited to 'lib/python/Components/Sources/EventInfo.py')
| -rw-r--r-- | lib/python/Components/Sources/EventInfo.py | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/lib/python/Components/Sources/EventInfo.py b/lib/python/Components/Sources/EventInfo.py index 20e5f104..72d5f18d 100644 --- a/lib/python/Components/Sources/EventInfo.py +++ b/lib/python/Components/Sources/EventInfo.py @@ -1,4 +1,5 @@ from Components.PerServiceDisplay import PerServiceBase +from Components.Element import cached from Tools.Event import Event from enigma import iPlayableService from Source import Source @@ -19,14 +20,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) |
