20 from events import eventfnc
22 ##################### ENIGMA BASE
27 self.next_activation = None
29 def start(self, msec, singleshot = False):
30 self.next_activation = time.time() + msec / 1000.0
32 self.singleshot = singleshot
39 return "<eTimer timeout=%s next_activation=%s singleshot=%s>" % (repr(self.timeout), repr(self.next_activation), repr(self.singleshot))
44 self.next_activation += self.msec / 1000.0
48 running_timers = list(timers)
49 assert len(running_timers), "no running timers, so nothing will ever happen!"
50 running_timers.sort(key=lambda x: x.next_activation)
52 next_timer = running_timers[0]
55 delay = next_timer.next_activation - now
61 while len(running_timers) and running_timers[0].next_activation <= now:
62 running_timers[0].do()
63 running_timers = running_timers[1:]
71 def run(duration = 1000):
73 stoptimer.start(duration * 1000.0)
74 stoptimer.timeout.get().append(stop)
79 ##################### ENIGMA GUI
87 eWindowStyleManager = None
91 eWindowStyleSkinned = None
93 eListboxPythonStringContent = None
98 def getInstance(self):
104 eEPGCache.instance = self
106 def lookupEventTime(self, ref, query):
111 getBestPlayableServiceReference = None
115 self.m_event = slot()
116 self.m_record_event = slot()
119 def recordService(self, service):
120 return iRecordableService(service)
123 def stopRecordService(self, service):
127 def playService(self, service):
131 getPrevAsciiCode = None
133 class eServiceReference:
138 flagDirectory=isDirectory|mustDescent|canDescent
145 def __init__(self, ref):
153 return self.toString()
155 class iRecordableService:
156 def __init__(self, ref):
160 def prepare(self, filename, begin, end, event_id):
172 return "iRecordableService(%s)" % repr(self.ref)
178 def getInstance(self):
184 eAVSwitch.instance = self
186 def setColorFormat(self, value):
187 print "[eAVSwitch] color format set to %d" % value
189 def setAspectRatio(self, value):
190 print "[eAVSwitch] aspect ratio set to %d" % value
192 def setWSS(self, value):
193 print "[eAVSwitch] wss set to %d" % value
195 def setSlowblank(self, value):
196 print "[eAVSwitch] wss set to %d" % value
198 def setVideomode(self, value):
199 print "[eAVSwitch] wss set to %d" % value
201 def setInput(self, value):
202 print "[eAVSwitch] wss set to %d" % value
206 eDVBVolumecontrol = None
210 def getInstance(self):
216 eRFmod.instance = self
218 def setFunction(self, value):
219 print "[eRFmod] set function to %d" % value
221 def setTestmode(self, value):
222 print "[eRFmod] set testmode to %d" % value
224 def setSoundFunction(self, value):
225 print "[eRFmod] set sound function to %d" % value
227 def setSoundCarrier(self, value):
228 print "[eRFmod] set sound carrier to %d" % value
230 def setChannel(self, value):
231 print "[eRFmod] set channel to %d" % value
233 def setFinetune(self, value):
234 print "[eRFmod] set finetune to %d" % value
241 def getInstance(self):
247 eDBoxLCD.instance = self
249 def setLCDBrightness(self, value):
250 print "[eDBoxLCD] set brightness to %d" % value
252 def setLCDContrast(self, value):
253 print "[eDBoxLCD] set contrast to %d" % value
255 def setInverted(self, value):
256 print "[eDBoxLCD] set inverted to %d" % value
262 class eServiceCenter:
264 def getInstance(self):
270 eServiceCenter.instance = self
277 ##################### ENIGMA CONFIG
279 import Components.config
282 "config.skin.primary_skin=None\n"
285 Components.config.config.unpickle(my_config)
287 ##################### ENIGMA CHROOT
289 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)
298 ##################### ENIGMA ACTIONS
305 ##################### ENIGMA STARTUP:
308 import Navigation, NavigationInstance
309 NavigationInstance.instance = Navigation.Navigation()
311 def init_record_config():
312 import Components.RecordingConfig
313 Components.RecordingConfig.InitRecordingConfig()
315 def init_parental_control():
316 from Components.ParentalControl import InitParentalControl
317 InitParentalControl()
320 # this is stuff from mytest.py
324 init_parental_control()
326 import Components.InputDevice
327 Components.InputDevice.InitInputDevices()
329 import Components.AVSwitch
330 Components.AVSwitch.InitAVSwitch()
332 import Components.UsageConfig
333 Components.UsageConfig.InitUsageConfig()
335 import Components.Network
336 Components.Network.InitNetwork()
338 import Components.Lcd
339 Components.Lcd.InitLcd()
341 import Components.SetupDevices
342 Components.SetupDevices.InitSetupDevices()
344 import Components.RFmod
345 Components.RFmod.InitRFmod()
347 import Components.NimManager
350 Screens.Ci.InitCiConfig()