20 from events import eventfnc
22 ##################### ENIGMA BASE
27 self.next_activation = None
30 def start(self, msec, singleshot = False):
31 print "start timer", msec
32 self.next_activation = time.time() + msec / 1000.0
34 self.singleshot = singleshot
41 return "<eTimer timeout=%s next_activation=%s singleshot=%s>" % (repr(self.timeout), repr(self.next_activation), repr(self.singleshot))
46 self.next_activation += self.msec / 1000.0
50 running_timers = list(timers)
51 assert len(running_timers), "no running timers, so nothing will ever happen!"
52 running_timers.sort(key=lambda x: x.next_activation)
54 print "running:", running_timers
56 next_timer = running_timers[0]
59 delay = next_timer.next_activation - now
65 while len(running_timers) and running_timers[0].next_activation <= now:
66 running_timers[0].do()
67 running_timers = running_timers[1:]
75 def run(duration = 1000):
77 stoptimer.start(duration * 1000.0)
78 stoptimer.callback.append(stop)
83 ##################### ENIGMA GUI
91 eWindowStyleManager = None
95 eWindowStyleSkinned = None
97 eListboxPythonStringContent = None
99 eSubtitleWidget = None
103 def getInstance(self):
109 eEPGCache.instance = self
111 def lookupEventTime(self, ref, query):
116 getBestPlayableServiceReference = None
120 self.m_event = slot()
121 self.m_record_event = slot()
124 def recordService(self, service):
125 return iRecordableService(service)
128 def stopRecordService(self, service):
132 def playService(self, service):
139 getPrevAsciiCode = None
141 class eServiceReference:
146 flagDirectory=isDirectory|mustDescent|canDescent
153 def __init__(self, ref):
161 return self.toString()
163 class iRecordableService:
164 def __init__(self, ref):
168 def prepare(self, filename, begin, end, event_id):
180 return "iRecordableService(%s)" % repr(self.ref)
186 def getInstance(self):
192 eAVSwitch.instance = self
194 def setColorFormat(self, value):
195 print "[eAVSwitch] color format set to %d" % value
197 def setAspectRatio(self, value):
198 print "[eAVSwitch] aspect ratio set to %d" % value
200 def setWSS(self, value):
201 print "[eAVSwitch] wss set to %d" % value
203 def setSlowblank(self, value):
204 print "[eAVSwitch] wss set to %d" % value
206 def setVideomode(self, value):
207 print "[eAVSwitch] wss set to %d" % value
209 def setInput(self, value):
210 print "[eAVSwitch] wss set to %d" % value
214 eDVBVolumecontrol = None
218 def getInstance(self):
224 eRFmod.instance = self
226 def setFunction(self, value):
227 print "[eRFmod] set function to %d" % value
229 def setTestmode(self, value):
230 print "[eRFmod] set testmode to %d" % value
232 def setSoundFunction(self, value):
233 print "[eRFmod] set sound function to %d" % value
235 def setSoundCarrier(self, value):
236 print "[eRFmod] set sound carrier to %d" % value
238 def setChannel(self, value):
239 print "[eRFmod] set channel to %d" % value
241 def setFinetune(self, value):
242 print "[eRFmod] set finetune to %d" % value
249 def getInstance(self):
255 eDBoxLCD.instance = self
257 def setLCDBrightness(self, value):
258 print "[eDBoxLCD] set brightness to %d" % value
260 def setLCDContrast(self, value):
261 print "[eDBoxLCD] set contrast to %d" % value
263 def setInverted(self, value):
264 print "[eDBoxLCD] set inverted to %d" % value
270 class eServiceCenter:
272 def getInstance(self):
278 eServiceCenter.instance = self
285 ##################### ENIGMA CHROOT
287 print "import directories"
288 import Tools.Directories
293 for (x, (y, z)) in Tools.Directories.defaultPaths.items():
294 Tools.Directories.defaultPaths[x] = (chroot + y, z)
296 Tools.Directories.defaultPaths[Tools.Directories.SCOPE_SKIN] = ("../data/", Tools.Directories.PATH_DONTCREATE)
297 Tools.Directories.defaultPaths[Tools.Directories.SCOPE_CONFIG] = ("/etc/enigma2/", Tools.Directories.PATH_DONTCREATE)
299 ##################### ENIGMA CONFIG
301 print "import config"
302 import Components.config
306 "config.skin.primary_skin=None\n"
309 Components.config.config.unpickle(my_config)
311 ##################### ENIGMA ACTIONS
318 ##################### ENIGMA STARTUP:
322 import Navigation, NavigationInstance
323 NavigationInstance.instance = Navigation.Navigation()
325 def init_record_config():
326 print "init recording"
327 import Components.RecordingConfig
328 Components.RecordingConfig.InitRecordingConfig()
330 def init_parental_control():
331 print "init parental"
332 from Components.ParentalControl import InitParentalControl
333 InitParentalControl()
336 # this is stuff from mytest.py
340 init_parental_control()
342 import Components.InputDevice
343 Components.InputDevice.InitInputDevices()
345 import Components.AVSwitch
346 Components.AVSwitch.InitAVSwitch()
348 import Components.UsageConfig
349 Components.UsageConfig.InitUsageConfig()
351 import Components.Network
352 Components.Network.InitNetwork()
354 import Components.Lcd
355 Components.Lcd.InitLcd()
357 import Components.SetupDevices
358 Components.SetupDevices.InitSetupDevices()
360 import Components.RFmod
361 Components.RFmod.InitRFmod()
364 Screens.Ci.InitCiConfig()