11 from Components.config import *
12 from enigma import eTimer
13 from time import localtime, strftime
18 from PushServiceBase import PushServiceBase
21 #######################################################
23 class PushService(PushServiceBase):
26 PushServiceBase.__init__(self)
32 self.timer.callback.append(self.go)
34 def start(self, state = None):
35 if self.timer.isActive():
38 # Read XML file, parse it and instantiate configured plugins
41 self.plugins = plugins
43 self.begin(self.plugins)
47 def next(self, state = None):
48 #TODO Start run in a new thread !!!!!!!!!
49 # Override statemachine
50 if state: self.state = state
52 if self.state == "Now":
56 if self.state == "Boot":
58 self.timer.startLongTimer( 10 )
60 elif self.state == "First":
62 cltime = config.pushservice.time.value
64 ltime = lotime[3]*60 + lotime[4]
65 ctime = cltime[0]*60 + cltime[1]
66 seconds = 60 * abs(ctime - ltime)
67 self.timer.startLongTimer( seconds )
69 elif self.state == "Period":
70 period = config.pushservice.period.value
72 self.timer.startLongTimer( int(period)*60*60 )
76 if self.timer.isActive():
79 self.end(self.plugins)
82 self.run(self.plugins)