fixes for python 2.6 by Moritz Venn
[enigma2.git] / lib / python / Components / Converter / Poll.py
index 2b81e325f53ab5b8c94c94e6f7ab9585eb52c005..6db93ef5801319af6e6cd51fde726a67ee3eb2ec 100644 (file)
@@ -3,7 +3,7 @@ from enigma import eTimer
 class Poll(object):
        def __init__(self):
                self.__poll_timer = eTimer()
-               self.__poll_timer.timeout.get().append(self.poll)
+               self.__poll_timer.callback.append(self.poll)
                self.__interval = 1000
                self.__enabled = False
 
@@ -23,3 +23,11 @@ class Poll(object):
 
        def poll(self):
                self.changed((self.CHANGED_POLL,))
+
+       def doSuspend(self, suspended):
+               self.enabled = not suspended
+               if not suspended:
+                       self.poll()
+
+       def destroy(self):
+               self.__poll_timer.callback.remove(self.poll)