1 from enigma import eTimer
2 from Converter import Converter
4 class ConditionalShowHide(Converter, object):
5 def __init__(self, argstr):
6 Converter.__init__(self, argstr)
7 args = argstr.split(',')
8 self.invert = "Invert" in args
9 self.blink = "Blink" in args
13 self.timer.callback.append(self.blinkFunc)
18 if self.blinking == True:
19 for x in self.downstream_elements:
20 x.visible = not x.visible
22 def startBlinking(self):
24 self.timer.start(self.blinktime)
26 def stopBlinking(self):
28 for x in self.downstream_elements:
33 def calcVisibility(self):
34 b = self.source.boolean
40 def changed(self, what):
41 vis = self.calcVisibility()
48 for x in self.downstream_elements:
51 def connectDownstream(self, downstream):
52 Converter.connectDownstream(self, downstream)
53 vis = self.calcVisibility()
60 downstream.visible = self.calcVisibility()
64 self.timer.callback.remove(self.blinkFunc)