cleanup eConsoleAppContainer code.. execute is now only possible to call with
[enigma2.git] / lib / python / Components / Converter / Poll.py
1 from enigma import eTimer
2
3 class Poll(object):
4         def __init__(self):
5                 self.__poll_timer = eTimer()
6                 self.__poll_timer.callback.append(self.poll)
7                 self.__interval = 1000
8                 self.__enabled = False
9
10         def __setInterval(self, interval):
11                 self.__interval = interval
12                 if self.__enabled:
13                         self.__poll_timer.start(self.__interval)
14                 else:
15                         self.__poll_timer.stop()
16         
17         def __setEnable(self, enabled):
18                 self.__enabled = enabled
19                 self.poll_interval = self.__interval
20
21         poll_interval = property(lambda self: self.__interval, __setInterval)
22         poll_enabled = property(lambda self: self.__enabled, __setEnable)
23
24         def poll(self):
25                 self.changed((self.CHANGED_POLL,))
26
27         def doSuspend(self, suspended):
28                 self.enabled = not suspended
29                 if not suspended:
30                         self.poll()
31
32         def destroy(self):
33                 self.__poll_timer.callback.remove(self.poll)