git.cweiske.de
/
enigma2.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Path and template fixes
[enigma2.git]
/
lib
/
python
/
Components
/
Sources
/
Clock.py
diff --git
a/lib/python/Components/Sources/Clock.py
b/lib/python/Components/Sources/Clock.py
index e2d7faa7fe1c212104b2069eaf71088618c3aa5e..ba672825cd06d40c7bd3f9eacf4e54f17fa00ea8 100644
(file)
--- a/
lib/python/Components/Sources/Clock.py
+++ b/
lib/python/Components/Sources/Clock.py
@@
-1,6
+1,6
@@
-from
Tools.Event import Event
+from
Components.Element import cached
from enigma import eTimer
from enigma import eTimer
-
import t
ime
+
from time import time as getT
ime
from Source import Source
from Source import Source
@@
-8,13
+8,25
@@
class Clock(Source):
def __init__(self):
Source.__init__(self)
self.clock_timer = eTimer()
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)
self.clock_timer.start(1000)
+ @cached
def getClock(self):
def getClock(self):
- return
time.t
ime()
+ return
getT
ime()
time = property(getClock)
def poll(self):
self.changed((self.CHANGED_POLL,))
time = property(getClock)
def poll(self):
self.changed((self.CHANGED_POLL,))
+
+ def doSuspend(self, suspended):
+ if suspended:
+ self.clock_timer.stop()
+ else:
+ self.clock_timer.start(1000)
+ self.poll()
+
+ def destroy(self):
+ self.clock_timer.callback.remove(self.poll)
+ Source.destroy(self)