aboutsummaryrefslogtreecommitdiff
path: root/lib/python/Components/Converter/EventTime.py
diff options
context:
space:
mode:
Diffstat (limited to 'lib/python/Components/Converter/EventTime.py')
-rw-r--r--lib/python/Components/Converter/EventTime.py13
1 files changed, 3 insertions, 10 deletions
diff --git a/lib/python/Components/Converter/EventTime.py b/lib/python/Components/Converter/EventTime.py
index 4a73e0ac..955fdbcf 100644
--- a/lib/python/Components/Converter/EventTime.py
+++ b/lib/python/Components/Converter/EventTime.py
@@ -1,6 +1,7 @@
from Converter import Converter
from Poll import Poll
from time import time
+from Components.Element import cached
class EventTime(Poll, Converter, object):
STARTTIME = 0
@@ -29,12 +30,8 @@ class EventTime(Poll, Converter, object):
else:
raise str("'%s' is not <StartTime|EndTime|Remaining|Duration> for EventTime converter" % type)
+ @cached
def getTime(self):
- if self.cache is None or self.cache[0] is None:
- self.cache = (self.__getTime(), self.cache and self.cache[1])
- return self.cache[0]
-
- def __getTime(self):
assert self.type != self.PROGRESS
event = self.source.event
@@ -57,12 +54,8 @@ class EventTime(Poll, Converter, object):
else:
return (duration, None)
+ @cached
def getValue(self):
- if self.cache is None or self.cache[1] is None:
- self.cache = (self.cache and self.cache[0], self.__getValue())
- return self.cache[1]
-
- def __getValue(self):
assert self.type == self.PROGRESS
event = self.source.event