X-Git-Url: https://git.cweiske.de/enigma2.git/blobdiff_plain/67b53c1cb06988394c35a6e965c99b72b67fe1be..1c6adfdbe104773d7a98377de6951da02ae1aac0:/lib/python/Components/Sources/Clock.py diff --git a/lib/python/Components/Sources/Clock.py b/lib/python/Components/Sources/Clock.py index 4c4b41e6..ba672825 100644 --- a/lib/python/Components/Sources/Clock.py +++ b/lib/python/Components/Sources/Clock.py @@ -1,6 +1,6 @@ from Components.Element import cached from enigma import eTimer -import time +from time import time as getTime from Source import Source @@ -8,12 +8,12 @@ class Clock(Source): def __init__(self): Source.__init__(self) self.clock_timer = eTimer() - self.clock_timer.timeout.get().append(self.poll) + self.clock_timer.callback.append(self.poll) self.clock_timer.start(1000) @cached def getClock(self): - return time.time() + return getTime() time = property(getClock) @@ -26,3 +26,7 @@ class Clock(Source): else: self.clock_timer.start(1000) self.poll() + + def destroy(self): + self.clock_timer.callback.remove(self.poll) + Source.destroy(self)