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 CHROOT
279 import Tools.Directories
283 for (x, (y, z)) in Tools.Directories.defaultPaths.items():
284 Tools.Directories.defaultPaths[x] = (chroot + y, z)
286 Tools.Directories.defaultPaths[Tools.Directories.SCOPE_SKIN] = ("../data/", Tools.Directories.PATH_DONTCREATE)
287 Tools.Directories.defaultPaths[Tools.Directories.SCOPE_CONFIG] = ("/etc/enigma2/", Tools.Directories.PATH_DONTCREATE)
289 ##################### ENIGMA CONFIG
291 import Components.config
294 "config.skin.primary_skin=None\n"
297 Components.config.config.unpickle(my_config)
299 ##################### ENIGMA ACTIONS
306 ##################### ENIGMA STARTUP:
309 import Navigation, NavigationInstance
310 NavigationInstance.instance = Navigation.Navigation()
312 def init_record_config():
313 import Components.RecordingConfig
314 Components.RecordingConfig.InitRecordingConfig()
316 def init_parental_control():
317 from Components.ParentalControl import InitParentalControl
318 InitParentalControl()
321 # this is stuff from mytest.py
325 init_parental_control()
327 import Components.InputDevice
328 Components.InputDevice.InitInputDevices()
330 import Components.AVSwitch
331 Components.AVSwitch.InitAVSwitch()
333 import Components.UsageConfig
334 Components.UsageConfig.InitUsageConfig()
336 import Components.Network
337 Components.Network.InitNetwork()
339 import Components.Lcd
340 Components.Lcd.InitLcd()
342 import Components.SetupDevices
343 Components.SetupDevices.InitSetupDevices()
345 import Components.RFmod
346 Components.RFmod.InitRFmod()
348 import Components.NimManager
351 Screens.Ci.InitCiConfig()