1 from Source import Source
2 from Components.Element import cached
3 from enigma import eTimer
6 # you can use that boolean well to express screen-private
7 # conditional expressions.
9 # however, if you think that there is ANY interest that another
10 # screen could use your expression, please put your calculation
11 # into a seperate Source, providing a "boolean"-property.
12 class Boolean(Source, object):
13 def __init__(self, fixed = False, function = None, poll = 0):
16 self.poll_timer = eTimer()
17 self.poll_timer.timeout.get().append(self.poll)
18 self.poll_timer.start(poll)
22 if self.function is not None:
23 return self.function()
27 boolean = property(getBoolean)
30 self.changed((self.CHANGED_ALL,))