git.cweiske.de
/
enigma2.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
whitespace fixup
[enigma2.git]
/
lib
/
python
/
Components
/
Converter
/
EventTime.py
diff --git
a/lib/python/Components/Converter/EventTime.py
b/lib/python/Components/Converter/EventTime.py
index 4a73e0acd05cfc501b3b1d3ddb79c2492e2c1973..955fdbcfb0544674a33e9d9f4258a14af3ea1b5a 100644
(file)
--- 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 Converter import Converter
from Poll import Poll
from time import time
+from Components.Element import cached
class EventTime(Poll, Converter, object):
STARTTIME = 0
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)
else:
raise str("'%s' is not <StartTime|EndTime|Remaining|Duration> for EventTime converter" % type)
+ @cached
def getTime(self):
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
assert self.type != self.PROGRESS
event = self.source.event
@@
-57,12
+54,8
@@
class EventTime(Poll, Converter, object):
else:
return (duration, None)
else:
return (duration, None)
+ @cached
def getValue(self):
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
assert self.type == self.PROGRESS
event = self.source.event