From 2e874fa14264bf37f17ae9b9375e26059e7f35ec Mon Sep 17 00:00:00 2001 From: Felix Domke Date: Thu, 15 Jun 2006 17:34:06 +0000 Subject: add new skin stuff --- lib/python/Components/Sources/Clock.py | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 lib/python/Components/Sources/Clock.py (limited to 'lib/python/Components/Sources/Clock.py') diff --git a/lib/python/Components/Sources/Clock.py b/lib/python/Components/Sources/Clock.py new file mode 100644 index 00000000..f840ea24 --- /dev/null +++ b/lib/python/Components/Sources/Clock.py @@ -0,0 +1,22 @@ +from Tools.Event import Event +from enigma import eTimer +import time + +from Source import Source + +class Clock(Source): + def __init__(self): + self.changed = Event(start=self.start, stop=self.stop) + self.clock_timer = eTimer() + self.clock_timer.timeout.get().append(self.changed) + + def start(self): + self.clock_timer.start(1000) + + def stop(self): + self.clock_timer.stop() + + def getClock(self): + return time.time() + + time = property(getClock) -- cgit v1.2.3