git.cweiske.de
/
enigma2.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fix frequently segfault on clean shutdown
[enigma2.git]
/
lib
/
python
/
Components
/
Sources
/
Boolean.py
diff --git
a/lib/python/Components/Sources/Boolean.py
b/lib/python/Components/Sources/Boolean.py
index c25b4626aafb1eb362a2b7b9c18a7dddf815f573..df7f81b2a68e50bb1b510a02d795d477db0c82fc 100644
(file)
--- a/
lib/python/Components/Sources/Boolean.py
+++ b/
lib/python/Components/Sources/Boolean.py
@@
-1,4
+1,5
@@
from Source import Source
from Source import Source
+from Components.Element import cached
from enigma import eTimer
# a small warning:
from enigma import eTimer
# a small warning:
@@
-11,11
+12,14
@@
from enigma import eTimer
class Boolean(Source, object):
def __init__(self, fixed = False, function = None, poll = 0):
Source.__init__(self)
class Boolean(Source, object):
def __init__(self, fixed = False, function = None, poll = 0):
Source.__init__(self)
+ self.function = function
+ self.fixed = fixed
if poll > 0:
self.poll_timer = eTimer()
if poll > 0:
self.poll_timer = eTimer()
- self.poll_timer.timeout.get().append(self.
changed
)
+ self.poll_timer.timeout.get().append(self.
poll
)
self.poll_timer.start(poll)
self.poll_timer.start(poll)
+ @cached
def getBoolean(self):
if self.function is not None:
return self.function()
def getBoolean(self):
if self.function is not None:
return self.function()
@@
-23,3
+27,6
@@
class Boolean(Source, object):
return self.fixed
boolean = property(getBoolean)
return self.fixed
boolean = property(getBoolean)
+
+ def poll(self):
+ self.changed((self.CHANGED_ALL,))