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
102 def getInstance(self):
108 eEPGCache.instance = self
110 def lookupEventTime(self, ref, query):
115 getBestPlayableServiceReference = None
119 self.m_event = slot()
120 self.m_record_event = slot()
123 def recordService(self, service):
124 return iRecordableService(service)
127 def stopRecordService(self, service):
131 def playService(self, service):
138 getPrevAsciiCode = None
140 class eServiceReference:
145 flagDirectory=isDirectory|mustDescent|canDescent
152 def __init__(self, ref):
160 return self.toString()
162 class iRecordableService:
163 def __init__(self, ref):
167 def prepare(self, filename, begin, end, event_id):
179 return "iRecordableService(%s)" % repr(self.ref)
185 def getInstance(self):
191 eAVSwitch.instance = self
193 def setColorFormat(self, value):
194 print "[eAVSwitch] color format set to %d" % value
196 def setAspectRatio(self, value):
197 print "[eAVSwitch] aspect ratio set to %d" % value
199 def setWSS(self, value):
200 print "[eAVSwitch] wss set to %d" % value
202 def setSlowblank(self, value):
203 print "[eAVSwitch] wss set to %d" % value
205 def setVideomode(self, value):
206 print "[eAVSwitch] wss set to %d" % value
208 def setInput(self, value):
209 print "[eAVSwitch] wss set to %d" % value
213 eDVBVolumecontrol = None
217 def getInstance(self):
223 eRFmod.instance = self
225 def setFunction(self, value):
226 print "[eRFmod] set function to %d" % value
228 def setTestmode(self, value):
229 print "[eRFmod] set testmode to %d" % value
231 def setSoundFunction(self, value):
232 print "[eRFmod] set sound function to %d" % value
234 def setSoundCarrier(self, value):
235 print "[eRFmod] set sound carrier to %d" % value
237 def setChannel(self, value):
238 print "[eRFmod] set channel to %d" % value
240 def setFinetune(self, value):
241 print "[eRFmod] set finetune to %d" % value
248 def getInstance(self):
254 eDBoxLCD.instance = self
256 def setLCDBrightness(self, value):
257 print "[eDBoxLCD] set brightness to %d" % value
259 def setLCDContrast(self, value):
260 print "[eDBoxLCD] set contrast to %d" % value
262 def setInverted(self, value):
263 print "[eDBoxLCD] set inverted to %d" % value
269 class eServiceCenter:
271 def getInstance(self):
277 eServiceCenter.instance = self
284 ##################### ENIGMA CHROOT
286 print "import directories"
287 import Tools.Directories
292 for (x, (y, z)) in Tools.Directories.defaultPaths.items():
293 Tools.Directories.defaultPaths[x] = (chroot + y, z)
295 Tools.Directories.defaultPaths[Tools.Directories.SCOPE_SKIN] = ("../data/", Tools.Directories.PATH_DONTCREATE)
296 Tools.Directories.defaultPaths[Tools.Directories.SCOPE_CONFIG] = ("/etc/enigma2/", Tools.Directories.PATH_DONTCREATE)
298 ##################### ENIGMA CONFIG
300 print "import config"
301 import Components.config
305 "config.skin.primary_skin=None\n"
308 Components.config.config.unpickle(my_config)
310 ##################### ENIGMA ACTIONS
317 ##################### ENIGMA STARTUP:
321 import Navigation, NavigationInstance
322 NavigationInstance.instance = Navigation.Navigation()
324 def init_record_config():
325 print "init recording"
326 import Components.RecordingConfig
327 Components.RecordingConfig.InitRecordingConfig()
329 def init_parental_control():
330 print "init parental"
331 from Components.ParentalControl import InitParentalControl
332 InitParentalControl()
335 # this is stuff from mytest.py
339 init_parental_control()
341 import Components.InputDevice
342 Components.InputDevice.InitInputDevices()
344 import Components.AVSwitch
345 Components.AVSwitch.InitAVSwitch()
347 import Components.UsageConfig
348 Components.UsageConfig.InitUsageConfig()
350 import Components.Network
351 Components.Network.InitNetwork()
353 import Components.Lcd
354 Components.Lcd.InitLcd()
356 import Components.SetupDevices
357 Components.SetupDevices.InitSetupDevices()
359 import Components.RFmod
360 Components.RFmod.InitRFmod()
363 Screens.Ci.InitCiConfig()