use a CList for 'summaries' list for easier calling
[enigma2.git] / lib / python / Components / Sources / Clock.py
1 from Tools.Event import Event
2 from Components.Element import cached
3 from enigma import eTimer
4 import time
5
6 from Source import Source
7
8 class Clock(Source):
9         def __init__(self):
10                 Source.__init__(self)
11                 self.clock_timer = eTimer()
12                 self.clock_timer.timeout.get().append(self.poll)
13                 self.clock_timer.start(1000)
14
15         @cached
16         def getClock(self):
17                 return time.time()
18
19         time = property(getClock)
20
21         def poll(self):
22                 self.changed((self.CHANGED_POLL,))
23
24         def doSuspend(self, suspended):
25                 if suspended:
26                         self.clock_timer.stop()
27                 else:
28                         self.clock_timer.start(1000)
29                         self.poll()