1 from enigma import eTimer
2 from Converter import Converter
4 class ConditionalShowHide(Converter, object):
5 def __init__(self, argstr):
6 Converter.__init__(self, type)
7 args = argstr.split(',')
8 self.invert = "Invert" in args
9 self.blink = "Blink" in args
13 self.timer.timeout.get().append(self.blinkFunc)
16 if self.blinking == True:
17 for x in self.downstream_elements:
18 x.visible = not x.visible
20 def startBlinking(self):
22 self.timer.start(self.blinktime)
24 def stopBlinking(self):
26 for x in self.downstream_elements:
31 def calcVisibility(self):
32 b = self.source.boolean
38 def changed(self, what):
39 vis = self.calcVisibility()
46 for x in self.downstream_elements:
49 def connectDownstream(self, downstream):
50 Converter.connectDownstream(self, downstream)
51 vis = self.calcVisibility()
58 downstream.visible = self.calcVisibility()