def readPluginList(self, directory): """enumerates plugins""" new_plugins = [] for c in os.listdir(directory): directory_category = os.path.join(directory, c) if not os.path.isdir(directory_category): continue for pluginname in os.listdir(directory_category): path = os.path.join(directory_category, pluginname) if os.path.isdir(path): profile("plugin " + pluginname) try: plugin = my_import(".".join(["Plugins", c, pluginname, "plugin"])) plugins = plugin.Plugins(path=path) except Exception, exc: print "[PluginComponent] Plugin ", c + "/" + pluginname, "failed to load:", exc # supress errors due to missing plugin.py* files (badly removed plugin) for fn in ("plugin.py", "plugin.pyc", "plugin.pyo"): if os.path.exists(os.path.join(path, fn)): self.warnings.append((c + "/" + pluginname, str(exc))) from traceback import print_exc print_exc() break else: if path.find("WebInterface") == -1: print "[PluginComponent] Plugin probably removed, but not cleanly in", path print "[PluginComponent] trying to remove:", path # allow single entry not to be a list if os.path.islink(path): rmtree(os.path.realpath(path)) os.unlink(path) else: rmtree(path) continue # allow single entry not to be a list if not isinstance(plugins, list): plugins = [plugins] for p in plugins: p.path = path p.updateIcon(path) new_plugins.append(p) keymap = os.path.join(path, "keymap.xml") if fileExists(keymap): try: keymapparser.readKeymap(keymap) except Exception, exc: print "[PluginComponent] keymap for plugin %s/%s failed to load: " % (c, pluginname), exc self.warnings.append((c + "/" + pluginname, str(exc)))
def readPluginList(self, directory): """enumerates plugins""" new_plugins = [] for c in os.listdir(directory): directory_category = os.path.join(directory, c) if not os.path.isdir(directory_category): continue for pluginname in os.listdir(directory_category): path = os.path.join(directory_category, pluginname) if os.path.isdir(path): profile('plugin '+pluginname) try: plugin = my_import('.'.join(["Plugins", c, pluginname, "plugin"])) plugins = plugin.Plugins(path=path) except Exception, exc: print "Plugin ", c + "/" + pluginname, "failed to load:", exc # supress errors due to missing plugin.py* files (badly removed plugin) for fn in ('plugin.py', 'plugin.pyc', 'plugin.pyo'): if os.path.exists(os.path.join(path, fn)): self.warnings.append( (c + "/" + pluginname, str(exc)) ) from traceback import print_exc print_exc() break else: print "Plugin probably removed, but not cleanly in", path try: os.rmdir(path) except: pass continue # allow single entry not to be a list if not isinstance(plugins, list): plugins = [ plugins ] for p in plugins: p.path = path p.updateIcon(path) new_plugins.append(p) keymap = os.path.join(path, "keymap.xml") if fileExists(keymap): try: keymapparser.readKeymap(keymap) except Exception, exc: print "keymap for plugin %s/%s failed to load: " % (c, pluginname), exc self.warnings.append( (c + "/" + pluginname, str(exc)) )
def runScreenTest(): config.misc.startCounter.value += 1 config.misc.startCounter.save() profile("readPluginList") enigma.pauseInit() plugins.readPluginList(resolveFilename(SCOPE_PLUGINS)) enigma.resumeInit() profile("Init:Session") nav = Navigation() session = Session(desktop=enigma.getDesktop(0), summary_desktop=enigma.getDesktop(1), navigation=nav) CiHandler.setSession(session) screensToRun = [ p.__call__ for p in plugins.getPlugins(PluginDescriptor.WHERE_WIZARD) ] profile("wizards") screensToRun += wizardManager.getWizards() screensToRun.append((100, InfoBar.InfoBar)) screensToRun.sort() enigma.ePythonConfigQuery.setQueryFunc(configfile.getResolvedKey) def runNextScreen(session, screensToRun, *result): if result: enigma.quitMainloop(*result) return screen = screensToRun[0][1] args = screensToRun[0][2:] if screensToRun: session.openWithCallback( boundFunction(runNextScreen, session, screensToRun[1:]), screen, *args) else: session.open(screen, *args) config.misc.epgcache_filename.addNotifier(setEPGCachePath) runNextScreen(session, screensToRun) profile("Init:VolumeControl") vol = VolumeControl(session) profile("Init:PowerKey") power = PowerKey(session) if SystemInfo["VFDSymbol"]: profile("VFDSYMBOLS") import Components.VfdSymbols Components.VfdSymbols.SymbolsCheck(session) # we need session.scart to access it from within menu.xml session.scart = AutoScartControl(session) profile("Init:Trashcan") import Tools.Trashcan Tools.Trashcan.init(session) profile("RunReactor") profile_final() runReactor() profile("wakeup") from time import strftime, localtime from Tools.StbHardware import setFPWakeuptime, setRTCtime from Screens.SleepTimerEdit import isNextWakeupTime #get currentTime nowTime = time() wakeupList = [ x for x in ((session.nav.RecordTimer.getNextRecordingTime(), 0), (session.nav.RecordTimer.getNextZapTime(isWakeup=True), 1), (plugins.getNextWakeupTime(), 2), (isNextWakeupTime(), 3)) if x[0] != -1 ] wakeupList.sort() if wakeupList: from time import strftime startTime = wakeupList[0] if (startTime[0] - nowTime) < 270: # no time to switch box back on wptime = nowTime + 30 # so switch back on in 30 seconds else: if brand == "gigablue": wptime = startTime[ 0] - 120 # GigaBlue already starts 2 min. before wakeup time else: wptime = startTime[0] - 240 if not config.misc.SyncTimeUsing.value == "0" or brand == "gigablue": print( "[mytest] dvb time sync disabled... so set RTC now to current linux time!", strftime("%Y/%m/%d %H:%M", localtime(nowTime))) setRTCtime(nowTime) print("[mytest] set wakeup time to", strftime("%Y/%m/%d %H:%M", localtime(wptime))) setFPWakeuptime(wptime) config.misc.prev_wakeup_time.value = int(startTime[0]) config.misc.prev_wakeup_time_type.value = startTime[1] config.misc.prev_wakeup_time_type.save() else: config.misc.prev_wakeup_time.value = 0 # if not model.startswith('azboxm'): # skip for AZBox (mini)me - setting wakeup time to past reboots box # setFPWakeuptime(int(nowTime) - 3600) # minus one hour -> overwrite old wakeup time config.misc.prev_wakeup_time.save() profile("stopService") session.nav.stopService() profile("nav shutdown") session.nav.shutdown() profile("configfile.save") configfile.save() from Screens import InfoBarGenerics InfoBarGenerics.saveResumePoints() return 0
from Tools.Profile import profile from Screen import Screen from Components.Button import Button #+++> TDT from Components.Label import Label #<+++ TDT from Components.ServiceList import ServiceList from Components.ActionMap import NumberActionMap, ActionMap, HelpableActionMap from Components.MenuList import MenuList from Components.ServiceEventTracker import ServiceEventTracker, InfoBarBase profile("ChannelSelection.py 1") from EpgSelection import EPGSelection from enigma import eServiceReference, eEPGCache, eServiceCenter, eRCInput, eTimer, eDVBDB, iPlayableService, iServiceInformation, getPrevAsciiCode from Components.config import config, ConfigSubsection, ConfigText from Tools.NumericalTextInput import NumericalTextInput profile("ChannelSelection.py 2") from Components.NimManager import nimmanager profile("ChannelSelection.py 2.1") from Components.Sources.RdsDecoder import RdsDecoder profile("ChannelSelection.py 2.2") from Components.Sources.ServiceEvent import ServiceEvent profile("ChannelSelection.py 2.3") from Components.Input import Input profile("ChannelSelection.py 3") from Components.ParentalControl import parentalControl from Screens.InputBox import InputBox, PinInput from Screens.MessageBox import MessageBox from Screens.ServiceInfo import ServiceInfo profile("ChannelSelection.py 4") from Screens.RdsDisplay import RassInteractive
def loadBasePlugins(self, directory): new_plugins = [] for c in os.listdir(directory): directory_category = os.path.join(directory, c) if not os.path.isdir(directory_category): continue for pluginname in os.listdir(directory_category): path = os.path.join(directory_category, pluginname) if pluginname.endswith('Wizard') or pluginname in ('EGAMIPluginSpeedUp', 'OpenWebif', 'WeatherPlugin', 'WeatherComponentHandler', 'EGAMIPermanentClock', 'NumberZapExt', 'CamdMenager', 'EGAMIBoot'): if os.path.isdir(path): profile('plugin ' + pluginname) try: plugin = my_import('.'.join(['Plugins', c, pluginname, 'plugin'])) plugins = plugin.Plugins(path=path) except Exception as exc: print '[PluginComponent] Plugin ', c + '/' + pluginname, 'failed to load:', exc for fn in ('plugin.py', 'plugin.pyc', 'plugin.pyo'): if os.path.exists(os.path.join(path, fn)): self.warnings.append((c + '/' + pluginname, str(exc))) from traceback import print_exc print_exc() break else: if path.find('WebInterface') == -1: print '[PluginComponent] Plugin probably removed, but not cleanly in', path print '[PluginComponent] trying to remove:', path rmtree(path) continue if not isinstance(plugins, list): plugins = [plugins] for p in plugins: p.path = path p.updateIcon(path) new_plugins.append(p) keymap = os.path.join(path, 'keymap.xml') if fileExists(keymap): try: keymapparser.readKeymap(keymap) except Exception as exc: print '[PluginComponent] keymap for plugin %s/%s failed to load: ' % (c, pluginname), exc self.warnings.append((c + '/' + pluginname, str(exc))) plugins_added = [ p for p in new_plugins if p not in self.pluginList ] plugins_removed = [ p for p in self.pluginList if not p.internal and p not in new_plugins ] for p in plugins_removed: for pa in plugins_added: if pa.path == p.path and pa.where == p.where: pa.needsRestart = False for p in plugins_removed: self.removePlugin(p) for p in plugins_added: if self.firstRun or p.needsRestart is False: self.addPlugin(p) else: for installed_plugin in self.installedPluginList: if installed_plugin.path == p.path: if installed_plugin.where == p.where: p.needsRestart = False self.addPlugin(p) if self.firstRun: self.firstRun = False self.installedPluginList = self.pluginList
def runScreenTest(): config.misc.startCounter.value += 1 profile("readPluginList") plugins.readPluginList(resolveFilename(SCOPE_PLUGINS)) profile("Init:Session") nav = Navigation(config.misc.isNextRecordTimerAfterEventActionAuto.value) session = Session(desktop = getDesktop(0), summary_desktop = getDesktop(1), navigation = nav) CiHandler.setSession(session) screensToRun = [ p.__call__ for p in plugins.getPlugins(PluginDescriptor.WHERE_WIZARD) ] profile("wizards") screensToRun += wizardManager.getWizards() screensToRun.append((100, Screens.InfoBar.InfoBar)) screensToRun.sort() ePythonConfigQuery.setQueryFunc(configfile.getResolvedKey) # eDVBCIInterfaces.getInstance().setDescrambleRules(0 # Slot Number # ,( ["1:0:1:24:4:85:C00000:0:0:0:"], #service_list # ["PREMIERE"], #provider_list, # [] #caid_list # )); def runNextScreen(session, screensToRun, *result): if result: quitMainloop(*result) return screen = screensToRun[0][1] args = screensToRun[0][2:] if screensToRun: session.openWithCallback(boundFunction(runNextScreen, session, screensToRun[1:]), screen, *args) else: session.open(screen, *args) config.misc.epgcache_filename.addNotifier(setEPGCachePath) runNextScreen(session, screensToRun) profile("Init:VolumeControl") vol = VolumeControl(session) profile("Init:PowerKey") power = PowerKey(session) # we need session.scart to access it from within menu.xml session.scart = AutoScartControl(session) profile("RunReactor") profile_final() runReactor() config.misc.startCounter.save() profile("wakeup") from time import time, strftime, localtime from Tools.DreamboxHardware import setFPWakeuptime, getFPWakeuptime, setRTCtime #get currentTime nowTime = time() wakeupList = [ x for x in ((session.nav.RecordTimer.getNextRecordingTime(), 0, session.nav.RecordTimer.isNextRecordAfterEventActionAuto()), (session.nav.RecordTimer.getNextZapTime(), 1), (plugins.getNextWakeupTime(), 2)) if x[0] != -1 ] wakeupList.sort() recordTimerWakeupAuto = False if wakeupList: from time import strftime startTime = wakeupList[0] if (startTime[0] - nowTime) < 270: # no time to switch box back on wptime = nowTime + 30 # so switch back on in 30 seconds else: wptime = startTime[0] - 240 if not config.misc.useTransponderTime.value: print "dvb time sync disabled... so set RTC now to current linux time!", strftime("%Y/%m/%d %H:%M", localtime(nowTime)) setRTCtime(nowTime) print "set wakeup time to", strftime("%Y/%m/%d %H:%M", localtime(wptime)) setFPWakeuptime(wptime) recordTimerWakeupAuto = startTime[1] == 0 and startTime[2] config.misc.isNextRecordTimerAfterEventActionAuto.value = recordTimerWakeupAuto config.misc.isNextRecordTimerAfterEventActionAuto.save() profile("stopService") session.nav.stopService() profile("nav shutdown") session.nav.shutdown() profile("configfile.save") configfile.save() return 0
def runScreenTest(): config.misc.startCounter.value += 1 config.misc.startCounter.save() profile("readPluginList") enigma.pauseInit() plugins.readPluginList(resolveFilename(SCOPE_PLUGINS)) enigma.resumeInit() profile("Init:Session") nav = Navigation(config.misc.isNextRecordTimerAfterEventActionAuto.getValue()) session = Session(desktop = enigma.getDesktop(0), summary_desktop = enigma.getDesktop(1), navigation = nav) CiHandler.setSession(session) screensToRun = [ p.__call__ for p in plugins.getPlugins(PluginDescriptor.WHERE_WIZARD) ] profile("wizards") screensToRun += wizardManager.getWizards() screensToRun.append((100, InfoBar.InfoBar)) screensToRun.sort() enigma.ePythonConfigQuery.setQueryFunc(configfile.getResolvedKey) def runNextScreen(session, screensToRun, *result): if result: enigma.quitMainloop(*result) return screen = screensToRun[0][1] args = screensToRun[0][2:] if screensToRun: session.openWithCallback(boundFunction(runNextScreen, session, screensToRun[1:]), screen, *args) else: session.open(screen, *args) config.misc.epgcache_filename.addNotifier(setEPGCachePath) runNextScreen(session, screensToRun) profile("Init:VolumeControl") vol = VolumeControl(session) profile("Init:PowerKey") power = PowerKey(session) if getBoxType() in ('spycat', ): profile("VFDSYMBOLS") import Components.VfdSymbols Components.VfdSymbols.SymbolsCheck(session) # we need session.scart to access it from within menu.xml session.scart = AutoScartControl(session) profile("Init:Trashcan") import Tools.Trashcan Tools.Trashcan.init(session) profile("RunReactor") profile_final() runReactor() profile("wakeup") try: from Plugins.SystemPlugins.VFDControl.plugin import SetTime SetTime() except: print"[mytest] Failed SetTime from VFDControl !!" from time import time, strftime, localtime from Tools.StbHardware import setFPWakeuptime, setRTCtime from Screens.SleepTimerEdit import isNextWakeupTime #get currentTime nowTime = time() wakeupList = [ x for x in ((session.nav.RecordTimer.getNextRecordingTime(), 0, session.nav.RecordTimer.isNextRecordAfterEventActionAuto()), (session.nav.RecordTimer.getNextZapTime(), 1), (plugins.getNextWakeupTime(), 2), (isNextWakeupTime(), 3)) if x[0] != -1 ] wakeupList.sort() recordTimerWakeupAuto = False if wakeupList: from time import strftime, altzone, timezone startTime = wakeupList[0] if (startTime[0] - nowTime) < 270: # no time to switch box back on wptime = nowTime + 30 # so switch back on in 30 seconds else: wptime = startTime[0] - 120 if not config.misc.useTransponderTime.value: print "[mytest] dvb time sync disabled... so set RTC now to current linux time!", strftime("%Y/%m/%d %H:%M", localtime(nowTime)) setRTCtime(nowTime) print "[mytest] set wakeup time to", strftime("%Y/%m/%d %H:%M", localtime(wptime)) setFPWakeuptime(wptime) recordTimerWakeupAuto = startTime[1] == 0 and startTime[2] print '[mytest] recordTimerWakeupAuto',recordTimerWakeupAuto config.misc.prev_wakeup_time.value = startTime[0] config.misc.prev_wakeup_time_type.value = startTime[1] config.misc.prev_wakeup_time_type.save() else: config.misc.prev_wakeup_time.value = 0 config.misc.prev_wakeup_time.save() config.misc.isNextRecordTimerAfterEventActionAuto.value = recordTimerWakeupAuto config.misc.isNextRecordTimerAfterEventActionAuto.save() profile("stopService") session.nav.stopService() profile("nav shutdown") session.nav.shutdown() profile("configfile.save") configfile.save() from Screens import InfoBarGenerics InfoBarGenerics.saveResumePoints() return 0
from Tools.Profile import profile from Tools.BoundFunction import boundFunction from enigma import eServiceReference # workaround for required config entry dependencies. import Screens.MovieSelection from Screen import Screen from Screens.MessageBox import MessageBox profile("LOAD:enigma") import enigma profile("LOAD:InfoBarGenerics") from Screens.InfoBarGenerics import InfoBarShowHide, \ InfoBarNumberZap, InfoBarChannelSelection, InfoBarMenu, InfoBarRdsDecoder, \ InfoBarEPG, InfoBarSeek, InfoBarInstantRecord, InfoBarRedButton, InfoBarTimerButton, InfoBarVmodeButton, \ InfoBarAudioSelection, InfoBarAdditionalInfo, InfoBarNotifications, InfoBarDish, InfoBarUnhandledKey, \ InfoBarSubserviceSelection, InfoBarShowMovies, InfoBarTimeshift, \ InfoBarServiceNotifications, InfoBarPVRState, InfoBarCueSheetSupport, InfoBarBuffer, \ InfoBarSummarySupport, InfoBarMoviePlayerSummarySupport, InfoBarTimeshiftState, InfoBarTeletextPlugin, InfoBarExtensions, \ InfoBarSubtitleSupport, InfoBarPiP, InfoBarPlugins, InfoBarServiceErrorPopupSupport, InfoBarJobman, InfoBarPowersaver, \ InfoBarHDMI, setResumePoint, delResumePoint from Screens.Hotkey import InfoBarHotkey profile("LOAD:InitBar_Components") from Components.ActionMap import HelpableActionMap from Components.config import config from Components.ServiceEventTracker import ServiceEventTracker, InfoBarBase profile("LOAD:HelpableScreen")
def runScreenTest(): config.misc.startCounter.value += 1 profile("readPluginList") plugins.readPluginList(resolveFilename(SCOPE_PLUGINS)) profile("Init:Session") nav = Navigation(config.misc.nextWakeup.value) session = Session(desktop = enigma.getDesktop(0), summary_desktop = enigma.getDesktop(1), navigation = nav) CiHandler.setSession(session) screensToRun = [ p.__call__ for p in plugins.getPlugins(PluginDescriptor.WHERE_WIZARD) ] profile("wizards") screensToRun += wizardManager.getWizards() screensToRun.append((100, InfoBar.InfoBar)) screensToRun.sort() enigma.ePythonConfigQuery.setQueryFunc(configfile.getResolvedKey) def runNextScreen(session, screensToRun, *result): if result: enigma.quitMainloop(*result) return screen = screensToRun[0][1] args = screensToRun[0][2:] if screensToRun: session.openWithCallback(boundFunction(runNextScreen, session, screensToRun[1:]), screen, *args) else: session.open(screen, *args) runNextScreen(session, screensToRun) profile("Init:VolumeControl") vol = VolumeControl(session) profile("Init:PowerKey") power = PowerKey(session) if boxtype in ('odinm9', 'et7500', 'ventonhdx', 'maram9', 'ixussone', 'ixussone'): profile("VFDSYMBOLS") import Components.VfdSymbols Components.VfdSymbols.SymbolsCheck(session) # we need session.scart to access it from within menu.xml session.scart = AutoScartControl(session) profile("Init:Trashcan") import Tools.Trashcan Tools.Trashcan.init(session) profile("Init:AutoVideoMode") import Screens.VideoMode Screens.VideoMode.autostart(session) profile("RunReactor") profile_final() if boxtype in ('sf8', 'classm', 'axodin', 'axodinc', 'starsatlx', 'odinm7', 'odinm6', 'xp1000s'): f = open("/dev/dbox/oled0", "w") f.write('-E2-') f.close() print "lastshutdown=%s (True = last shutdown was OK)" % config.usage.shutdownOK.value print "NOK shutdown action=%s" % config.usage.shutdownNOK_action.value print "bootup action=%s" % config.usage.boot_action.value if not config.usage.shutdownOK.value and not config.usage.shutdownNOK_action.value == 'normal' or not config.usage.boot_action.value == 'normal': print "last shutdown = %s" % config.usage.shutdownOK.value import Screens.PowerLost Screens.PowerLost.PowerLost(session) config.usage.shutdownOK.setValue(False) config.usage.shutdownOK.save() configfile.save() runReactor() print "[mytest.py] normal shutdown" config.misc.startCounter.save() config.usage.shutdownOK.setValue(True) config.usage.shutdownOK.save() profile("wakeup") from time import time, strftime, localtime from Tools.StbHardware import setFPWakeuptime, getFPWakeuptime, setRTCtime #get currentTime nowTime = time() # if not config.misc.SyncTimeUsing.value == "0" or getBrandOEM() == 'gigablue': if not config.misc.SyncTimeUsing.value == "0" or boxtype.startswith('gb') or getBrandOEM().startswith('ini'): print "dvb time sync disabled... so set RTC now to current linux time!", strftime("%Y/%m/%d %H:%M", localtime(nowTime)) setRTCtime(nowTime) #recordtimer if session.nav.isRecordTimerImageStandard: #check RecordTimer instance tmp = session.nav.RecordTimer.getNextRecordingTime(getNextStbPowerOn = True) nextRecordTime = tmp[0] nextRecordTimeInStandby = tmp[1] else: nextRecordTime = session.nav.RecordTimer.getNextRecordingTime() nextRecordTimeInStandby = session.nav.RecordTimer.isNextRecordAfterEventActionAuto() #zaptimer nextZapTime = session.nav.RecordTimer.getNextZapTime() nextZapTimeInStandby = 0 #powertimer tmp = session.nav.PowerTimer.getNextPowerManagerTime(getNextStbPowerOn = True) nextPowerTime = tmp[0] nextPowerTimeInStandby = tmp[1] #plugintimer nextPluginTime = plugins.getNextWakeupTime() nextPluginTimeInStandby = 1 wakeupList = [ x for x in ((nextRecordTime, 0, nextRecordTimeInStandby), (nextZapTime, 1, nextZapTimeInStandby), (nextPowerTime, 2, nextPowerTimeInStandby), (nextPluginTime, 3, nextPluginTimeInStandby)) #if x[0] != -1 and x[0] >= nowTime - 60 #no startTime[0] in the past (e.g. vps-plugin -> if current time between 'recordtimer begin - vps initial time' is startTime in the past ...) if x[0] != -1 ] wakeupList.sort() # individual wakeup time offset if config.workaround.wakeuptimeoffset.value == "standard": if boxtype.startswith("gb"): wpoffset = -120 # Gigaboxes already starts 2 min. before wakeup time else: wpoffset = 0 else: wpoffset = int(config.workaround.wakeuptimeoffset.value) config.misc.nextWakeup.value = "-1,-1,0,0,-1,0" if wakeupList and wakeupList[0][0] > 0: startTime = wakeupList[0] # wakeup time is 5 min before timer starts + offset wptime = startTime[0] - 300 - wpoffset if (wptime - nowTime) < 120: # no time to switch box back on wptime = int(nowTime) + 120 # so switch back on in 120 seconds forceNextRecord = 0 if startTime[1] != 0 and nextRecordTime > 0: #check for plugin-, zap- or power-timer to enable the forced record-timer wakeup - when next record starts in 15 mins if abs(nextRecordTime - startTime[0]) <= 900: forceNextRecord = 1 else: #check for vps-plugin to enable the record-timer wakeup try: if config.plugins.vps.allow_wakeup.value: if startTime[0] + config.plugins.vps.initial_time.value * 60 == nextRecordTime \ or startTime[0] - 20 + config.plugins.vps.initial_time.value * 60 == nextRecordTime: #vps using begin time, not start prepare time forceNextRecord = 1 except: pass setStandby = startTime[2] print "="*100 print "[mytest.py] set next wakeup type to '%s' %s" % ({0:"record-timer",1:"zap-timer",2:"power-timer",3:"plugin-timer"}[startTime[1]],{0:"and starts normal",1:"and starts in standby"}[setStandby]) if forceNextRecord: print "[mytest.py] timer is set from 'vps-plugin' or just before a 'record-timer' starts, set 'record-timer' wakeup flag" print "[mytest.py] set next wakeup time to", strftime("%a, %Y/%m/%d %H:%M:%S", localtime(wptime)) #set next wakeup setFPWakeuptime(wptime) #set next standby only after shutdown in deep standby #print Screens.Standby.quitMainloopCode if Screens.Standby.quitMainloopCode != 1: setStandby = 2 # 0=no standby, but get in standby if wakeup to timer start > 60 sec, 1=standby, 2=no standby, when before was not in deep-standby config.misc.nextWakeup.value = "%d,%d,%d,%d,%d,%d" % (wptime,startTime[0],startTime[1],setStandby,nextRecordTime,forceNextRecord) else: print "[mytest.py] no set next wakeup time" print "="*100 config.misc.nextWakeup.save() profile("stopService") session.nav.stopService() profile("nav shutdown") session.nav.shutdown() profile("configfile.save") configfile.save() from Screens import InfoBarGenerics InfoBarGenerics.saveResumePoints() return 0
def readPluginList(self, directory): """enumerates plugins""" new_plugins = [] for c in os.listdir(directory): directory_category = os.path.join(directory, c) if not os.path.isdir(directory_category): continue for pluginname in os.listdir(directory_category): if pluginname == "__pycache__" or pluginname == "WebInterface": continue path = os.path.join(directory_category, pluginname) if os.path.isdir(path): profile('plugin ' + pluginname) try: plugin = my_import('.'.join( ["Plugins", c, pluginname, "plugin"])) plugins = plugin.Plugins(path=path) except Exception as exc: print("[PluginComponent] Plugin ", c + "/" + pluginname, "failed to load:", exc) # supress errors due to missing plugin.py* files (badly removed plugin) for fn in ('plugin.py'): if os.path.exists(os.path.join(path, fn)): self.warnings.append( (c + "/" + pluginname, str(exc))) from traceback import print_exc print_exc() break else: print( "[PluginComponent] Plugin probably removed, but not cleanly in", path) try: os.rmdir(path) except: pass continue # allow single entry not to be a list if not isinstance(plugins, list): plugins = [plugins] for p in plugins: p.path = path p.updateIcon(path) new_plugins.append(p) keymap = os.path.join(path, "keymap.xml") if fileExists(keymap): try: keymapparser.readKeymap(keymap) except Exception as exc: print( "[PluginComponent] keymap for plugin %s/%s failed to load: " % (c, pluginname), exc) self.warnings.append( (c + "/" + pluginname, str(exc))) # build a diff between the old list of plugins and the new one # internally, the "fnc" argument will be compared with __eq__ plugins_added = [p for p in new_plugins if p not in self.pluginList] plugins_removed = [ p for p in self.pluginList if not p.internal and p not in new_plugins ] #ignore already installed but reloaded plugins for p in plugins_removed: for pa in plugins_added: if pa.path == p.path and pa.where == p.where: pa.needsRestart = False for p in plugins_removed: self.removePlugin(p) for p in plugins_added: if self.firstRun or p.needsRestart is False: self.addPlugin(p) else: for installed_plugin in self.installedPluginList: if installed_plugin.path == p.path: if installed_plugin.where == p.where: p.needsRestart = False self.addPlugin(p) if self.firstRun: self.firstRun = False self.installedPluginList = self.pluginList
def runScreenTest(): config.misc.startCounter.value += 1 profile("readPluginList") plugins.readPluginList(resolveFilename(SCOPE_PLUGINS)) profile("Init:Session") nav = Navigation(config.misc.nextWakeup.value) session = Session(desktop=enigma.getDesktop(0), summary_desktop=enigma.getDesktop(1), navigation=nav) CiHandler.setSession(session) profile("wizards") screensToRun = [] RestoreSettings = None if os.path.exists("/media/hdd/images/config/settings" ) and config.misc.firstrun.value: if autorestoreLoop(): RestoreSettings = True from Plugins.SystemPlugins.SoftwareManager.BackupRestore import RestoreScreen session.open(RestoreScreen, runRestore=True) else: screensToRun = [ p.__call__ for p in plugins.getPlugins(PluginDescriptor.WHERE_WIZARD) ] screensToRun += wizardManager.getWizards() else: if os.path.exists("/media/hdd/images/config/autorestore"): os.system('rm -f /media/hdd/images/config/autorestore') screensToRun = [ p.__call__ for p in plugins.getPlugins(PluginDescriptor.WHERE_WIZARD) ] screensToRun += wizardManager.getWizards() screensToRun.append((100, InfoBar.InfoBar)) screensToRun.sort() print screensToRun enigma.ePythonConfigQuery.setQueryFunc(configfile.getResolvedKey) def runNextScreen(session, screensToRun, *result): if result: print "[mytest.py] quitMainloop #3" enigma.quitMainloop(*result) return screen = screensToRun[0][1] args = screensToRun[0][2:] if screensToRun: session.openWithCallback( boundFunction(runNextScreen, session, screensToRun[1:]), screen, *args) else: session.open(screen, *args) if not RestoreSettings: runNextScreen(session, screensToRun) profile("Init:VolumeControl") vol = VolumeControl(session) profile("Init:PowerKey") power = PowerKey(session) if boxtype in ( 'ustym4kpro', 'sf8008', 'clap4k', 'alien5', 'osninopro', 'osnino', 'osninoplus', 'alphatriple', 'spycat4kmini', 'tmtwin4k', 'mbmicrov2', 'revo4k', 'force3uhd', 'wetekplay', 'wetekplay2', 'wetekhub', 'dm7020hd', 'dm7020hdv2', 'osminiplus', 'osmega', 'sf3038', 'spycat', 'e4hd', 'e4hdhybrid', 'mbmicro', 'et7500', 'mixosf5', 'mixosf7', 'mixoslumi', 'gi9196m', 'maram9', 'ixussone', 'ixusszero', 'uniboxhd1', 'uniboxhd2', 'uniboxhd3', 'sezam5000hd', 'mbtwin', 'sezam1000hd', 'mbmini', 'atemio5x00', 'beyonwizt3', '9910lx', '9911lx', '9920lx') or getBrandOEM() in ( 'fulan') or getMachineBuild() in ('dags7362', 'dags73625', 'dags5'): profile("VFDSYMBOLS") import Components.VfdSymbols Components.VfdSymbols.SymbolsCheck(session) # we need session.scart to access it from within menu.xml session.scart = AutoScartControl(session) profile("Init:Trashcan") import Tools.Trashcan Tools.Trashcan.init(session) profile("Init:AutoVideoMode") import Screens.VideoMode Screens.VideoMode.autostart(session) profile("RunReactor") profile_final() if boxtype in ('sf8', 'classm', 'axodin', 'axodinc', 'starsatlx', 'genius', 'evo'): f = open("/dev/dbox/oled0", "w") f.write('-E2-') f.close() print "lastshutdown=%s (True = last shutdown was OK)" % config.usage.shutdownOK.value print "NOK shutdown action=%s" % config.usage.shutdownNOK_action.value print "bootup action=%s" % config.usage.boot_action.value if not config.usage.shutdownOK.value and not config.usage.shutdownNOK_action.value == 'normal' or not config.usage.boot_action.value == 'normal': print "last shutdown = %s" % config.usage.shutdownOK.value import Screens.PowerLost Screens.PowerLost.PowerLost(session) if not RestoreSettings: config.usage.shutdownOK.setValue(False) config.usage.shutdownOK.save() configfile.save() # kill showiframe if it is running (sh4 hack...) if getMachineBuild() in ('spark', 'spark7162'): os.system("killall -9 showiframe") runReactor() print "[mytest.py] normal shutdown" config.misc.startCounter.save() config.usage.shutdownOK.setValue(True) config.usage.shutdownOK.save() profile("wakeup") #get currentTime nowTime = time() # if not config.misc.SyncTimeUsing.value == "0" or getBrandOEM() == 'gigablue': if not config.misc.SyncTimeUsing.value == "0" or boxtype.startswith( 'gb') or getBrandOEM().startswith('ini'): print "dvb time sync disabled... so set RTC now to current linux time!", strftime( "%Y/%m/%d %H:%M", localtime(nowTime)) setRTCtime(nowTime) #recordtimer if session.nav.isRecordTimerImageStandard: #check RecordTimer instance tmp = session.nav.RecordTimer.getNextRecordingTime( getNextStbPowerOn=True) nextRecordTime = tmp[0] nextRecordTimeInStandby = tmp[1] else: nextRecordTime = session.nav.RecordTimer.getNextRecordingTime() nextRecordTimeInStandby = session.nav.RecordTimer.isNextRecordAfterEventActionAuto( ) #zaptimer nextZapTime = session.nav.RecordTimer.getNextZapTime() nextZapTimeInStandby = 0 #powertimer tmp = session.nav.PowerTimer.getNextPowerManagerTime( getNextStbPowerOn=True) nextPowerTime = tmp[0] nextPowerTimeInStandby = tmp[1] #plugintimer tmp = plugins.getNextWakeupTime(getPluginIdent=True) nextPluginTime = tmp[0] nextPluginIdent = tmp[1] #"pluginname | pluginfolder" tmp = tmp[1].lower() #start in standby, depending on plugin type if "epgrefresh" in tmp: nextPluginName = "EPGRefresh" nextPluginTimeInStandby = 1 elif "vps" in tmp: nextPluginName = "VPS" nextPluginTimeInStandby = 1 elif "serienrecorder" in tmp: nextPluginName = "SerienRecorder" nextPluginTimeInStandby = 0 # plugin function for deep standby from standby not compatible (not available) elif "elektro" in tmp: nextPluginName = "Elektro" nextPluginTimeInStandby = 1 elif "minipowersave" in tmp: nextPluginName = "MiniPowersave" nextPluginTimeInStandby = 1 elif "enhancedpowersave" in tmp: nextPluginName = "EnhancedPowersave" nextPluginTimeInStandby = 1 else: #default for plugins nextPluginName = nextPluginIdent nextPluginTimeInStandby = 0 wakeupList = [ x for x in ((nextRecordTime, 0, nextRecordTimeInStandby), (nextZapTime, 1, nextZapTimeInStandby), (nextPowerTime, 2, nextPowerTimeInStandby), (nextPluginTime, 3, nextPluginTimeInStandby)) if x[0] != -1 ] wakeupList.sort() print "=" * 100 if wakeupList and wakeupList[0][0] > 0: startTime = wakeupList[0] # wakeup time before timer begins wptime = startTime[0] - (config.workaround.wakeuptime.value * 60) if (wptime - nowTime) < 120: # no time to switch box back on wptime = int(nowTime) + 120 # so switch back on in 120 seconds #check for plugin-, zap- or power-timer to enable the 'forced' record-timer wakeup forceNextRecord = 0 setStandby = startTime[2] if startTime[1] != 0 and nextRecordTime > 0: #when next record starts in 15 mins if abs(nextRecordTime - startTime[0]) <= 900: setStandby = forceNextRecord = 1 #by vps-plugin elif startTime[1] == 3 and nextPluginName == "VPS": setStandby = forceNextRecord = 1 if startTime[1] == 3: nextPluginName = " (%s)" % nextPluginName else: nextPluginName = "" print "[mytest.py] set next wakeup type to '%s'%s %s" % ( { 0: "record-timer", 1: "zap-timer", 2: "power-timer", 3: "plugin-timer" }[startTime[1]], nextPluginName, { 0: "and starts normal", 1: "and starts in standby" }[setStandby]) if forceNextRecord: print "[mytest.py] set from 'vps-plugin' or just before a 'record-timer' starts, set 'record-timer' wakeup flag" print "[mytest.py] set next wakeup time to", strftime( "%a, %Y/%m/%d %H:%M:%S", localtime(wptime)) #set next wakeup setFPWakeuptime(wptime) #set next standby only after shutdown in deep standby if Screens.Standby.quitMainloopCode != 1 and Screens.Standby.quitMainloopCode != 45: setStandby = 2 # 0=no standby, but get in standby if wakeup to timer start > 60 sec (not for plugin-timer, here is no standby), 1=standby, 2=no standby, when before was not in deep-standby config.misc.nextWakeup.value = "%d,%d,%d,%d,%d,%d,%d" % ( int(nowTime), wptime, startTime[0], startTime[1], setStandby, nextRecordTime, forceNextRecord) else: config.misc.nextWakeup.value = "%d,-1,-1,0,0,-1,0" % (int(nowTime)) if not boxtype.startswith( 'azboxm' ): #skip for Azbox (mini)ME - setting wakeup time to past reboots box setFPWakeuptime(int(nowTime) - 3600) #minus one hour -> overwrite old wakeup time print "[mytest.py] no set next wakeup time" config.misc.nextWakeup.save() print "=" * 100 profile("stopService") session.nav.stopService() profile("nav shutdown") session.nav.shutdown() profile("configfile.save") configfile.save() from Screens import InfoBarGenerics InfoBarGenerics.saveResumePoints() return 0
import os import sys from time import time from Tools.Profile import profile, profile_final # This facilitates the start up progress counter. profile("StartPython") import Tools.RedirectOutput # Don't remove this line. This import facilitates connecting stdout and stderr redirections to the log files. import enigma # Establish enigma2 connections to processing methods. import eBaseImpl import eConsoleImpl enigma.eTimer = eBaseImpl.eTimer enigma.eSocketNotifier = eBaseImpl.eSocketNotifier enigma.eConsoleAppContainer = eConsoleImpl.eConsoleAppContainer # Session.open: # * Push current active dialog ("current_dialog") onto stack. # * Call execEnd for this dialog. # * Clear in_exec flag. # * Hide screen. # * Instantiate new dialog into "current_dialog". # * Create screens, components. # * Read and apply skin. # * Create GUI for screen. # * Call execBegin for new dialog. # * Set in_exec. # * Show GUI screen. # * Call components' / screen's onExecBegin. # ... Screen is active, until it calls "close"... #
def runScreenTest(): def runNextScreen(session, screensToRun, *result): if result: print("[StartEnigma] Exiting via quitMainloop #3.") enigma.quitMainloop(*result) return screen = screensToRun[0][1] args = screensToRun[0][2:] if screensToRun: session.openWithCallback( boundFunction(runNextScreen, session, screensToRun[1:]), screen, *args) else: session.open(screen, *args) config.misc.startCounter.value += 1 profile("ReadPluginList") enigma.pauseInit() plugins.readPluginList(resolveFilename(SCOPE_PLUGINS)) enigma.resumeInit() profile("Init:Session") nav = Navigation(config.misc.nextWakeup.value) session = Session(desktop=enigma.getDesktop(0), summaryDesktop=enigma.getDesktop(1), navigation=nav) CiHandler.setSession(session) from Screens.SwapManager import SwapAutostart SwapAutostart() profile("InitWizards") screensToRun = [] RestoreSettings = None if os.path.exists("/media/hdd/images/config/settings" ) and config.misc.firstrun.value: if autorestoreLoop(): RestoreSettings = True from Plugins.SystemPlugins.SoftwareManager.BackupRestore import RestoreScreen session.open(RestoreScreen, runRestore=True) else: screensToRun = [ p.__call__ for p in plugins.getPlugins(PluginDescriptor.WHERE_WIZARD) ] screensToRun += wizardManager.getWizards() else: if os.path.exists("/media/hdd/images/config/autorestore"): os.system("rm -f /media/hdd/images/config/autorestore") screensToRun = [ p.__call__ for p in plugins.getPlugins(PluginDescriptor.WHERE_WIZARD) ] screensToRun += wizardManager.getWizards() screensToRun.append((100, InfoBar.InfoBar)) screensToRun.sort() print(screensToRun) enigma.ePythonConfigQuery.setQueryFunc(configfile.getResolvedKey) if not RestoreSettings: runNextScreen(session, screensToRun) profile("InitVolumeControl") vol = VolumeControl(session) profile("InitPowerKey") power = PowerKey(session) if BOX_TYPE in ( "alien5", "osninopro", "osnino", "osninoplus", "alphatriple", "spycat4kmini", "tmtwin4k", "mbmicrov2", "revo4k", "force3uhd", "wetekplay", "wetekplay2", "wetekhub", "dm7020hd", "dm7020hdv2", "osminiplus", "osmega", "sf3038", "spycat", "e4hd", "e4hdhybrid", "mbmicro", "et7500", "mixosf5", "mixosf7", "mixoslumi", "gi9196m", "maram9", "ixussone", "ixusszero", "uniboxhd1", "uniboxhd2", "uniboxhd3", "sezam5000hd", "mbtwin", "sezam1000hd", "mbmini", "atemio5x00", "beyonwizt3", "9910lx", "9911lx", "9920lx", "dual") or getBrandOEM() in ("fulan", ) or getMachineBuild() in ( "u41", "dags7362", "dags73625", "dags5", "ustym4kpro", "beyonwizv2", "viper4k", "sf8008", "sf8008m", "sf8008opt", "cc1", "gbmv200", "sfx6008"): profile("VFDSYMBOLS") import Components.VfdSymbols Components.VfdSymbols.SymbolsCheck(session) # We need session.scart to access it from within menu.xml. session.scart = AutoScartControl(session) profile("InitTrashcan") import Tools.Trashcan Tools.Trashcan.init(session) profile("Init:AutoVideoMode") import Screens.VideoMode Screens.VideoMode.autostart(session) profile("Init:VolumeAdjust") import Screens.VolumeAdjust Screens.VolumeAdjust.autostart(session) profile("RunReactor") profile_final() if BOX_TYPE in ("sf8", "classm", "axodin", "axodinc", "starsatlx", "genius", "evo"): f = open("/dev/dbox/oled0", "w") f.write("-E2-") f.close() print("[StartEnigma] Last shutdown=%s. (True = last shutdown was OK.)" % config.usage.shutdownOK.value) print("[StartEnigma] NOK shutdown action=%s." % config.usage.shutdownNOK_action.value) print("[StartEnigma] Boot action=%s." % config.usage.boot_action.value) if not config.usage.shutdownOK.value and not config.usage.shutdownNOK_action.value == "normal" or not config.usage.boot_action.value == "normal": print("[StartEnigma] Last shutdown=%s." % config.usage.shutdownOK.value) import Screens.PowerLost Screens.PowerLost.PowerLost(session) if not RestoreSettings: config.usage.shutdownOK.setValue(False) config.usage.shutdownOK.save() configfile.save() # Kill showiframe if it is running. (sh4 hack...) if getMachineBuild() in ("spark", "spark7162"): os.system("killall -9 showiframe") runReactor() print("[StartEnigma] Normal shutdown.") config.misc.startCounter.save() config.usage.shutdownOK.setValue(True) config.usage.shutdownOK.save() profile("Wakeup") nowTime = time() # Get currentTime. # if not config.misc.SyncTimeUsing.value == "0" or getBrandOEM() == "gigablue": if not config.misc.SyncTimeUsing.value == "0" or BOX_TYPE.startswith( "gb") or getBrandOEM().startswith("ini"): print( "[StartEnigma] DVB time sync disabled, so set RTC now to current Linux time! (%s)" % strftime("%Y/%m/%d %H:%M", localtime(nowTime))) setRTCtime(nowTime) # Record timer. if session.nav.isRecordTimerImageStandard: # Check RecordTimer instance. tmp = session.nav.RecordTimer.getNextRecordingTime( getNextStbPowerOn=True) nextRecordTime = tmp[0] nextRecordTimeInStandby = tmp[1] else: nextRecordTime = session.nav.RecordTimer.getNextRecordingTime() nextRecordTimeInStandby = session.nav.RecordTimer.isNextRecordAfterEventActionAuto( ) # Zap timer. nextZapTime = session.nav.RecordTimer.getNextZapTime() nextZapTimeInStandby = 0 # Power timer. tmp = session.nav.PowerTimer.getNextPowerManagerTime( getNextStbPowerOn=True) nextPowerTime = tmp[0] nextPowerTimeInStandby = tmp[1] # Plugin timer. tmp = plugins.getNextWakeupTime(getPluginIdent=True) nextPluginTime = tmp[0] nextPluginIdent = tmp[1] # "pluginname | pluginfolder" tmp = tmp[1].lower() # Start in standby, depending on plugin type. if "epgrefresh" in tmp: nextPluginName = "EPGRefresh" nextPluginTimeInStandby = 1 elif "vps" in tmp: nextPluginName = "VPS" nextPluginTimeInStandby = 1 elif "serienrecorder" in tmp: nextPluginName = "SerienRecorder" nextPluginTimeInStandby = 0 # Plugin function for deep standby from standby not compatible (not available). elif "elektro" in tmp: nextPluginName = "Elektro" nextPluginTimeInStandby = 1 elif "minipowersave" in tmp: nextPluginName = "MiniPowersave" nextPluginTimeInStandby = 1 elif "enhancedpowersave" in tmp: nextPluginName = "EnhancedPowersave" nextPluginTimeInStandby = 1 else: # Default for plugins. nextPluginName = nextPluginIdent nextPluginTimeInStandby = 0 wakeupList = [ x for x in ((nextRecordTime, 0, nextRecordTimeInStandby), (nextZapTime, 1, nextZapTimeInStandby), (nextPowerTime, 2, nextPowerTimeInStandby), (nextPluginTime, 3, nextPluginTimeInStandby)) if x[0] != -1 ] wakeupList.sort() print("=" * 100) if wakeupList and wakeupList[0][0] > 0: startTime = wakeupList[0] # Wakeup time before timer begins. wptime = startTime[0] - (config.workaround.wakeuptime.value * 60) if (wptime - nowTime) < 120: # No time to switch box back on. wptime = int(nowTime) + 120 # So switch back on in 120 seconds. # Check for plugin-, zap- or power-timer to enable the 'forced' record-timer wakeup. forceNextRecord = 0 setStandby = startTime[2] if startTime[1] != 0 and nextRecordTime > 0: # When next record starts in 15 mins. if abs(nextRecordTime - startTime[0]) <= 900: setStandby = forceNextRecord = 1 # By vps-plugin. elif startTime[1] == 3 and nextPluginName == "VPS": setStandby = forceNextRecord = 1 if startTime[1] == 3: nextPluginName = " (%s)" % nextPluginName else: nextPluginName = "" print("[StartEnigma] Set next wakeup type to '%s'%s %s" % ({ 0: "record-timer", 1: "zap-timer", 2: "power-timer", 3: "plugin-timer" }[startTime[1]], nextPluginName, { 0: "and starts normal", 1: "and starts in standby" }[setStandby])) if forceNextRecord: print( "[StartEnigma] Set from 'vps-plugin' or just before a 'record-timer' starts, set 'record-timer' wakeup flag." ) print("[StartEnigma] Set next wakeup time to %s." % strftime("%a, %Y/%m/%d %H:%M:%S", localtime(wptime))) # Set next wakeup. setFPWakeuptime(wptime) # Set next standby only after shutdown in deep standby. if Screens.Standby.quitMainloopCode != 1 and Screens.Standby.quitMainloopCode != 45: setStandby = 2 # 0=no standby, but get in standby if wakeup to timer start > 60 sec (not for plugin-timer, here is no standby), 1=standby, 2=no standby, when before was not in deep-standby. config.misc.nextWakeup.value = "%d,%d,%d,%d,%d,%d,%d" % ( int(nowTime), wptime, startTime[0], startTime[1], setStandby, nextRecordTime, forceNextRecord) else: config.misc.nextWakeup.value = "%d,-1,-1,0,0,-1,0" % (int(nowTime)) if not BOX_TYPE.startswith( "azboxm" ): # Skip for Azbox (mini)ME - setting wakeup time to past reboots box. setFPWakeuptime( int(nowTime) - 3600) # Minus one hour -> overwrite old wakeup time. print("[StartEnigma] No next wakeup time set.") config.misc.nextWakeup.save() print("=" * 100) profile("stopService") session.nav.stopService() profile("nav shutdown") session.nav.shutdown() profile("configfile.save") configfile.save() from Screens import InfoBarGenerics InfoBarGenerics.saveResumePoints() return 0
def runScreenTest(): config.misc.startCounter.value += 1 profile("Init:Session") nav = Navigation(config.misc.isNextRecordTimerAfterEventActionAuto.value) session = Session(desktop = getDesktop(0), summary_desktop = getDesktop(1), navigation = nav) from Components.ScreenAnimations import ScreenAnimations ScreenAnimations().loadDefault() from Screens.Toast import ToastManager session.toastManager = ToastManager(session) CiHandler.setSession(session) try: from Screens.PackageRestoreWizard import PackageRestoreCheck PackageRestoreCheck(session) except: pass screensToRun = [ p.__call__ for p in plugins.getPlugins(PluginDescriptor.WHERE_WIZARD) ] profile("SetupGuide") if config.misc.firstrun.value: screensToRun.append((20,SetupGuide)) screensToRun.append((100, Screens.InfoBar.InfoBar)) screensToRun.sort() # eDVBCIInterfaces.getInstance().setDescrambleRules(0 # Slot Number # ,( ["1:0:1:24:4:85:C00000:0:0:0:"], #service_list # ["PREMIERE"], #provider_list, # [] #caid_list # )); def runNextScreen(session, screensToRun, *result): if result: quitMainloop(*result) return if screensToRun: screen = screensToRun[0][1] args = screensToRun[0][2:] if screensToRun: session.openWithCallback(boundFunction(runNextScreen, session, screensToRun[1:]), screen, *args) else: session.open(screen, *args) config.misc.epgcache_outdated_timespan.addNotifier(setOutdatedEPGTimespan) config.misc.epgcache_timespan.addNotifier(setEPGCacheTimespan) config.misc.epgcache_filename.addNotifier(setEPGCachePath) api.setSession(session) runNextScreen(session, screensToRun) profile("Init:VolumeControl") vol = VolumeControl(session) profile("Init:PowerKey") power = PowerKey(session) # we need session.scart to access it from within menu.xml session.scart = AutoScartControl(session) profile("RunReactor") profile_final() runReactor() session.shutdown = True while session.current_dialog: if not isinstance(session.current_dialog, Screens.InfoBar.InfoBar): session.current_dialog.callback = None Screen.close(session.current_dialog) session.processDelay() config.misc.startCounter.save() profile("wakeup") from time import time, strftime, localtime from Tools.DreamboxHardware import setFPWakeuptime, getFPWakeuptime, setRTCtime #get currentTime nowTime = time() wakeup_on_zaptimers = config.usage.standby_zaptimer_wakeup.value wakeupList = sorted([ x for x in ((session.nav.RecordTimer.getNextRecordingTime(), 0, session.nav.RecordTimer.isNextRecordAfterEventActionAuto()), (session.nav.RecordTimer.getNextZapTime(), 1), (plugins.getNextWakeupTime(), 2)) if x[0] != -1 and (x[1] != 1 or wakeup_on_zaptimers) ]) recordTimerWakeupAuto = False if wakeupList: from time import strftime startTime = wakeupList[0] if (startTime[0] - nowTime) < 270: # no time to switch box back on wptime = nowTime + 30 # so switch back on in 30 seconds else: wptime = startTime[0] - 240 if not config.misc.useTransponderTime.value: print("dvb time sync disabled... so set RTC now to current linux time!", strftime("%Y/%m/%d %H:%M", localtime(nowTime))) setRTCtime(nowTime) print("set wakeup time to", strftime("%Y/%m/%d %H:%M", localtime(wptime))) setFPWakeuptime(wptime) recordTimerWakeupAuto = startTime[1] == 0 and startTime[2] config.misc.prev_wakeup_time.value = startTime[0] config.misc.prev_wakeup_time_type.value = startTime[1] config.misc.prev_wakeup_time_type.save() else: config.misc.prev_wakeup_time.value = 0 config.misc.prev_wakeup_time.save() config.misc.isNextRecordTimerAfterEventActionAuto.value = recordTimerWakeupAuto config.misc.isNextRecordTimerAfterEventActionAuto.save() profile("stopService") session.nav.stopService() profile("nav shutdown") session.nav.shutdown() profile("configfile.save") configfile.save() return 0
print("ePositionGauge.setPointer(which, None, center) is deprecated please use ePositionGauge.setPointer(which, enigma.gPixmapPtr(), center)!") import traceback traceback.print_stack(limit = 2) pm = enigma.gPixmapPtr() ePositionGauge_setPointer_org(self, which, pm, center) else: ePositionGauge_setPointer_org(self, which, pixmap, center) enigma.ePositionGauge.setPointer = ePositionGauge_setPointer def iUriService_ptrValid(self): return True enigma.iUriService.ptrValid = iUriService_ptrValid from Tools.Profile import profile, profile_final profile("PYTHON_START") from enigma import runMainloop, eDVBDB, eTimer, quitMainloop, \ getDesktop, eAVSwitch, eServiceEvent, \ eEPGCache profile("LOAD:resourcemanager") from Components.ResourceManager import resourcemanager profile("LOAD:api") from API import api profile("ImageDefaults") from Components.DreamInfoHandler import ImageDefaultInstaller ImageDefaultInstaller()
def runScreenTest(): config.misc.startCounter.value += 1 profile("readPluginList") plugins.readPluginList(resolveFilename(SCOPE_PLUGINS)) profile("Init:Session") nav = Navigation(config.misc.isNextRecordTimerAfterEventActionAuto.value, config.misc.isNextPowerTimerAfterEventActionAuto.value) session = Session(desktop = enigma.getDesktop(0), summary_desktop = enigma.getDesktop(1), navigation = nav) CiHandler.setSession(session) screensToRun = [ p.__call__ for p in plugins.getPlugins(PluginDescriptor.WHERE_WIZARD) ] profile("wizards") screensToRun += wizardManager.getWizards() screensToRun.append((100, InfoBar.InfoBar)) screensToRun.sort() enigma.ePythonConfigQuery.setQueryFunc(configfile.getResolvedKey) def runNextScreen(session, screensToRun, *result): if result: enigma.quitMainloop(*result) return screen = screensToRun[0][1] args = screensToRun[0][2:] if screensToRun: session.openWithCallback(boundFunction(runNextScreen, session, screensToRun[1:]), screen, *args) else: session.open(screen, *args) runNextScreen(session, screensToRun) profile("Init:VolumeControl") vol = VolumeControl(session) profile("Init:PowerKey") power = PowerKey(session) if getBoxType() == 'odinm9' or getBoxType() == 'maram9' or getBoxType() == 'ventonhdx' or getBoxType() == 'ebox5000' or getBoxType() == 'ebox7358' or getBoxType() == 'eboxlumi' or getBoxType() == 'ixussone' or getBoxType() == 'ixusszero' or getBoxType() == 'ini-1000ru' or getBoxType() == 'ini-1000sv': profile("VFDSYMBOLS") import Components.VfdSymbols Components.VfdSymbols.SymbolsCheck(session) # we need session.scart to access it from within menu.xml session.scart = AutoScartControl(session) profile("Init:Trashcan") import Tools.Trashcan Tools.Trashcan.init(session) profile("Init:AutoVideoMode") import Screens.VideoMode Screens.VideoMode.autostart(session) profile("RunReactor") profile_final() if getBoxType() == 'odinm7' or getBoxType() == 'odinm6' or getBoxType() == 'xp1000s': f = open("/dev/dbox/oled0", "w") f.write('-E2-') f.close() print "lastshutdown=%s (True = last shutdown was OK)" % config.usage.shutdownOK.value print "NOK shutdown action=%s" % config.usage.shutdownNOK_action.value print "bootup action=%s" % config.usage.boot_action.value if not config.usage.shutdownOK.value and not config.usage.shutdownNOK_action.value == 'normal' or not config.usage.boot_action.value == 'normal': print "last shutdown = %s" % config.usage.shutdownOK.value import Screens.PowerLost Screens.PowerLost.PowerLost(session) config.usage.shutdownOK.setValue(False) config.usage.shutdownOK.save() configfile.save() runReactor() print "normal shutdown" config.misc.startCounter.save() config.usage.shutdownOK.setValue(True) config.usage.shutdownOK.save() profile("wakeup") from time import time, strftime, localtime from Tools.StbHardware import setFPWakeuptime, getFPWakeuptime, setRTCtime #get currentTime nowTime = time() if not config.misc.SyncTimeUsing.value == "0" or boxtype.startswith('gb') or getBrandOEM().startswith('ini'): print "dvb time sync disabled... so set RTC now to current linux time!", strftime("%Y/%m/%d %H:%M", localtime(nowTime)) setRTCtime(nowTime) wakeupList = [ x for x in ((session.nav.RecordTimer.getNextRecordingTime(), 0, session.nav.RecordTimer.isNextRecordAfterEventActionAuto()), (session.nav.RecordTimer.getNextZapTime(), 1), (plugins.getNextWakeupTime(), 2), (session.nav.PowerTimer.getNextPowerManagerTime(), 3, session.nav.PowerTimer.isNextPowerManagerAfterEventActionAuto())) if x[0] != -1 ] wakeupList.sort() recordTimerWakeupAuto = False if wakeupList and wakeupList[0][1] != 3: from time import strftime startTime = wakeupList[0] if (startTime[0] - nowTime) < 270: # no time to switch box back on wptime = nowTime + 30 # so switch back on in 30 seconds else: if getBoxType().startswith("gb"): wptime = startTime[0] - 120 # Gigaboxes already starts 2 min. before wakeup time else: wptime = startTime[0] - 240 # if not config.misc.SyncTimeUsing.value == "0" or getBoxType().startswith('gb'): # print "dvb time sync disabled... so set RTC now to current linux time!", strftime("%Y/%m/%d %H:%M", localtime(nowTime)) # setRTCtime(nowTime) print "set wakeup time to", strftime("%Y/%m/%d %H:%M", localtime(wptime)) setFPWakeuptime(wptime) recordTimerWakeupAuto = startTime[1] == 0 and startTime[2] print 'recordTimerWakeupAuto',recordTimerWakeupAuto config.misc.isNextRecordTimerAfterEventActionAuto.value = recordTimerWakeupAuto config.misc.isNextRecordTimerAfterEventActionAuto.save() PowerTimerWakeupAuto = False if wakeupList and wakeupList[0][1] == 3: from time import strftime startTime = wakeupList[0] if (startTime[0] - nowTime) < 60: # no time to switch box back on wptime = nowTime + 30 # so switch back on in 30 seconds else: if config.workaround.deeprecord.value: wptime = startTime[0] - 240 # Gigaboxes already starts 2 min. before wakeup time else: wptime = startTime[0] # if not config.misc.SyncTimeUsing.value == "0" or getBoxType().startswith('gb'): # print "dvb time sync disabled... so set RTC now to current linux time!", strftime("%Y/%m/%d %H:%M", localtime(nowTime)) # setRTCtime(nowTime) print "set wakeup time to", strftime("%Y/%m/%d %H:%M", localtime(wptime+60)) setFPWakeuptime(wptime) PowerTimerWakeupAuto = startTime[1] == 3 and startTime[2] print 'PowerTimerWakeupAuto',PowerTimerWakeupAuto config.misc.isNextPowerTimerAfterEventActionAuto.value = PowerTimerWakeupAuto config.misc.isNextPowerTimerAfterEventActionAuto.save() profile("stopService") session.nav.stopService() profile("nav shutdown") session.nav.shutdown() profile("configfile.save") configfile.save() from Screens import InfoBarGenerics InfoBarGenerics.saveResumePoints() return 0
from Tools.Profile import profile from Tools.BoundFunction import boundFunction # workaround for required config entry dependencies. import Screens.MovieSelection from Screens.Screen import Screen from Screens.MessageBox import MessageBox from Components.Label import Label from Components.Pixmap import MultiPixmap profile("LOAD:enigma") import enigma profile("LOAD:InfoBarGenerics") from Screens.InfoBarGenerics import InfoBarShowHide, \ InfoBarNumberZap, InfoBarChannelSelection, InfoBarMenu, InfoBarRdsDecoder, \ InfoBarEPG, InfoBarSeek, InfoBarInstantRecord, InfoBarRedButton, InfoBarTimerButton, InfoBarVmodeButton, \ InfoBarAudioSelection, InfoBarAdditionalInfo, InfoBarNotifications, InfoBarDish, InfoBarUnhandledKey, \ InfoBarSubserviceSelection, InfoBarShowMovies, \ InfoBarServiceNotifications, InfoBarPVRState, InfoBarCueSheetSupport, \ InfoBarSummarySupport, InfoBarMoviePlayerSummarySupport, InfoBarTimeshiftState, InfoBarTeletextPlugin, InfoBarExtensions, \ InfoBarSubtitleSupport, InfoBarPiP, InfoBarPlugins, InfoBarServiceErrorPopupSupport, InfoBarJobman, InfoBarZoom, \ setResumePoint, delResumePoint profile("LOAD:InitBar_Components") from Components.ActionMap import HelpableActionMap from Components.Timeshift import InfoBarTimeshift from Components.config import config from Components.ServiceEventTracker import ServiceEventTracker, InfoBarBase
def runScreenTest(): config.misc.startCounter.value += 1 config.misc.startCounter.save() profile("readPluginList") plugins.readPluginList(resolveFilename(SCOPE_PLUGINS)) profile("Init:Session") nav = Navigation() session = Session(desktop = enigma.getDesktop(0), summary_desktop = enigma.getDesktop(1), navigation = nav) CiHandler.setSession(session) screensToRun = [ p.__call__ for p in plugins.getPlugins(PluginDescriptor.WHERE_WIZARD) ] profile("wizards") screensToRun += wizardManager.getWizards() screensToRun.append((100, InfoBar.InfoBar)) screensToRun.sort() enigma.ePythonConfigQuery.setQueryFunc(configfile.getResolvedKey) # eDVBCIInterfaces.getInstance().setDescrambleRules(0 # Slot Number # ,( ["1:0:1:24:4:85:C00000:0:0:0:"], #service_list # ["PREMIERE"], #provider_list, # [] #caid_list # )); def runNextScreen(session, screensToRun, *result): if result: enigma.quitMainloop(*result) return screen = screensToRun[0][1] args = screensToRun[0][2:] if screensToRun: session.openWithCallback(boundFunction(runNextScreen, session, screensToRun[1:]), screen, *args) else: session.open(screen, *args) config.misc.epgcache_filename.addNotifier(setEPGCachePath) runNextScreen(session, screensToRun) profile("Init:VolumeControl") vol = VolumeControl(session) profile("Init:PowerKey") power = PowerKey(session) # we need session.scart to access it from within menu.xml session.scart = AutoScartControl(session) profile("Init:Trashcan") import Tools.Trashcan Tools.Trashcan.init(session) profile("RunReactor") profile_final() runReactor() profile("wakeup") from time import time, strftime, localtime from Tools.StbHardware import setFPWakeuptime, getFPWakeuptime, setRTCtime from Screens.SleepTimerEdit import isNextWakeupTime #get currentTime nowTime = time() wakeupList = [ x for x in ((session.nav.RecordTimer.getNextRecordingTime(), 0), (session.nav.RecordTimer.getNextZapTime(isWakeup=True), 1), (plugins.getNextWakeupTime(), 2), (isNextWakeupTime(), 3)) if x[0] != -1 ] wakeupList.sort() if wakeupList: from time import strftime startTime = wakeupList[0] if (startTime[0] - nowTime) < 330: # no time to switch box back on wptime = nowTime + 30 # so switch back on in 30 seconds else: wptime = startTime[0] - 300 if not config.misc.useTransponderTime.value: print "dvb time sync disabled... so set RTC now to current linux time!", strftime("%Y/%m/%d %H:%M", localtime(nowTime)) setRTCtime(nowTime) print "set wakeup time to", strftime("%Y/%m/%d %H:%M", localtime(wptime)) setFPWakeuptime(wptime) config.misc.prev_wakeup_time.value = int(startTime[0]) config.misc.prev_wakeup_time_type.value = startTime[1] config.misc.prev_wakeup_time_type.save() else: config.misc.prev_wakeup_time.value = 0 config.misc.prev_wakeup_time.save() profile("stopService") session.nav.stopService() profile("nav shutdown") session.nav.shutdown() profile("configfile.save") configfile.save() from Screens import InfoBarGenerics InfoBarGenerics.saveResumePoints() return 0
from Tools.Profile import profile profile("LOAD:GUISkin") from Components.GUISkin import GUISkin profile("LOAD:Source") from Components.Sources.Source import Source profile("LOAD:GUIComponent") from Components.GUIComponent import GUIComponent profile("LOAD:eRCInput") from enigma import eRCInput class Screen(dict, GUISkin): False, SUSPEND_STOPS, SUSPEND_PAUSES = range(3) ALLOW_SUSPEND = False global_screen = None def __init__(self, session, parent = None): dict.__init__(self) self.skinName = self.__class__.__name__ self.session = session self.parent = parent self.onClose = [ ] self.onFirstExecBegin = [ ] self.onExecBegin = [ ] self.onExecEnd = [ ] self.onShown = [ ] self.onShow = [ ] self.onHide = [ ] self.execing = False
def runScreenTest(): config.misc.startCounter.value += 1 config.misc.startCounter.save() #Let's Disable it for a while #config.usage.async_plug_load.value = False if config.usage.async_plug_load.value and os.path.isfile( "/usr/lib/enigma2/python/Plugins/SystemPlugins/EGAMIPluginSpeedUp/plugin.pyo" ): profile("readBaseList") plugins.loadBasePlugins(resolveFilename(SCOPE_PLUGINS)) else: profile("readPluginList") plugins.readPluginList(resolveFilename(SCOPE_PLUGINS)) profile("Init:Session") nav = Navigation(config.misc.nextWakeup.value) session = Session(desktop=enigma.getDesktop(0), summary_desktop=enigma.getDesktop(1), navigation=nav) CiHandler.setSession(session) screensToRun = [ p.__call__ for p in plugins.getPlugins(PluginDescriptor.WHERE_WIZARD) ] profile("wizards") screensToRun += wizardManager.getWizards() screensToRun.append((100, InfoBar.InfoBar)) screensToRun.sort() enigma.ePythonConfigQuery.setQueryFunc(configfile.getResolvedKey) def runNextScreen(session, screensToRun, *result): if result: print "[mytest.py] quitMainloop #3" enigma.quitMainloop(*result) return screen = screensToRun[0][1] args = screensToRun[0][2:] if screensToRun: session.openWithCallback( boundFunction(runNextScreen, session, screensToRun[1:]), screen, *args) else: session.open(screen, *args) runNextScreen(session, screensToRun) profile("Init:VolumeControl") vol = VolumeControl(session) profile("Init:PowerKey") power = PowerKey(session) if boxtype in ('wetekplay', 'wetekplayplus', 'mbtwinplus', 'sf3038', 'spycat', 'e4hd', 'mbmicro', 'et7500', 'mixosf5', 'mixosf7', 'mixoslumi', 'gi9196m', 'maram9', 'ixussone', 'ixussone', 'uniboxhd1', 'uniboxhd2', 'uniboxhd3', 'sezam5000hd', 'mbtwin', 'sezam1000hd', 'mbmini', 'atemio5x00', 'beyonwizt3') or getBrandOEM() in ('fulan'): profile("VFDSYMBOLS") import Components.VfdSymbols Components.VfdSymbols.SymbolsCheck(session) # we need session.scart to access it from within menu.xml session.scart = AutoScartControl(session) profile("Init:Trashcan") import Tools.Trashcan Tools.Trashcan.init(session) profile("Init:AutoVideoMode") import Screens.VideoMode Screens.VideoMode.autostart(session) profile("RunReactor") profile_final() if boxtype in ('sf8', 'classm', 'axodin', 'axodinc', 'starsatlx', 'genius', 'evo'): f = open("/dev/dbox/oled0", "w") f.write('-E2-') f.close() print "lastshutdown=%s (True = last shutdown was OK)" % config.usage.shutdownOK.value print "NOK shutdown action=%s" % config.usage.shutdownNOK_action.value print "bootup action=%s" % config.usage.boot_action.value if not config.usage.shutdownOK.value and not config.usage.shutdownNOK_action.value == 'normal' or not config.usage.boot_action.value == 'normal': print "last shutdown = %s" % config.usage.shutdownOK.value import Screens.PowerLost Screens.PowerLost.PowerLost(session) config.usage.shutdownOK.setValue(False) config.usage.shutdownOK.save() configfile.save() runReactor() print "[mytest.py] normal shutdown" config.misc.startCounter.save() config.usage.shutdownOK.setValue(True) config.usage.shutdownOK.save() profile("wakeup") #get currentTime nowTime = time() # if not config.misc.SyncTimeUsing.value == "0" or getBrandOEM() == 'gigablue': if not config.misc.SyncTimeUsing.value == "0" or boxtype.startswith( 'gb') or getBrandOEM().startswith('ini'): print "dvb time sync disabled... so set RTC now to current linux time!", strftime( "%Y/%m/%d %H:%M", localtime(nowTime)) setRTCtime(nowTime) #recordtimer if session.nav.isRecordTimerImageStandard: #check RecordTimer instance tmp = session.nav.RecordTimer.getNextRecordingTime( getNextStbPowerOn=True) nextRecordTime = tmp[0] nextRecordTimeInStandby = tmp[1] else: nextRecordTime = session.nav.RecordTimer.getNextRecordingTime() nextRecordTimeInStandby = session.nav.RecordTimer.isNextRecordAfterEventActionAuto( ) #zaptimer nextZapTime = session.nav.RecordTimer.getNextZapTime() nextZapTimeInStandby = 0 #powertimer tmp = session.nav.PowerTimer.getNextPowerManagerTime( getNextStbPowerOn=True) nextPowerTime = tmp[0] nextPowerTimeInStandby = tmp[1] #plugintimer tmp = plugins.getNextWakeupTime(getPluginIdent=True) nextPluginTime = tmp[0] nextPluginIdent = tmp[1] #"pluginname | pluginfolder" tmp = tmp[1].lower() #start in standby, depending on plugin type if "epgrefresh" in tmp: nextPluginName = "EPGRefresh" nextPluginTimeInStandby = 1 elif "vps" in tmp: nextPluginName = "VPS" nextPluginTimeInStandby = 1 elif "serienrecorder" in tmp: nextPluginName = "SerienRecorder" nextPluginTimeInStandby = 0 # plugin function for deep standby from standby not compatible (not available) elif "elektro" in tmp: nextPluginName = "Elektro" nextPluginTimeInStandby = 1 elif "minipowersave" in tmp: nextPluginName = "MiniPowersave" nextPluginTimeInStandby = 1 elif "enhancedpowersave" in tmp: nextPluginName = "EnhancedPowersave" nextPluginTimeInStandby = 1 else: #default for plugins nextPluginName = nextPluginIdent nextPluginTimeInStandby = 0 wakeupList = [ x for x in ((nextRecordTime, 0, nextRecordTimeInStandby), (nextZapTime, 1, nextZapTimeInStandby), (nextPowerTime, 2, nextPowerTimeInStandby), (nextPluginTime, 3, nextPluginTimeInStandby)) if x[0] != -1 ] wakeupList.sort() # individual wakeup time offset if config.workaround.wakeuptimeoffset.value == "standard": if boxtype.startswith("gb"): wpoffset = -120 # Gigaboxes already starts 2 min. before wakeup time else: wpoffset = 0 else: wpoffset = int(config.workaround.wakeuptimeoffset.value) print "=" * 100 if wakeupList and wakeupList[0][0] > 0: startTime = wakeupList[0] # wakeup time is 5 min before timer starts + offset wptime = startTime[0] - 300 - wpoffset if (wptime - nowTime) < 120: # no time to switch box back on wptime = int(nowTime) + 120 # so switch back on in 120 seconds #check for plugin-, zap- or power-timer to enable the 'forced' record-timer wakeup forceNextRecord = 0 setStandby = startTime[2] if startTime[1] != 0 and nextRecordTime > 0: #when next record starts in 15 mins if abs(nextRecordTime - startTime[0]) <= 900: setStandby = forceNextRecord = 1 #by vps-plugin elif startTime[1] == 3 and nextPluginName == "VPS": setStandby = forceNextRecord = 1 if startTime[1] == 3: nextPluginName = " (%s)" % nextPluginName else: nextPluginName = "" print "[mytest.py] set next wakeup type to '%s'%s %s" % ( { 0: "record-timer", 1: "zap-timer", 2: "power-timer", 3: "plugin-timer" }[startTime[1]], nextPluginName, { 0: "and starts normal", 1: "and starts in standby" }[setStandby]) if forceNextRecord: print "[mytest.py] set from 'vps-plugin' or just before a 'record-timer' starts, set 'record-timer' wakeup flag" print "[mytest.py] set next wakeup time to", strftime( "%a, %Y/%m/%d %H:%M:%S", localtime(wptime)) #set next wakeup setFPWakeuptime(wptime) #set next standby only after shutdown in deep standby if Screens.Standby.quitMainloopCode != 1 and Screens.Standby.quitMainloopCode != 45: setStandby = 2 # 0=no standby, but get in standby if wakeup to timer start > 60 sec (not for plugin-timer, here is no standby), 1=standby, 2=no standby, when before was not in deep-standby config.misc.nextWakeup.value = "%d,%d,%d,%d,%d,%d" % ( wptime, startTime[0], startTime[1], setStandby, nextRecordTime, forceNextRecord) else: config.misc.nextWakeup.value = "-1,-1,0,0,-1,0" print "[mytest.py] no set next wakeup time" config.misc.nextWakeup.save() print "=" * 100 profile("stopService") session.nav.stopService() profile("nav shutdown") session.nav.shutdown() profile("configfile.save") configfile.save() from Screens import InfoBarGenerics InfoBarGenerics.saveResumePoints() return 0
def runScreenTest(): config.misc.startCounter.value += 1 profile("readPluginList") plugins.readPluginList(resolveFilename(SCOPE_PLUGINS)) profile("Init:Session") nav = Navigation(config.misc.isNextRecordTimerAfterEventActionAuto.value, config.misc.isNextPowerTimerAfterEventActionAuto.value) session = Session(desktop = enigma.getDesktop(0), summary_desktop = enigma.getDesktop(1), navigation = nav) CiHandler.setSession(session) screensToRun = [ p.__call__ for p in plugins.getPlugins(PluginDescriptor.WHERE_WIZARD) ] profile("wizards") screensToRun += wizardManager.getWizards() screensToRun.append((100, InfoBar.InfoBar)) screensToRun.sort() enigma.ePythonConfigQuery.setQueryFunc(configfile.getResolvedKey) def runNextScreen(session, screensToRun, *result): if result: enigma.quitMainloop(*result) return screen = screensToRun[0][1] args = screensToRun[0][2:] if screensToRun: session.openWithCallback(boundFunction(runNextScreen, session, screensToRun[1:]), screen, *args) else: session.open(screen, *args) runNextScreen(session, screensToRun) profile("Init:VolumeControl") vol = VolumeControl(session) profile("Init:PowerKey") power = PowerKey(session) if getBoxType() == 'odinm9' or getBoxType() == 'maram9' or getBoxType() == 'ventonhdx' or getBoxType() == 'ebox5000' or getBoxType() == 'ebox7358' or getBoxType() == 'eboxlumi' or getBoxType() == 'ixussone' or getBoxType() == 'ixusszero' or getBoxType() == 'ini-1000ru' or getBoxType() == 'ini-1000sv': profile("VFDSYMBOLS") import Components.VfdSymbols Components.VfdSymbols.SymbolsCheck(session) # we need session.scart to access it from within menu.xml session.scart = AutoScartControl(session) profile("Init:Trashcan") import Tools.Trashcan Tools.Trashcan.init(session) profile("Init:AutoVideoMode") import Screens.VideoMode Screens.VideoMode.autostart(session) profile("RunReactor") profile_final() if getBoxType() == 'gb800se' or getBoxType() == 'gb800solo' or getBoxType() == 'gb800seplus': from enigma import evfd, eConsoleAppContainer try: cmd = 'vfdctl " openatv starting e2"' container = eConsoleAppContainer() container.execute(cmd) except: evfd.getInstance().vfd_write_string("-E2-") evfd.getInstance().vfd_led(str(1)) if getBoxType() == 'odinm7' or getBoxType() == 'odinm6' or getBoxType() == 'xp1000s': f = open("/dev/dbox/oled0", "w") f.write('-E2-') f.close() print "lastshutdown=%s (True = last shutdown was OK)" % config.usage.shutdownOK.value print "NOK shutdown action=%s" % config.usage.shutdownNOK_action.value print "bootup action=%s" % config.usage.boot_action.value if not config.usage.shutdownOK.value and not config.usage.shutdownNOK_action.value == 'normal' or not config.usage.boot_action.value == 'normal': print "last shutdown = %s" % config.usage.shutdownOK.value import Screens.PowerLost Screens.PowerLost.PowerLost(session) config.usage.shutdownOK.setValue(False) config.usage.shutdownOK.save() configfile.save() runReactor() print "normal shutdown" config.misc.startCounter.save() config.usage.shutdownOK.setValue(True) config.usage.shutdownOK.save() profile("wakeup") from time import time, strftime, localtime from Tools.StbHardware import setFPWakeuptime, getFPWakeuptime, setRTCtime #get currentTime nowTime = time() if not config.misc.SyncTimeUsing.value == "0" or boxtype.startswith('gb') or getBrandOEM().startswith('ini'): print "dvb time sync disabled... so set RTC now to current linux time!", strftime("%Y/%m/%d %H:%M", localtime(nowTime)) setRTCtime(nowTime) wakeupList = [ x for x in ((session.nav.RecordTimer.getNextRecordingTime(), 0, session.nav.RecordTimer.isNextRecordAfterEventActionAuto()), (session.nav.RecordTimer.getNextZapTime(), 1), (plugins.getNextWakeupTime(), 2), (session.nav.PowerTimer.getNextPowerManagerTime(), 3, session.nav.PowerTimer.isNextPowerManagerAfterEventActionAuto())) if x[0] != -1 ] wakeupList.sort() recordTimerWakeupAuto = False if wakeupList and wakeupList[0][1] != 3: from time import strftime startTime = wakeupList[0] if (startTime[0] - nowTime) < 270: # no time to switch box back on wptime = nowTime + 30 # so switch back on in 30 seconds else: if getBoxType().startswith("gb"): wptime = startTime[0] - 120 # Gigaboxes already starts 2 min. before wakeup time else: wptime = startTime[0] - 240 if not config.misc.SyncTimeUsing.value == "0" or getBoxType().startswith('gb'): print "dvb time sync disabled... so set RTC now to current linux time!", strftime("%Y/%m/%d %H:%M", localtime(nowTime)) setRTCtime(nowTime) print "set wakeup time to", strftime("%Y/%m/%d %H:%M", localtime(wptime)) setFPWakeuptime(wptime) recordTimerWakeupAuto = startTime[1] == 0 and startTime[2] print 'recordTimerWakeupAuto',recordTimerWakeupAuto config.misc.isNextRecordTimerAfterEventActionAuto.value = recordTimerWakeupAuto config.misc.isNextRecordTimerAfterEventActionAuto.save() PowerTimerWakeupAuto = False if wakeupList and wakeupList[0][1] == 3: from time import strftime startTime = wakeupList[0] if (startTime[0] - nowTime) < 60: # no time to switch box back on wptime = nowTime + 30 # so switch back on in 30 seconds else: if config.workaround.deeprecord.value: wptime = startTime[0] + 240 # Gigaboxes already starts 2 min. before wakeup time else: wptime = startTime[0] if not config.misc.SyncTimeUsing.value == "0" or getBoxType().startswith('gb'): print "dvb time sync disabled... so set RTC now to current linux time!", strftime("%Y/%m/%d %H:%M", localtime(nowTime)) setRTCtime(nowTime) print "set wakeup time to", strftime("%Y/%m/%d %H:%M", localtime(wptime+60)) setFPWakeuptime(wptime) PowerTimerWakeupAuto = startTime[1] == 3 and startTime[2] print 'PowerTimerWakeupAuto',PowerTimerWakeupAuto config.misc.isNextPowerTimerAfterEventActionAuto.value = PowerTimerWakeupAuto config.misc.isNextPowerTimerAfterEventActionAuto.save() profile("stopService") session.nav.stopService() profile("nav shutdown") session.nav.shutdown() profile("configfile.save") configfile.save() from Screens import InfoBarGenerics InfoBarGenerics.saveResumePoints() return 0
from enigma import eDVBVolumecontrol, eTimer from Tools.Profile import profile from Screens.Volume import Volume from Screens.Mute import Mute from GlobalActions import globalActionMap from config import config, ConfigSubsection, ConfigInteger profile("VolumeControl") #TODO .. move this to a own .py file class VolumeControl: instance = None """Volume control, handles volUp, volDown, volMute actions and display a corresponding dialog""" def __init__(self, session): global globalActionMap globalActionMap.actions["volumeUp"] = self.volUp globalActionMap.actions["volumeDown"] = self.volDown globalActionMap.actions["volumeMute"] = self.volMute assert not VolumeControl.instance, "only one VolumeControl instance is allowed!" VolumeControl.instance = self config.audio = ConfigSubsection() config.audio.volume = ConfigInteger(default=50, limits=(0, 100)) self.volumeDialog = session.instantiateDialog(Volume) self.volumeDialog.setAnimationMode(0) self.muteDialog = session.instantiateDialog(Mute) self.muteDialog.setAnimationMode(0)
from enigma import eDVBVolumecontrol, eTimer from Tools.Profile import profile from Screens.Volume import Volume from Screens.Mute import Mute from GlobalActions import globalActionMap from config import config, ConfigSubsection, ConfigInteger profile("VolumeControl") class VolumeControl: instance = None """Volume control, handles volUp, volDown, volMute actions and display a corresponding dialog""" def __init__(self, session): global globalActionMap globalActionMap.actions["volumeUp"]=self.volUp globalActionMap.actions["volumeDown"]=self.volDown globalActionMap.actions["volumeMute"]=self.volMute assert not VolumeControl.instance, "only one VolumeControl instance is allowed!" VolumeControl.instance = self config.audio = ConfigSubsection() config.audio.volume = ConfigInteger(default = 50, limits = (0, 100)) self.volumeDialog = session.instantiateDialog(Volume) self.volumeDialog.setAnimationMode(0) self.muteDialog = session.instantiateDialog(Mute) self.muteDialog.setAnimationMode(0) self.hideVolTimer = eTimer() self.hideVolTimer.callback.append(self.volHide)
from Tools.Profile import profile profile('LOAD:ElementTree') import xml.etree.cElementTree import os profile('LOAD:enigma_skin') from enigma import eSize, ePoint, eRect, gFont, eWindow, eLabel, ePixmap, eWindowStyleManager, addFont, gRGB, eWindowStyleSkinned, getDesktop from Components.config import ConfigSubsection, ConfigText, config, ConfigInteger from Components.Converter.Converter import Converter from Components.Sources.Source import Source, ObsoleteSource from Tools.Directories import resolveFilename, SCOPE_SKIN, SCOPE_FONTS, SCOPE_CURRENT_SKIN, SCOPE_CONFIG, fileExists, SCOPE_SKIN_IMAGE from Tools.Import import my_import from Tools.LoadPixmap import LoadPixmap from Components.RcModel import rc_model from Components.SystemInfo import SystemInfo colorNames = {} fonts = { 'Body': ('Regular', 18, 22, 16), 'ChoiceList': ('Regular', 20, 24, 18) } parameters = {} def dump(x, i=0): print " " * i + str(x) try: for n in x.childNodes: dump(n, i + 1) except:
import sys import os from time import time if os.path.isfile("/usr/lib/enigma2/python/enigma.zip"): sys.path.append("/usr/lib/enigma2/python/enigma.zip") from Tools.Profile import profile, profile_final profile("PYTHON_START") import Tools.RedirectOutput import enigma from boxbranding import getBoxType, getBrandOEM import eConsoleImpl import eBaseImpl enigma.eTimer = eBaseImpl.eTimer enigma.eSocketNotifier = eBaseImpl.eSocketNotifier enigma.eConsoleAppContainer = eConsoleImpl.eConsoleAppContainer boxtype = getBoxType() if os.path.isfile("/usr/lib/enigma2/python/Plugins/Extensions/MediaPortal/plugin.pyo") and boxtype in ('dm7080','dm820'): import pyo_patcher from traceback import print_exc profile("SimpleSummary") from Screens import InfoBar from Screens.SimpleSummary import SimpleSummary from sys import stdout, exc_info profile("Bouquets")
from Tools.Profile import profile profile("LOAD:GUISkin") from Components.GUISkin import GUISkin profile("LOAD:Source") from Components.Sources.Source import Source profile("LOAD:GUIComponent") from Components.GUIComponent import GUIComponent profile("LOAD:eRCInput") from enigma import eRCInput, eTimer class Screen(dict, GUISkin): False, SUSPEND_STOPS, SUSPEND_PAUSES = range(3) ALLOW_SUSPEND = False global_screen = None def __init__(self, session, parent=None): dict.__init__(self) self.skinName = self.__class__.__name__ self.session = session self.parent = parent self.onClose = [] self.onFirstExecBegin = [] self.onExecBegin = [] self.onExecEnd = [] self.onShown = [] self.onShow = [] self.onHide = []
# Embedded file name: /usr/lib/enigma2/python/Components/VolumeControl.py from enigma import eDVBVolumecontrol, eTimer from Tools.Profile import profile from Screens.Volume import Volume from Screens.Mute import Mute from GlobalActions import globalActionMap from config import config, ConfigSubsection, ConfigInteger profile('VolumeControl') class VolumeControl: instance = None def __init__(self, session): global globalActionMap globalActionMap.actions['volumeUp'] = self.volUp globalActionMap.actions['volumeDown'] = self.volDown globalActionMap.actions['volumeMute'] = self.volMute VolumeControl.instance = self config.audio = ConfigSubsection() config.audio.volume = ConfigInteger(default=100, limits=(0, 100)) self.volumeDialog = session.instantiateDialog(Volume) self.volumeDialog.setAnimationMode(0) self.muteDialog = session.instantiateDialog(Mute) self.muteDialog.setAnimationMode(0) self.hideVolTimer = eTimer() self.hideVolTimer.callback.append(self.volHide) vol = config.audio.volume.value self.volumeDialog.setValue(vol) self.volctrl = eDVBVolumecontrol.getInstance() self.volctrl.setVolume(vol, vol)
def runScreenTest(): config.misc.startCounter.value += 1 profile("Init:Session") nav = Navigation(config.misc.isNextRecordTimerAfterEventActionAuto.value) session = Session(desktop = getDesktop(0), summary_desktop = getDesktop(1), navigation = nav) from Components.ScreenAnimations import ScreenAnimations ScreenAnimations().loadDefault() from Screens.Toast import ToastManager session.toastManager = ToastManager(session) CiHandler.setSession(session) from Screens.PackageRestoreWizard import PackageRestoreCheck PackageRestoreCheck(session) screensToRun = [ p.__call__ for p in plugins.getPlugins(PluginDescriptor.WHERE_WIZARD) ] profile("wizards") screensToRun += wizardManager.getWizards() screensToRun.append((100, Screens.InfoBar.InfoBar)) screensToRun.sort() queryFunc_conn = ePythonConfigQuery.getQueryFuncSignal().connect(configfile.getResolvedKey) # eDVBCIInterfaces.getInstance().setDescrambleRules(0 # Slot Number # ,( ["1:0:1:24:4:85:C00000:0:0:0:"], #service_list # ["PREMIERE"], #provider_list, # [] #caid_list # )); def runNextScreen(session, screensToRun, *result): if result: quitMainloop(*result) return if screensToRun: screen = screensToRun[0][1] args = screensToRun[0][2:] if screensToRun: session.openWithCallback(boundFunction(runNextScreen, session, screensToRun[1:]), screen, *args) else: session.open(screen, *args) config.misc.epgcache_outdated_timespan.addNotifier(setOutdatedEPGTimespan) config.misc.epgcache_timespan.addNotifier(setEPGCacheTimespan) config.misc.epgcache_filename.addNotifier(setEPGCachePath) api.setSession(session) runNextScreen(session, screensToRun) profile("Init:VolumeControl") vol = VolumeControl(session) profile("Init:PowerKey") power = PowerKey(session) # we need session.scart to access it from within menu.xml session.scart = AutoScartControl(session) profile("RunReactor") profile_final() runReactor() session.shutdown = True while session.current_dialog: if not isinstance(session.current_dialog, Screens.InfoBar.InfoBar): session.current_dialog.callback = None Screen.close(session.current_dialog) session.processDelay() config.misc.startCounter.save() profile("wakeup") from time import time, strftime, localtime from Tools.DreamboxHardware import setFPWakeuptime, getFPWakeuptime, setRTCtime #get currentTime nowTime = time() wakeup_on_zaptimers = config.usage.standby_zaptimer_wakeup.value wakeupList = [ x for x in ((session.nav.RecordTimer.getNextRecordingTime(), 0, session.nav.RecordTimer.isNextRecordAfterEventActionAuto()), (session.nav.RecordTimer.getNextZapTime(), 1), (plugins.getNextWakeupTime(), 2)) if x[0] != -1 and (x[1] != 1 or wakeup_on_zaptimers) ] wakeupList.sort() recordTimerWakeupAuto = False if wakeupList: from time import strftime startTime = wakeupList[0] if (startTime[0] - nowTime) < 270: # no time to switch box back on wptime = nowTime + 30 # so switch back on in 30 seconds else: wptime = startTime[0] - 240 if not config.misc.useTransponderTime.value: print "dvb time sync disabled... so set RTC now to current linux time!", strftime("%Y/%m/%d %H:%M", localtime(nowTime)) setRTCtime(nowTime) print "set wakeup time to", strftime("%Y/%m/%d %H:%M", localtime(wptime)) setFPWakeuptime(wptime) recordTimerWakeupAuto = startTime[1] == 0 and startTime[2] config.misc.prev_wakeup_time.value = startTime[0] config.misc.prev_wakeup_time_type.value = startTime[1] config.misc.prev_wakeup_time_type.save() else: config.misc.prev_wakeup_time.value = 0 config.misc.prev_wakeup_time.save() config.misc.isNextRecordTimerAfterEventActionAuto.value = recordTimerWakeupAuto config.misc.isNextRecordTimerAfterEventActionAuto.save() profile("stopService") session.nav.stopService() profile("nav shutdown") session.nav.shutdown() profile("configfile.save") configfile.save() return 0
# Embedded file name: /usr/lib/enigma2/python/Screens/Screen.py from Tools.Profile import profile profile('LOAD:GUISkin') from Components.GUISkin import GUISkin profile('LOAD:Source') from Components.Sources.Source import Source profile('LOAD:GUIComponent') from Components.GUIComponent import GUIComponent profile('LOAD:eRCInput') from enigma import eRCInput class Screen(dict, GUISkin): False, SUSPEND_STOPS, SUSPEND_PAUSES = range(3) ALLOW_SUSPEND = False global_screen = None def __init__(self, session, parent = None): dict.__init__(self) self.skinName = self.__class__.__name__ self.session = session self.parent = parent GUISkin.__init__(self) self.onClose = [] self.onFirstExecBegin = [] self.onExecBegin = [] self.onExecEnd = [] self.onShown = [] self.onShow = [] self.onHide = [] self.execing = False self.shown = True
def runScreenTest(): config.misc.startCounter.value += 1 config.misc.startCounter.save() profile("readPluginList") plugins.readPluginList(resolveFilename(SCOPE_PLUGINS)) profile("Init:Session") nav = Navigation() session = Session(desktop=enigma.getDesktop(0), summary_desktop=enigma.getDesktop(1), navigation=nav) CiHandler.setSession(session) screensToRun = [p.__call__ for p in plugins.getPlugins(PluginDescriptor.WHERE_WIZARD)] profile("wizards") screensToRun += wizardManager.getWizards() screensToRun.append((100, InfoBar.InfoBar)) screensToRun.sort() enigma.ePythonConfigQuery.setQueryFunc(configfile.getResolvedKey) def runNextScreen(session, screensToRun, *result): if result: enigma.quitMainloop(*result) return screen = screensToRun[0][1] args = screensToRun[0][2:] if screensToRun: session.openWithCallback(boundFunction(runNextScreen, session, screensToRun[1:]), screen, *args) else: session.open(screen, *args) config.misc.epgcache_filename.addNotifier(setEPGCachePath) runNextScreen(session, screensToRun) profile("Init:VolumeControl") vol = VolumeControl(session) profile("Init:PowerKey") power = PowerKey(session) # we need session.scart to access it from within menu.xml session.scart = AutoScartControl(session) profile("Init:Trashcan") import Tools.Trashcan Tools.Trashcan.init(session) profile("Init:AutoVideoMode") import Screens.VideoMode Screens.VideoMode.autostart(session) profile("RunReactor") profile_final() if boxtype in ("sf8", "classm", "axodin", "axodinc", "starsatlx", "genius", "evo"): f = open("/dev/dbox/oled0", "w") f.write("-E2-") f.close() # kill showiframe if it is running (sh4 hack...) os.system("killall -9 showiframe") runReactor() profile("wakeup") from time import time, strftime, localtime from Tools.StbHardware import setFPWakeuptime, getFPWakeuptime, setRTCtime # get currentTime nowTime = time() if not config.misc.SyncTimeUsing.value == "0" or boxtype.startswith("gb") or getBrandOEM().startswith("ini"): print "dvb time sync disabled... so set RTC now to current linux time!", strftime( "%Y/%m/%d %H:%M", localtime(nowTime) ) setRTCtime(nowTime) wakeupList = [ x for x in ( (session.nav.RecordTimer.getNextRecordingTime(), 0), (session.nav.RecordTimer.getNextZapTime(isWakeup=True), 1), (plugins.getNextWakeupTime(), 2), ) if x[0] != -1 ] wakeupList.sort() if wakeupList: from time import strftime startTime = wakeupList[0] if (startTime[0] - nowTime) < 270: # no time to switch box back on wptime = nowTime + 30 # so switch back on in 30 seconds else: if boxtype.startswith("gb"): wptime = startTime[0] - 120 # Gigaboxes already starts 2 min. before wakeup time else: wptime = startTime[0] - 240 # if not config.misc.SyncTimeUsing.getValue() == "0" or getBoxType().startswith('gb'): # print "dvb time sync disabled... so set RTC now to current linux time!", strftime("%Y/%m/%d %H:%M", localtime(nowTime)) # setRTCtime(nowTime) print "set wakeup time to", strftime("%Y/%m/%d %H:%M", localtime(wptime)) setFPWakeuptime(wptime) profile("stopService") session.nav.stopService() profile("nav shutdown") session.nav.shutdown() profile("configfile.save") configfile.save() from Screens import InfoBarGenerics InfoBarGenerics.saveResumePoints() return 0
def runScreenTest(): config.misc.startCounter.value += 1 config.misc.startCounter.save() profile("readPluginList") enigma.pauseInit() plugins.readPluginList(resolveFilename(SCOPE_PLUGINS)) enigma.resumeInit() profile("Init:Session") nav = Navigation(config.misc.isNextRecordTimerAfterEventActionAuto.value, config.misc.isNextPowerTimerAfterEventActionAuto.value) session = Session(desktop=enigma.getDesktop(0), summary_desktop=enigma.getDesktop(1), navigation=nav) CiHandler.setSession(session) screensToRun = [ p.__call__ for p in plugins.getPlugins(PluginDescriptor.WHERE_WIZARD) ] profile("wizards") screensToRun += wizardManager.getWizards() screensToRun.append((100, InfoBar.InfoBar)) screensToRun.sort() enigma.ePythonConfigQuery.setQueryFunc(configfile.getResolvedKey) def runNextScreen(session, screensToRun, *result): if result: if result[0] == "reloadskin": skin.InitSkins(False) session.openWithCallback( boundFunction(runNextScreen, session, []), InfoBar.InfoBar) if result[1]: session.deleteDialog(result[1]) else: enigma.quitMainloop(*result) else: screen = screensToRun[0][1] args = screensToRun[0][2:] session.openWithCallback( boundFunction(runNextScreen, session, screensToRun[1:]), screen, *args) runNextScreen(session, screensToRun) profile("Init:VolumeControl") vol = VolumeControl(session) profile("Init:PowerKey") power = PowerKey(session) # we need session.scart to access it from within menu.xml session.scart = AutoScartControl(session) profile("Init:Trashcan") import Tools.Trashcan Tools.Trashcan.init(session) profile("Init:AutoVideoMode") import Screens.VideoMode Screens.VideoMode.autostart(session) profile("RunReactor") profile_final() runReactor() profile("wakeup") #get currentTime nowTime = time() wakeupList = [ x for x in ( (session.nav.RecordTimer.getNextRecordingTime(), 0, session.nav.RecordTimer.isNextRecordAfterEventActionAuto()), (session.nav.RecordTimer.getNextZapTime(), 1), (plugins.getNextWakeupTime(), 2), (session.nav.PowerTimer.getNextPowerManagerTime(), 3, session.nav.PowerTimer.isNextPowerManagerAfterEventActionAuto())) if x[0] != -1 ] wakeupList.sort() recordTimerWakeupAuto = False if wakeupList and wakeupList[0][1] != 3: startTime = wakeupList[0] if (startTime[0] - nowTime) < 270: # no time to switch box back on wptime = nowTime + 30 # so switch back on in 30 seconds else: wptime = startTime[0] - 240 if not config.misc.SyncTimeUsing.value == "0": print "[StartEnigma] dvb time sync disabled... so set RTC now to current linux time!", strftime( "%Y/%m/%d %H:%M", localtime(nowTime)) setRTCtime(nowTime) print "[StartEnigma] set wakeup time to", strftime( "%Y/%m/%d %H:%M", localtime(wptime)) setFPWakeuptime(wptime) recordTimerWakeupAuto = startTime[1] == 0 and startTime[2] print '[StartEnigma] recordTimerWakeupAuto', recordTimerWakeupAuto config.misc.isNextRecordTimerAfterEventActionAuto.value = recordTimerWakeupAuto config.misc.isNextRecordTimerAfterEventActionAuto.save() PowerTimerWakeupAuto = False if wakeupList and wakeupList[0][1] == 3: startTime = wakeupList[0] if (startTime[0] - nowTime) < 60: # no time to switch box back on wptime = nowTime + 30 # so switch back on in 30 seconds else: wptime = startTime[0] if not config.misc.SyncTimeUsing.value == "0": print "[StartEnigma] dvb time sync disabled... so set RTC now to current linux time!", strftime( "%Y/%m/%d %H:%M", localtime(nowTime)) setRTCtime(nowTime) print "[StartEnigma] set wakeup time to", strftime( "%Y/%m/%d %H:%M", localtime(wptime + 60)) setFPWakeuptime(wptime) PowerTimerWakeupAuto = startTime[1] == 3 and startTime[2] print '[StartEnigma] PowerTimerWakeupAuto', PowerTimerWakeupAuto config.misc.isNextPowerTimerAfterEventActionAuto.value = PowerTimerWakeupAuto config.misc.isNextPowerTimerAfterEventActionAuto.save() profile("stopService") session.nav.stopService() profile("nav shutdown") session.nav.shutdown() profile("configfile.save") configfile.save() from Screens import InfoBarGenerics InfoBarGenerics.saveResumePoints() return 0
from Tools.Profile import profile from Tools.BoundFunction import boundFunction from enigma import eServiceReference # workaround for required config entry dependencies. import Screens.MovieSelection from Screens.Screen import Screen from Screens.MessageBox import MessageBox from Components.Label import Label from Components.Pixmap import MultiPixmap profile("LOAD:enigma") import enigma from boxbranding import getBoxType, getMachineBrand, getBrandOEM boxtype = getBoxType() profile("LOAD:InfoBarGenerics") from Screens.InfoBarGenerics import InfoBarShowHide, \ InfoBarNumberZap, InfoBarChannelSelection, InfoBarMenu, InfoBarRdsDecoder, \ InfoBarEPG, InfoBarSeek, InfoBarInstantRecord, InfoBarRedButton, InfoBarTimerButton, InfoBarVmodeButton, \ InfoBarAudioSelection, InfoBarAdditionalInfo, InfoBarNotifications, InfoBarDish, InfoBarUnhandledKey, \ InfoBarSubserviceSelection, InfoBarShowMovies, InfoBarLongKeyDetection, \ InfoBarServiceNotifications, InfoBarPVRState, InfoBarCueSheetSupport, \ InfoBarSummarySupport, InfoBarMoviePlayerSummarySupport, InfoBarTimeshiftState, InfoBarTeletextPlugin, InfoBarExtensions, \ InfoBarSubtitleSupport, InfoBarSleepTimer, InfoBarOpenOnTopHelper, InfoBarPowersaver, InfoBarPiP, InfoBarPlugins, InfoBarServiceErrorPopupSupport, InfoBarJobman, InfoBarZoom, InfoBarHdmi, \ setResumePoint, delResumePoint from Screens.Hotkey import InfoBarHotkey profile("LOAD:InitBar_Components") from Components.ActionMap import HelpableActionMap
from Tools.Profile import profile from Tools.BoundFunction import boundFunction from enigma import eServiceReference # workaround for required config entry dependencies. import Screens.MovieSelection from Screens.Screen import Screen from Screens.MessageBox import MessageBox from Components.Label import Label from Components.Pixmap import MultiPixmap profile("LOAD:enigma") import enigma from boxbranding import getBoxType, getMachineBrand,getBrandOEM boxtype = getBoxType() profile("LOAD:InfoBarGenerics") from Screens.InfoBarGenerics import InfoBarShowHide, \ InfoBarNumberZap, InfoBarChannelSelection, InfoBarMenu, InfoBarRdsDecoder, \ InfoBarEPG, InfoBarSeek, InfoBarInstantRecord, InfoBarRedButton, InfoBarTimerButton, InfoBarVmodeButton, InfoBarResolutionSelection, InfoBarAspectSelection, \ InfoBarAudioSelection, InfoBarAdditionalInfo, InfoBarNotifications, InfoBarDish, InfoBarUnhandledKey, \ InfoBarSubserviceSelection, InfoBarShowMovies, InfoBarLongKeyDetection, \ InfoBarServiceNotifications, InfoBarPVRState, InfoBarCueSheetSupport, \ InfoBarSummarySupport, InfoBarMoviePlayerSummarySupport, InfoBarTimeshiftState, InfoBarTeletextPlugin, InfoBarExtensions, \ InfoBarSubtitleSupport, InfoBarSleepTimer, InfoBarPiP, InfoBarPlugins, InfoBarServiceErrorPopupSupport, InfoBarJobman, InfoBarZoom, InfoBarHdmi, InfoBarOpenOnTopHelper,\ setResumePoint, delResumePoint from Screens.Hotkey import InfoBarHotkey profile("LOAD:InitBar_Components") from Components.ActionMap import HelpableActionMap
import sys import os if os.path.isfile("/usr/lib/enigma2/python/enigma.zip"): sys.path.append("/usr/lib/enigma2/python/enigma.zip") from Tools.Profile import profile, profile_final profile("PYTHON_START") # Don't remove this line. It may seem to do nothing, but if removed, # it will break output redirection for crash logs. import Tools.RedirectOutput import enigma import eConsoleImpl import eBaseImpl enigma.eTimer = eBaseImpl.eTimer enigma.eSocketNotifier = eBaseImpl.eSocketNotifier enigma.eConsoleAppContainer = eConsoleImpl.eConsoleAppContainer from traceback import print_exc profile("SetupDevices") import Components.SetupDevices Components.SetupDevices.InitSetupDevices() profile("SimpleSummary") from Screens import InfoBar from Screens.SimpleSummary import SimpleSummary from sys import stdout profile("Bouquets")
def runScreenTest(): config.misc.startCounter.value += 1 config.misc.startCounter.save() profile("readPluginList") enigma.pauseInit() plugins.readPluginList(resolveFilename(SCOPE_PLUGINS)) enigma.resumeInit() profile("Init:Session") nav = Navigation() session = Session(desktop = enigma.getDesktop(0), summary_desktop = enigma.getDesktop(1), navigation = nav) CiHandler.setSession(session) screensToRun = [ p.__call__ for p in plugins.getPlugins(PluginDescriptor.WHERE_WIZARD) ] profile("wizards") screensToRun += wizardManager.getWizards() screensToRun.append((100, InfoBar.InfoBar)) screensToRun.sort() enigma.ePythonConfigQuery.setQueryFunc(configfile.getResolvedKey) def runNextScreen(session, screensToRun, *result): if result: enigma.quitMainloop(*result) return screen = screensToRun[0][1] args = screensToRun[0][2:] if screensToRun: session.openWithCallback(boundFunction(runNextScreen, session, screensToRun[1:]), screen, *args) else: session.open(screen, *args) config.misc.epgcache_filename.addNotifier(setEPGCachePath) runNextScreen(session, screensToRun) profile("Init:VolumeControl") vol = VolumeControl(session) profile("Init:PowerKey") power = PowerKey(session) # we need session.scart to access it from within menu.xml session.scart = AutoScartControl(session) profile("Init:Trashcan") import Tools.Trashcan Tools.Trashcan.init(session) profile("RunReactor") profile_final() runReactor() profile("wakeup") from time import time, strftime, localtime from Tools.StbHardware import setFPWakeuptime, setRTCtime from Screens.SleepTimerEdit import isNextWakeupTime #get currentTime nowTime = time() wakeupList = [ x for x in ((session.nav.RecordTimer.getNextRecordingTime(), 0), (session.nav.RecordTimer.getNextZapTime(isWakeup=True), 1), (plugins.getNextWakeupTime(), 2), (isNextWakeupTime(), 3)) if x[0] != -1 ] wakeupList.sort() if wakeupList: from time import strftime startTime = wakeupList[0] if (startTime[0] - nowTime) < 270: # no time to switch box back on wptime = nowTime + 30 # so switch back on in 30 seconds else: wptime = startTime[0] - 240 if not config.misc.useTransponderTime.value: print "dvb time sync disabled... so set RTC now to current linux time!", strftime("%Y/%m/%d %H:%M", localtime(nowTime)) setRTCtime(nowTime) print "set wakeup time to", strftime("%Y/%m/%d %H:%M", localtime(wptime)) setFPWakeuptime(wptime) config.misc.prev_wakeup_time.value = int(startTime[0]) config.misc.prev_wakeup_time_type.value = startTime[1] config.misc.prev_wakeup_time_type.save() else: config.misc.prev_wakeup_time.value = 0 config.misc.prev_wakeup_time.save() profile("stopService") session.nav.stopService() profile("nav shutdown") session.nav.shutdown() profile("configfile.save") configfile.save() from Screens import InfoBarGenerics InfoBarGenerics.saveResumePoints() return 0
def runScreenTest(): config.misc.startCounter.value += 1 config.misc.startCounter.save() profile("readPluginList") enigma.pauseInit() plugins.readPluginList(resolveFilename(SCOPE_PLUGINS)) enigma.resumeInit() profile("Init:Session") nav = Navigation() session = Session(desktop=enigma.getDesktop(0), summary_desktop=enigma.getDesktop(1), navigation=nav) CiHandler.setSession(session) screensToRun = [ p.__call__ for p in plugins.getPlugins(PluginDescriptor.WHERE_WIZARD) ] profile("wizards") screensToRun += wizardManager.getWizards() screensToRun.append((100, InfoBar.InfoBar)) screensToRun.sort() enigma.ePythonConfigQuery.setQueryFunc(configfile.getResolvedKey) def runNextScreen(session, screensToRun, *result): if result: enigma.quitMainloop(*result) return screen = screensToRun[0][1] args = screensToRun[0][2:] if screensToRun: session.openWithCallback( boundFunction(runNextScreen, session, screensToRun[1:]), screen, *args) else: session.open(screen, *args) config.misc.epgcache_filename.addNotifier(setEPGCachePath) runNextScreen(session, screensToRun) profile("Init:VolumeControl") vol = VolumeControl(session) profile("Init:PowerKey") power = PowerKey(session) from Components.SystemInfo import SystemInfo from enigma import getBoxType if SystemInfo["FirstCheckModel"] or SystemInfo[ "SecondCheckModel"] or SystemInfo["HiSilicon"] or SystemInfo[ "DifferentLCDSettings"] or getBoxType() in ( "alphatriplehd", "tmtwin4k", "osminiplus", "sf3038", "spycat", "et7x00", "ebox5000", "ebox7358", "eboxlumi", "ebox5000", "maram9", "sezam5000hd", "mbtwin", "sezam1000hd", "mbmini", "atemio5x00", "beyonwizt3"): profile("VFDSYMBOLS") import Components.VfdSymbols Components.VfdSymbols.SymbolsCheck(session) # we need session.scart to access it from within menu.xml session.scart = AutoScartControl(session) profile("Init:Trashcan") import Tools.Trashcan Tools.Trashcan.init(session) profile("RunReactor") profile_final() runReactor() profile("wakeup") from time import time, strftime, localtime from Tools.StbHardware import setFPWakeuptime, setRTCtime from Screens.SleepTimerEdit import isNextWakeupTime #get currentTime nowTime = time() wakeupList = [ x for x in ((session.nav.RecordTimer.getNextRecordingTime(), 0), (session.nav.RecordTimer.getNextZapTime(isWakeup=True), 1), (plugins.getNextWakeupTime(), 2), (isNextWakeupTime(), 3)) if x[0] != -1 ] wakeupList.sort() if wakeupList: from time import strftime startTime = wakeupList[0] if (startTime[0] - nowTime) < 270: # no time to switch box back on wptime = nowTime + 30 # so switch back on in 30 seconds else: wptime = startTime[0] - 240 if not config.misc.useTransponderTime.value: print "dvb time sync disabled... so set RTC now to current linux time!", strftime( "%Y/%m/%d %H:%M", localtime(nowTime)) setRTCtime(nowTime) print "set wakeup time to", strftime("%Y/%m/%d %H:%M", localtime(wptime)) setFPWakeuptime(wptime) config.misc.prev_wakeup_time.value = int(startTime[0]) config.misc.prev_wakeup_time_type.value = startTime[1] config.misc.prev_wakeup_time_type.save() else: config.misc.prev_wakeup_time.value = 0 config.misc.prev_wakeup_time.save() profile("stopService") session.nav.stopService() profile("nav shutdown") session.nav.shutdown() profile("configfile.save") configfile.save() from Screens import InfoBarGenerics InfoBarGenerics.saveResumePoints() return 0
def runScreenTest(): config.misc.startCounter.value += 1 profile("readPluginList") plugins.readPluginList(resolveFilename(SCOPE_PLUGINS)) profile("Init:Session") nav = Navigation(config.misc.nextWakeup.value) session = Session(desktop = enigma.getDesktop(0), summary_desktop = enigma.getDesktop(1), navigation = nav) CiHandler.setSession(session) profile("wizards") screensToRun = [] RestoreSettings = None if os.path.exists("/media/hdd/images/config/settings") and config.misc.firstrun.value: if autorestoreLoop(): RestoreSettings = True from Plugins.SystemPlugins.SoftwareManager.BackupRestore import RestoreScreen session.open(RestoreScreen, runRestore = True) else: screensToRun = [ p.__call__ for p in plugins.getPlugins(PluginDescriptor.WHERE_WIZARD) ] screensToRun += wizardManager.getWizards() else: if os.path.exists("/media/hdd/images/config/autorestore"): os.system('rm -f /media/hdd/images/config/autorestore') screensToRun = [ p.__call__ for p in plugins.getPlugins(PluginDescriptor.WHERE_WIZARD) ] screensToRun += wizardManager.getWizards() screensToRun.append((100, InfoBar.InfoBar)) screensToRun.sort() print screensToRun enigma.ePythonConfigQuery.setQueryFunc(configfile.getResolvedKey) def runNextScreen(session, screensToRun, *result): if result: print "[mytest.py] quitMainloop #3" enigma.quitMainloop(*result) return screen = screensToRun[0][1] args = screensToRun[0][2:] if screensToRun: session.openWithCallback(boundFunction(runNextScreen, session, screensToRun[1:]), screen, *args) else: session.open(screen, *args) if not RestoreSettings: runNextScreen(session, screensToRun) profile("Init:VolumeControl") vol = VolumeControl(session) profile("Init:PowerKey") power = PowerKey(session) if boxtype in ('osnino','osninoplus','alphatriple','spycat4kmini','tmtwin4k','mbmicrov2','revo4k','force3uhd','wetekplay', 'wetekplay2', 'wetekhub', 'dm7020hd', 'dm7020hdv2', 'osminiplus', 'osmega', 'sf3038', 'spycat', 'e4hd', 'e4hdhybrid', 'mbmicro', 'et7500', 'mixosf5', 'mixosf7', 'mixoslumi', 'gi9196m', 'maram9', 'ixussone', 'ixusszero', 'uniboxhd1', 'uniboxhd2', 'uniboxhd3', 'sezam5000hd', 'mbtwin', 'sezam1000hd', 'mbmini', 'atemio5x00', 'beyonwizt3', '9910lx', '9911lx') or getBrandOEM() in ('fulan') or getMachineBuild() in ('dags7362' , 'dags73625', 'dags5'): profile("VFDSYMBOLS") import Components.VfdSymbols Components.VfdSymbols.SymbolsCheck(session) # we need session.scart to access it from within menu.xml session.scart = AutoScartControl(session) profile("Init:Trashcan") import Tools.Trashcan Tools.Trashcan.init(session) profile("Init:AutoVideoMode") import Screens.VideoMode Screens.VideoMode.autostart(session) profile("RunReactor") profile_final() if boxtype in ('sf8', 'classm', 'axodin', 'axodinc', 'starsatlx', 'genius', 'evo'): f = open("/dev/dbox/oled0", "w") f.write('-E2-') f.close() print "lastshutdown=%s (True = last shutdown was OK)" % config.usage.shutdownOK.value print "NOK shutdown action=%s" % config.usage.shutdownNOK_action.value print "bootup action=%s" % config.usage.boot_action.value if not config.usage.shutdownOK.value and not config.usage.shutdownNOK_action.value == 'normal' or not config.usage.boot_action.value == 'normal': print "last shutdown = %s" % config.usage.shutdownOK.value import Screens.PowerLost Screens.PowerLost.PowerLost(session) if not RestoreSettings: config.usage.shutdownOK.setValue(False) config.usage.shutdownOK.save() configfile.save() # kill showiframe if it is running (sh4 hack...) if getMachineBuild() in ('spark' , 'spark7162'): os.system("killall -9 showiframe") runReactor() print "[mytest.py] normal shutdown" config.misc.startCounter.save() config.usage.shutdownOK.setValue(True) config.usage.shutdownOK.save() profile("wakeup") #get currentTime nowTime = time() # if not config.misc.SyncTimeUsing.value == "0" or getBrandOEM() == 'gigablue': if not config.misc.SyncTimeUsing.value == "0" or boxtype.startswith('gb') or getBrandOEM().startswith('ini'): print "dvb time sync disabled... so set RTC now to current linux time!", strftime("%Y/%m/%d %H:%M", localtime(nowTime)) setRTCtime(nowTime) #recordtimer if session.nav.isRecordTimerImageStandard: #check RecordTimer instance tmp = session.nav.RecordTimer.getNextRecordingTime(getNextStbPowerOn = True) nextRecordTime = tmp[0] nextRecordTimeInStandby = tmp[1] else: nextRecordTime = session.nav.RecordTimer.getNextRecordingTime() nextRecordTimeInStandby = session.nav.RecordTimer.isNextRecordAfterEventActionAuto() #zaptimer nextZapTime = session.nav.RecordTimer.getNextZapTime() nextZapTimeInStandby = 0 #powertimer tmp = session.nav.PowerTimer.getNextPowerManagerTime(getNextStbPowerOn = True) nextPowerTime = tmp[0] nextPowerTimeInStandby = tmp[1] #plugintimer tmp = plugins.getNextWakeupTime(getPluginIdent = True) nextPluginTime = tmp[0] nextPluginIdent = tmp[1] #"pluginname | pluginfolder" tmp = tmp[1].lower() #start in standby, depending on plugin type if "epgrefresh" in tmp: nextPluginName = "EPGRefresh" nextPluginTimeInStandby = 1 elif "vps" in tmp: nextPluginName = "VPS" nextPluginTimeInStandby = 1 elif "serienrecorder" in tmp: nextPluginName = "SerienRecorder" nextPluginTimeInStandby = 0 # plugin function for deep standby from standby not compatible (not available) elif "elektro" in tmp: nextPluginName = "Elektro" nextPluginTimeInStandby = 1 elif "minipowersave" in tmp: nextPluginName = "MiniPowersave" nextPluginTimeInStandby = 1 elif "enhancedpowersave" in tmp: nextPluginName = "EnhancedPowersave" nextPluginTimeInStandby = 1 else: #default for plugins nextPluginName = nextPluginIdent nextPluginTimeInStandby = 0 wakeupList = [ x for x in ((nextRecordTime, 0, nextRecordTimeInStandby), (nextZapTime, 1, nextZapTimeInStandby), (nextPowerTime, 2, nextPowerTimeInStandby), (nextPluginTime, 3, nextPluginTimeInStandby)) if x[0] != -1 ] wakeupList.sort() print "="*100 if wakeupList and wakeupList[0][0] > 0: startTime = wakeupList[0] # wakeup time before timer begins wptime = startTime[0] - (config.workaround.wakeuptime.value * 60) if (wptime - nowTime) < 120: # no time to switch box back on wptime = int(nowTime) + 120 # so switch back on in 120 seconds #check for plugin-, zap- or power-timer to enable the 'forced' record-timer wakeup forceNextRecord = 0 setStandby = startTime[2] if startTime[1] != 0 and nextRecordTime > 0: #when next record starts in 15 mins if abs(nextRecordTime - startTime[0]) <= 900: setStandby = forceNextRecord = 1 #by vps-plugin elif startTime[1] == 3 and nextPluginName == "VPS": setStandby = forceNextRecord = 1 if startTime[1] == 3: nextPluginName = " (%s)" % nextPluginName else: nextPluginName = "" print "[mytest.py] set next wakeup type to '%s'%s %s" % ({0:"record-timer",1:"zap-timer",2:"power-timer",3:"plugin-timer"}[startTime[1]], nextPluginName, {0:"and starts normal",1:"and starts in standby"}[setStandby]) if forceNextRecord: print "[mytest.py] set from 'vps-plugin' or just before a 'record-timer' starts, set 'record-timer' wakeup flag" print "[mytest.py] set next wakeup time to", strftime("%a, %Y/%m/%d %H:%M:%S", localtime(wptime)) #set next wakeup setFPWakeuptime(wptime) #set next standby only after shutdown in deep standby if Screens.Standby.quitMainloopCode != 1 and Screens.Standby.quitMainloopCode != 45: setStandby = 2 # 0=no standby, but get in standby if wakeup to timer start > 60 sec (not for plugin-timer, here is no standby), 1=standby, 2=no standby, when before was not in deep-standby config.misc.nextWakeup.value = "%d,%d,%d,%d,%d,%d" % (wptime,startTime[0],startTime[1],setStandby,nextRecordTime,forceNextRecord) else: config.misc.nextWakeup.value = "-1,-1,0,0,-1,0" if not boxtype.startswith('azboxm'): #skip for Azbox (mini)ME - setting wakeup time to past reboots box setFPWakeuptime(int(nowTime) - 3600) #minus one hour -> overwrite old wakeup time print "[mytest.py] no set next wakeup time" config.misc.nextWakeup.save() print "="*100 profile("stopService") session.nav.stopService() profile("nav shutdown") session.nav.shutdown() profile("configfile.save") configfile.save() from Screens import InfoBarGenerics InfoBarGenerics.saveResumePoints() return 0
from Tools.Profile import profile profile("LOAD:ElementTree") import xml.etree.cElementTree import os profile("LOAD:enigma_skin") from enigma import eSize, ePoint, eRect, gFont, eWindow, eLabel, ePixmap, eWindowStyleManager, addFont, gRGB, eWindowStyleSkinned, getDesktop from Components.config import ConfigSubsection, ConfigText, config from Components.Sources.Source import ObsoleteSource from Tools.Directories import resolveFilename, SCOPE_SKIN, SCOPE_SKIN_IMAGE, SCOPE_FONTS, SCOPE_ACTIVE_SKIN, SCOPE_ACTIVE_LCDSKIN, SCOPE_CURRENT_SKIN, SCOPE_CONFIG, fileExists from Tools.Import import my_import from Tools.LoadPixmap import LoadPixmap from Components.RcModel import rc_model colorNames = {} switchPixmap = {} # dict() # Predefined fonts, typically used in built-in screens and for components like # the movie list and so. fonts = { "Body": ("Regular", 18, 22, 16), "ChoiceList": ("Regular", 20, 24, 18), } parameters = {} def dump(x, i=0): print " " * i + str(x) try: for n in x.childNodes: dump(n, i + 1)
def runScreenTest(): config.misc.startCounter.value += 1 config.misc.startCounter.save() #Let's Disable it for a while #config.usage.async_plug_load.value = False if config.usage.async_plug_load.value and os.path.isfile("/usr/lib/enigma2/python/Plugins/SystemPlugins/EGAMIPluginSpeedUp/plugin.pyo"): profile("readBaseList") plugins.loadBasePlugins(resolveFilename(SCOPE_PLUGINS)) else: profile("readPluginList") plugins.readPluginList(resolveFilename(SCOPE_PLUGINS)) profile("Init:Session") nav = Navigation(config.misc.nextWakeup.value) session = Session(desktop = enigma.getDesktop(0), summary_desktop = enigma.getDesktop(1), navigation = nav) CiHandler.setSession(session) screensToRun = [ p.__call__ for p in plugins.getPlugins(PluginDescriptor.WHERE_WIZARD) ] profile("wizards") screensToRun += wizardManager.getWizards() screensToRun.append((100, InfoBar.InfoBar)) screensToRun.sort() enigma.ePythonConfigQuery.setQueryFunc(configfile.getResolvedKey) def runNextScreen(session, screensToRun, *result): if result: print "[mytest.py] quitMainloop #3" enigma.quitMainloop(*result) return screen = screensToRun[0][1] args = screensToRun[0][2:] if screensToRun: session.openWithCallback(boundFunction(runNextScreen, session, screensToRun[1:]), screen, *args) else: session.open(screen, *args) runNextScreen(session, screensToRun) profile("Init:VolumeControl") vol = VolumeControl(session) profile("Init:PowerKey") power = PowerKey(session) if boxtype in ('wetekplay', 'wetekplayplus', 'mbtwinplus', 'sf3038', 'spycat', 'e4hd', 'mbmicro', 'et7500', 'mixosf5', 'mixosf7', 'mixoslumi', 'gi9196m', 'maram9', 'ixussone', 'ixussone', 'uniboxhd1', 'uniboxhd2', 'uniboxhd3', 'sezam5000hd', 'mbtwin', 'sezam1000hd', 'mbmini', 'atemio5x00', 'beyonwizt3') or getBrandOEM() in ('fulan'): profile("VFDSYMBOLS") import Components.VfdSymbols Components.VfdSymbols.SymbolsCheck(session) # we need session.scart to access it from within menu.xml session.scart = AutoScartControl(session) profile("Init:Trashcan") import Tools.Trashcan Tools.Trashcan.init(session) profile("Init:AutoVideoMode") import Screens.VideoMode Screens.VideoMode.autostart(session) profile("RunReactor") profile_final() if boxtype in ('sf8', 'classm', 'axodin', 'axodinc', 'starsatlx', 'genius', 'evo'): f = open("/dev/dbox/oled0", "w") f.write('-E2-') f.close() print "lastshutdown=%s (True = last shutdown was OK)" % config.usage.shutdownOK.value print "NOK shutdown action=%s" % config.usage.shutdownNOK_action.value print "bootup action=%s" % config.usage.boot_action.value if not config.usage.shutdownOK.value and not config.usage.shutdownNOK_action.value == 'normal' or not config.usage.boot_action.value == 'normal': print "last shutdown = %s" % config.usage.shutdownOK.value import Screens.PowerLost Screens.PowerLost.PowerLost(session) config.usage.shutdownOK.setValue(False) config.usage.shutdownOK.save() configfile.save() runReactor() print "[mytest.py] normal shutdown" config.misc.startCounter.save() config.usage.shutdownOK.setValue(True) config.usage.shutdownOK.save() profile("wakeup") #get currentTime nowTime = time() # if not config.misc.SyncTimeUsing.value == "0" or getBrandOEM() == 'gigablue': if not config.misc.SyncTimeUsing.value == "0" or boxtype.startswith('gb') or getBrandOEM().startswith('ini'): print "dvb time sync disabled... so set RTC now to current linux time!", strftime("%Y/%m/%d %H:%M", localtime(nowTime)) setRTCtime(nowTime) #recordtimer if session.nav.isRecordTimerImageStandard: #check RecordTimer instance tmp = session.nav.RecordTimer.getNextRecordingTime(getNextStbPowerOn = True) nextRecordTime = tmp[0] nextRecordTimeInStandby = tmp[1] else: nextRecordTime = session.nav.RecordTimer.getNextRecordingTime() nextRecordTimeInStandby = session.nav.RecordTimer.isNextRecordAfterEventActionAuto() #zaptimer nextZapTime = session.nav.RecordTimer.getNextZapTime() nextZapTimeInStandby = 0 #powertimer tmp = session.nav.PowerTimer.getNextPowerManagerTime(getNextStbPowerOn = True) nextPowerTime = tmp[0] nextPowerTimeInStandby = tmp[1] #plugintimer tmp = plugins.getNextWakeupTime(getPluginIdent = True) nextPluginTime = tmp[0] nextPluginIdent = tmp[1] #"pluginname | pluginfolder" tmp = tmp[1].lower() #start in standby, depending on plugin type if "epgrefresh" in tmp: nextPluginName = "EPGRefresh" nextPluginTimeInStandby = 1 elif "vps" in tmp: nextPluginName = "VPS" nextPluginTimeInStandby = 1 elif "serienrecorder" in tmp: nextPluginName = "SerienRecorder" nextPluginTimeInStandby = 0 # plugin function for deep standby from standby not compatible (not available) elif "elektro" in tmp: nextPluginName = "Elektro" nextPluginTimeInStandby = 1 elif "minipowersave" in tmp: nextPluginName = "MiniPowersave" nextPluginTimeInStandby = 1 elif "enhancedpowersave" in tmp: nextPluginName = "EnhancedPowersave" nextPluginTimeInStandby = 1 else: #default for plugins nextPluginName = nextPluginIdent nextPluginTimeInStandby = 0 wakeupList = [ x for x in ((nextRecordTime, 0, nextRecordTimeInStandby), (nextZapTime, 1, nextZapTimeInStandby), (nextPowerTime, 2, nextPowerTimeInStandby), (nextPluginTime, 3, nextPluginTimeInStandby)) if x[0] != -1 ] wakeupList.sort() # individual wakeup time offset if config.workaround.wakeuptimeoffset.value == "standard": if boxtype.startswith("gb"): wpoffset = -120 # Gigaboxes already starts 2 min. before wakeup time else: wpoffset = 0 else: wpoffset = int(config.workaround.wakeuptimeoffset.value) print "="*100 if wakeupList and wakeupList[0][0] > 0: startTime = wakeupList[0] # wakeup time is 5 min before timer starts + offset wptime = startTime[0] - 300 - wpoffset if (wptime - nowTime) < 120: # no time to switch box back on wptime = int(nowTime) + 120 # so switch back on in 120 seconds #check for plugin-, zap- or power-timer to enable the 'forced' record-timer wakeup forceNextRecord = 0 setStandby = startTime[2] if startTime[1] != 0 and nextRecordTime > 0: #when next record starts in 15 mins if abs(nextRecordTime - startTime[0]) <= 900: setStandby = forceNextRecord = 1 #by vps-plugin elif startTime[1] == 3 and nextPluginName == "VPS": setStandby = forceNextRecord = 1 if startTime[1] == 3: nextPluginName = " (%s)" % nextPluginName else: nextPluginName = "" print "[mytest.py] set next wakeup type to '%s'%s %s" % ({0:"record-timer",1:"zap-timer",2:"power-timer",3:"plugin-timer"}[startTime[1]], nextPluginName, {0:"and starts normal",1:"and starts in standby"}[setStandby]) if forceNextRecord: print "[mytest.py] set from 'vps-plugin' or just before a 'record-timer' starts, set 'record-timer' wakeup flag" print "[mytest.py] set next wakeup time to", strftime("%a, %Y/%m/%d %H:%M:%S", localtime(wptime)) #set next wakeup setFPWakeuptime(wptime) #set next standby only after shutdown in deep standby if Screens.Standby.quitMainloopCode != 1 and Screens.Standby.quitMainloopCode != 45: setStandby = 2 # 0=no standby, but get in standby if wakeup to timer start > 60 sec (not for plugin-timer, here is no standby), 1=standby, 2=no standby, when before was not in deep-standby config.misc.nextWakeup.value = "%d,%d,%d,%d,%d,%d" % (wptime,startTime[0],startTime[1],setStandby,nextRecordTime,forceNextRecord) else: config.misc.nextWakeup.value = "-1,-1,0,0,-1,0" print "[mytest.py] no set next wakeup time" config.misc.nextWakeup.save() print "="*100 profile("stopService") session.nav.stopService() profile("nav shutdown") session.nav.shutdown() profile("configfile.save") configfile.save() from Screens import InfoBarGenerics InfoBarGenerics.saveResumePoints() return 0
#!/usr/bin/python # -*- coding: utf-8 -*- from __future__ import print_function from Tools.Profile import profile from enigma import eServiceReference, getBoxType, getBoxBrand from Tools.StbHardware import getBoxProc from Tools.Directories import fileExists # workaround for required config entry dependencies. import Screens.MovieSelection from Screens.Screen import Screen from Screens.MessageBox import MessageBox profile("LOAD:enigma") import enigma import os profile("LOAD:InfoBarGenerics") from Screens.InfoBarGenerics import InfoBarShowHide, \ InfoBarNumberZap, InfoBarChannelSelection, InfoBarMenu, InfoBarRdsDecoder, InfoBarResolutionSelection, InfoBarAspectSelection, \ InfoBarEPG, InfoBarSeek, InfoBarInstantRecord, InfoBarRedButton, InfoBarTimerButton, InfoBarVmodeButton, \ InfoBarAudioSelection, InfoBarAdditionalInfo, InfoBarNotifications, InfoBarDish, InfoBarUnhandledKey, \ InfoBarSubserviceSelection, InfoBarShowMovies, InfoBarTimeshift, \ InfoBarServiceNotifications, InfoBarPVRState, InfoBarCueSheetSupport, InfoBarBuffer, \ InfoBarSummarySupport, InfoBarMoviePlayerSummarySupport, InfoBarTimeshiftState, InfoBarTeletextPlugin, InfoBarExtensions, \ InfoBarSubtitleSupport, InfoBarPiP, InfoBarPlugins, InfoBarServiceErrorPopupSupport, InfoBarJobman, InfoBarZoom, InfoBarPowersaver, \ InfoBarHDMI, InfoBarHdmi2, setResumePoint, delResumePoint from Screens.Hotkey import InfoBarHotkey profile("LOAD:InitBar_Components") from Components.ActionMap import HelpableActionMap
from Tools.Profile import profile profile('LOAD:ElementTree') import xml.etree.cElementTree import os profile('LOAD:enigma_skin') from enigma import eSize, ePoint, eRect, gFont, eWindow, eLabel, ePixmap, eWindowStyleManager, addFont, gRGB, eWindowStyleSkinned, getDesktop from Components.config import ConfigSubsection, ConfigText, config from Components.Converter.Converter import Converter from Components.Sources.Source import Source, ObsoleteSource from Tools.Directories import resolveFilename, SCOPE_SKIN, SCOPE_FONTS, SCOPE_CURRENT_SKIN, SCOPE_CONFIG, fileExists, SCOPE_SKIN_IMAGE from Tools.Import import my_import from Tools.LoadPixmap import LoadPixmap from Components.RcModel import rc_model colorNames = {} fonts = {'Body': ('Regular', 18, 22, 16), 'ChoiceList': ('Regular', 20, 24, 18)} parameters = {} def dump(x, i = 0): print ' ' * i + str(x) try: for n in x.childNodes: dump(n, i + 1) except: None class SkinError(Exception): def __init__(self, message):
import sys import os from time import time if os.path.isfile("/usr/lib/enigma2/python/enigma.zip"): sys.path.append("/usr/lib/enigma2/python/enigma.zip") from Tools.Profile import profile, profile_final profile("PYTHON_START") # Don't remove this line. It may seem to do nothing, but if removed, # it will break output redirection for crash logs. import Tools.RedirectOutput from boxbranding import getImageVersion, getImageBuild, getImageDevBuild, getImageType, getImageArch print "[Image Type] %s" % getImageType() print "[Image Version] %s" % getImageVersion() print "[Image Build] %s" % getImageBuild() if getImageType() != 'release': print "[Image DevBuild] %s" % getImageDevBuild() import enigma import eConsoleImpl import eBaseImpl enigma.eTimer = eBaseImpl.eTimer enigma.eSocketNotifier = eBaseImpl.eSocketNotifier enigma.eConsoleAppContainer = eConsoleImpl.eConsoleAppContainer if getImageArch() in ("aarch64"): import usb.core import usb.backend.libusb1 usb.backend.libusb1.get_backend(
def runScreenTest(): config.misc.startCounter.value += 1 config.misc.startCounter.save() profile("readPluginList") plugins.readPluginList(resolveFilename(SCOPE_PLUGINS)) profile("Init:Session") nav = Navigation(config.misc.isNextRecordTimerAfterEventActionAuto.value, config.misc.isNextPowerTimerAfterEventActionAuto.value) session = Session(desktop = enigma.getDesktop(0), summary_desktop = enigma.getDesktop(1), navigation = nav) CiHandler.setSession(session) screensToRun = [ p.__call__ for p in plugins.getPlugins(PluginDescriptor.WHERE_WIZARD) ] profile("wizards") screensToRun += wizardManager.getWizards() screensToRun.append((100, InfoBar.InfoBar)) screensToRun.sort() enigma.ePythonConfigQuery.setQueryFunc(configfile.getResolvedKey) def runNextScreen(session, screensToRun, *result): if result: enigma.quitMainloop(*result) return screen = screensToRun[0][1] args = screensToRun[0][2:] if screensToRun: session.openWithCallback(boundFunction(runNextScreen, session, screensToRun[1:]), screen, *args) else: session.open(screen, *args) runNextScreen(session, screensToRun) profile("Init:VolumeControl") vol = VolumeControl(session) profile("Init:PowerKey") power = PowerKey(session) # we need session.scart to access it from within menu.xml session.scart = AutoScartControl(session) profile("Init:Trashcan") import Tools.Trashcan Tools.Trashcan.init(session) profile("Init:AutoVideoMode") import Screens.VideoMode Screens.VideoMode.autostart(session) profile("RunReactor") profile_final() runReactor() profile("wakeup") #get currentTime nowTime = time() wakeupList = [ x for x in ((session.nav.RecordTimer.getNextRecordingTime(), 0, session.nav.RecordTimer.isNextRecordAfterEventActionAuto()), (session.nav.RecordTimer.getNextZapTime(), 1), (plugins.getNextWakeupTime(), 2), (session.nav.PowerTimer.getNextPowerManagerTime(), 3, session.nav.PowerTimer.isNextPowerManagerAfterEventActionAuto())) if x[0] != -1 ] wakeupList.sort() recordTimerWakeupAuto = False if wakeupList and wakeupList[0][1] != 3: startTime = wakeupList[0] if (startTime[0] - nowTime) < 270: # no time to switch box back on wptime = nowTime + 30 # so switch back on in 30 seconds else: if getBrandOEM() == 'gigablue': wptime = startTime[0] - 120 # Gigaboxes already starts 2 min. before wakeup time else: wptime = startTime[0] - 240 if not config.misc.SyncTimeUsing.value == "0" or getBrandOEM() == 'gigablue': print "dvb time sync disabled... so set RTC now to current linux time!", strftime("%Y/%m/%d %H:%M", localtime(nowTime)) setRTCtime(nowTime) print "set wakeup time to", strftime("%Y/%m/%d %H:%M", localtime(wptime)) setFPWakeuptime(wptime) recordTimerWakeupAuto = startTime[1] == 0 and startTime[2] print 'recordTimerWakeupAuto',recordTimerWakeupAuto config.misc.isNextRecordTimerAfterEventActionAuto.value = recordTimerWakeupAuto config.misc.isNextRecordTimerAfterEventActionAuto.save() PowerTimerWakeupAuto = False if wakeupList and wakeupList[0][1] == 3: startTime = wakeupList[0] if (startTime[0] - nowTime) < 60: # no time to switch box back on wptime = nowTime + 30 # so switch back on in 30 seconds else: if getBrandOEM() == 'gigablue': wptime = startTime[0] + 120 # Gigaboxes already starts 2 min. before wakeup time else: wptime = startTime[0] if not config.misc.SyncTimeUsing.value == "0" or getBrandOEM() == 'gigablue': print "dvb time sync disabled... so set RTC now to current linux time!", strftime("%Y/%m/%d %H:%M", localtime(nowTime)) setRTCtime(nowTime) print "set wakeup time to", strftime("%Y/%m/%d %H:%M", localtime(wptime+60)) setFPWakeuptime(wptime) PowerTimerWakeupAuto = startTime[1] == 3 and startTime[2] print 'PowerTimerWakeupAuto',PowerTimerWakeupAuto config.misc.isNextPowerTimerAfterEventActionAuto.value = PowerTimerWakeupAuto config.misc.isNextPowerTimerAfterEventActionAuto.save() profile("stopService") session.nav.stopService() profile("nav shutdown") session.nav.shutdown() profile("configfile.save") configfile.save() from Screens import InfoBarGenerics InfoBarGenerics.saveResumePoints() return 0
from Tools.Profile import profile import Screens.MovieSelection from Components.PluginComponent import plugins from Plugins.Plugin import PluginDescriptor from Screens.Screen import Screen from Screens.MessageBox import MessageBox from Components.Label import Label from Components.Pixmap import MultiPixmap from Tools.Directories import fileExists from Screens.ButtonSetup import InfoBarButtonSetup profile('LOAD:enigma') import enigma from boxbranding import getBoxType, getMachineBrand, getBrandOEM, getMachineBuild, getMachineName boxtype = getBoxType() profile('LOAD:InfoBarGenerics') from Screens.InfoBarGenerics import InfoBarShowHide, InfoBarNumberZap, InfoBarChannelSelection, InfoBarMenu, InfoBarRdsDecoder, InfoBarRedButton, InfoBarTimerButton, InfoBarVmodeButton, InfoBarEPG, InfoBarSeek, InfoBarInstantRecord, InfoBarINFOpanel, InfoBarResolutionSelection, InfoBarAspectSelection, InfoBarAudioSelection, InfoBarAdditionalInfo, InfoBarNotifications, InfoBarDish, InfoBarUnhandledKey, InfoBarLongKeyDetection, InfoBarSubserviceSelection, InfoBarShowMovies, InfoBarServiceNotifications, InfoBarPVRState, InfoBarCueSheetSupport, InfoBarSimpleEventView, InfoBarBuffer, InfoBarSummarySupport, InfoBarMoviePlayerSummarySupport, InfoBarTimeshiftState, InfoBarTeletextPlugin, InfoBarExtensions, InfoBarSubtitleSupport, InfoBarPiP, InfoBarPlugins, InfoBarServiceErrorPopupSupport, InfoBarJobman, InfoBarZoom, InfoBarHdmi, setResumePoint, delResumePoint from Screens.ButtonSetup import InfoBarButtonSetup profile('LOAD:InitBar_Components') from Components.ActionMap import HelpableActionMap from Components.Timeshift import InfoBarTimeshift from Components.config import config from Components.ServiceEventTracker import ServiceEventTracker, InfoBarBase profile('LOAD:HelpableScreen') from Screens.HelpMenu import HelpableScreen class InfoBar(InfoBarBase, InfoBarShowHide, InfoBarNumberZap, InfoBarChannelSelection, InfoBarMenu, InfoBarEPG, InfoBarRdsDecoder, InfoBarInstantRecord, InfoBarAudioSelection, InfoBarRedButton, InfoBarTimerButton, InfoBarINFOpanel, InfoBarResolutionSelection, InfoBarAspectSelection, InfoBarVmodeButton, HelpableScreen, InfoBarAdditionalInfo, InfoBarNotifications, InfoBarDish, InfoBarUnhandledKey, InfoBarLongKeyDetection, InfoBarSubserviceSelection, InfoBarTimeshift, InfoBarSeek, InfoBarCueSheetSupport, InfoBarBuffer, InfoBarSummarySupport, InfoBarTimeshiftState, InfoBarTeletextPlugin, InfoBarExtensions, InfoBarPiP, InfoBarPlugins, InfoBarSubtitleSupport, InfoBarServiceErrorPopupSupport, InfoBarJobman, InfoBarZoom, InfoBarHdmi, InfoBarButtonSetup, Screen): ALLOW_SUSPEND = True instance = None def __init__(self, session): Screen.__init__(self, session)
from Tools.Profile import profile profile("LOAD:ElementTree") import xml.etree.cElementTree import os profile("LOAD:enigma_skin") from enigma import eSize, ePoint, eRect, gFont, eWindow, eLabel, ePixmap, eWindowStyleManager, addFont, gRGB, eWindowStyleSkinned, getDesktop from Components.config import ConfigSubsection, ConfigText, config, ConfigYesNo from Components.Sources.Source import ObsoleteSource from Tools.Directories import resolveFilename, SCOPE_SKIN, SCOPE_SKIN_IMAGE, SCOPE_FONTS, SCOPE_ACTIVE_SKIN, SCOPE_ACTIVE_LCDSKIN, SCOPE_CURRENT_SKIN, SCOPE_CONFIG, fileExists from Tools.Import import my_import from Tools.LoadPixmap import LoadPixmap from Components.RcModel import rc_model colorNames = {} # Predefined fonts, typically used in built-in screens and for components like # the movie list and so. fonts = { "Body": ("Regular", 18, 22, 16), "ChoiceList": ("Regular", 20, 24, 18), } def dump(x, i=0): print " " * i + str(x) try: for n in x.childNodes: dump(n, i + 1) except: None class SkinError(Exception):
def runScreenTest(): config.misc.startCounter.value += 1 profile("readPluginList") plugins.readPluginList(resolveFilename(SCOPE_PLUGINS)) profile("Init:Session") nav = Navigation(config.misc.isNextRecordTimerAfterEventActionAuto.value, config.misc.isNextPowerTimerAfterEventActionAuto.value) session = Session(desktop = enigma.getDesktop(0), summary_desktop = enigma.getDesktop(1), navigation = nav) CiHandler.setSession(session) profile("wizards") screensToRun = [] RestoreSettings = None if os.path.exists("/media/hdd/images/config/settings") and config.misc.firstrun.value: if autorestoreLoop(): RestoreSettings = True from Plugins.SystemPlugins.SoftwareManager.BackupRestore import RestoreScreen os.system("rm /media/hdd/images/config/settings") session.open(RestoreScreen, runRestore = True) else: os.system("rm /media/hdd/images/config/settings") screensToRun = [ p.__call__ for p in plugins.getPlugins(PluginDescriptor.WHERE_WIZARD) ] screensToRun += wizardManager.getWizards() else: if os.path.exists("/media/hdd/images/config/autorestore"): os.system('rm -f /media/hdd/images/config/autorestore') screensToRun = [ p.__call__ for p in plugins.getPlugins(PluginDescriptor.WHERE_WIZARD) ] screensToRun += wizardManager.getWizards() screensToRun.append((100, InfoBar.InfoBar)) screensToRun.sort() print screensToRun enigma.ePythonConfigQuery.setQueryFunc(configfile.getResolvedKey) def runNextScreen(session, screensToRun, *result): if result: print "[mytest.py] quitMainloop #3" enigma.quitMainloop(*result) return screen = screensToRun[0][1] args = screensToRun[0][2:] if screensToRun: session.openWithCallback(boundFunction(runNextScreen, session, screensToRun[1:]), screen, *args) else: session.open(screen, *args) if not RestoreSettings: runNextScreen(session, screensToRun) profile("Init:VolumeControl") vol = VolumeControl(session) profile("Init:PowerKey") power = PowerKey(session) if getBoxType() == 'odinm9' or getBoxType() == 'ebox5000' or getBoxType() == 'ixussone' or getBoxType() == 'ixusszero' or getMachineProcModel().startswith('ini-10') or getMachineProcModel().startswith('ini-50') or getMachineProcModel().startswith('ini-70'): profile("VFDSYMBOLS") import Components.VfdSymbols Components.VfdSymbols.SymbolsCheck(session) # we need session.scart to access it from within menu.xml session.scart = AutoScartControl(session) profile("Init:Trashcan") import Tools.Trashcan Tools.Trashcan.init(session) profile("Init:AutoVideoMode") import Screens.VideoMode Screens.VideoMode.autostart(session) profile("RunReactor") profile_final() # kill showiframe if it is running (sh4 hack...) os.system("killall -9 showiframe") runReactor() config.misc.startCounter.save() profile("wakeup") #get currentTime nowTime = time() if not config.misc.SyncTimeUsing.value == "0" or getBoxType().startswith('gb') or getMachineProcModel().startswith('ini'): print "dvb time sync disabled... so set RTC now to current linux time!", strftime("%Y/%m/%d %H:%M", localtime(nowTime)) setRTCtime(nowTime) wakeupList = [ x for x in ((session.nav.RecordTimer.getNextRecordingTime(), 0, session.nav.RecordTimer.isNextRecordAfterEventActionAuto()), (session.nav.RecordTimer.getNextZapTime(), 1), (plugins.getNextWakeupTime(), 2), (session.nav.PowerTimer.getNextPowerManagerTime(), 3, session.nav.PowerTimer.isNextPowerManagerAfterEventActionAuto())) if x[0] != -1 ] wakeupList.sort() recordTimerWakeupAuto = False if wakeupList and wakeupList[0][1] != 3: startTime = wakeupList[0] if (startTime[0] - nowTime) < 270: # no time to switch box back on wptime = nowTime + 30 # so switch back on in 30 seconds else: if getBoxType().startswith("gb"): wptime = startTime[0] - 120 # Gigaboxes already starts 2 min. before wakeup time else: wptime = startTime[0] - 240 #if not config.misc.SyncTimeUsing.value == "0" or getBoxType().startswith('gb'): # print "dvb time sync disabled... so set RTC now to current linux time!", strftime("%Y/%m/%d %H:%M", localtime(nowTime)) # setRTCtime(nowTime) print "set wakeup time to", strftime("%Y/%m/%d %H:%M", localtime(wptime)) setFPWakeuptime(wptime) recordTimerWakeupAuto = startTime[1] == 0 and startTime[2] print 'recordTimerWakeupAuto',recordTimerWakeupAuto config.misc.isNextRecordTimerAfterEventActionAuto.value = recordTimerWakeupAuto config.misc.isNextRecordTimerAfterEventActionAuto.save() PowerTimerWakeupAuto = False if wakeupList and wakeupList[0][1] == 3: startTime = wakeupList[0] if (startTime[0] - nowTime) < 60: # no time to switch box back on wptime = nowTime + 30 # so switch back on in 30 seconds else: if getBoxType().startswith("gb"): wptime = startTime[0] + 120 # Gigaboxes already starts 2 min. before wakeup time else: wptime = startTime[0] #if not config.misc.SyncTimeUsing.value == "0" or getBoxType().startswith('gb'): # print "dvb time sync disabled... so set RTC now to current linux time!", strftime("%Y/%m/%d %H:%M", localtime(nowTime)) # setRTCtime(nowTime) print "set wakeup time to", strftime("%Y/%m/%d %H:%M", localtime(wptime+60)) setFPWakeuptime(wptime) PowerTimerWakeupAuto = startTime[1] == 3 and startTime[2] print 'PowerTimerWakeupAuto',PowerTimerWakeupAuto config.misc.isNextPowerTimerAfterEventActionAuto.value = PowerTimerWakeupAuto config.misc.isNextPowerTimerAfterEventActionAuto.save() profile("stopService") session.nav.stopService() profile("nav shutdown") session.nav.shutdown() profile("configfile.save") configfile.save() from Screens import InfoBarGenerics InfoBarGenerics.saveResumePoints() return 0
import sys, os if os.path.isfile("/usr/lib/enigma2/python/enigma.zip"): sys.path.append("/usr/lib/enigma2/python/enigma.zip") import eConsoleImpl import eBaseImpl import enigma enigma.eTimer = eBaseImpl.eTimer enigma.eSocketNotifier = eBaseImpl.eSocketNotifier enigma.eConsoleAppContainer = eConsoleImpl.eConsoleAppContainer from Tools.Profile import profile, profile_final profile("PYTHON_START") from enigma import runMainloop, eDVBDB, eTimer, quitMainloop, \ getDesktop, ePythonConfigQuery, eAVSwitch, eServiceEvent, \ eEPGCache from tools import * profile("LANGUAGE") from Components.Language import language def setEPGLanguage(): print "language set to", language.getLanguage() eServiceEvent.setEPGLanguage(language.getLanguage()) language.addCallback(setEPGLanguage) from traceback import print_exc
def readPluginList(self, directory): new_plugins = [] for c in os.listdir(directory): directory_category = os.path.join(directory, c) if not os.path.isdir(directory_category): continue for pluginname in os.listdir(directory_category): path = os.path.join(directory_category, pluginname) if os.path.isdir(path): profile('plugin ' + pluginname) try: plugin = my_import('.'.join(['Plugins', c, pluginname, 'plugin'])) plugins = plugin.Plugins(path=path) except Exception as exc: print 'Plugin ', c + '/' + pluginname, 'failed to load:', exc for fn in ('plugin.py', 'plugin.pyc', 'plugin.pyo'): if os.path.exists(os.path.join(path, fn)): self.warnings.append((c + '/' + pluginname, str(exc))) from traceback import print_exc print_exc() break else: if pluginname not in ('WebInterface', 'TubeLib'): print 'Plugin probably removed, but not cleanly in', path print 'trying to remove:', path rmtree(path) continue if not isinstance(plugins, list): plugins = [plugins] for p in plugins: p.path = path p.updateIcon(path) new_plugins.append(p) keymap = os.path.join(path, 'keymap.xml') if fileExists(keymap): try: keymapparser.readKeymap(keymap) except Exception as exc: print 'keymap for plugin %s/%s failed to load: ' % (c, pluginname), exc self.warnings.append((c + '/' + pluginname, str(exc))) plugins_added = [ p for p in new_plugins if p not in self.pluginList ] plugins_removed = [ p for p in self.pluginList if not p.internal and p not in new_plugins ] for p in plugins_removed: for pa in plugins_added: if pa.path == p.path and pa.where == p.where: pa.needsRestart = False for p in plugins_removed: self.removePlugin(p) for p in plugins_added: if self.firstRun or p.needsRestart is False: self.addPlugin(p) else: for installed_plugin in self.installedPluginList: if installed_plugin.path == p.path: if installed_plugin.where == p.where: p.needsRestart = False self.addPlugin(p) if self.firstRun: self.firstRun = False self.installedPluginList = self.pluginList
def runScreenTest(): config.misc.startCounter.value += 1 config.misc.startCounter.save() profile("readPluginList") plugins.readPluginList(resolveFilename(SCOPE_PLUGINS)) profile("Init:Session") nav = Navigation() session = Session(desktop = enigma.getDesktop(0), summary_desktop = enigma.getDesktop(1), navigation = nav) CiHandler.setSession(session) profile("wizards") screensToRun = [] RestoreSettings = None if os.path.exists("/media/hdd/images/config/settings") and config.misc.firstrun.value: if autorestoreLoop(): RestoreSettings = True from Plugins.SystemPlugins.SoftwareManager.BackupRestore import RestoreScreen session.open(RestoreScreen, runRestore = True) else: screensToRun = [ p.__call__ for p in plugins.getPlugins(PluginDescriptor.WHERE_WIZARD) ] screensToRun += wizardManager.getWizards() else: if os.path.exists("/media/hdd/images/config/autorestore"): os.system('rm -f /media/hdd/images/config/autorestore') screensToRun = [ p.__call__ for p in plugins.getPlugins(PluginDescriptor.WHERE_WIZARD) ] screensToRun += wizardManager.getWizards() screensToRun.append((100, InfoBar.InfoBar)) screensToRun.sort() enigma.ePythonConfigQuery.setQueryFunc(configfile.getResolvedKey) # eDVBCIInterfaces.getInstance().setDescrambleRules(0 # Slot Number # ,( ["1:0:1:24:4:85:C00000:0:0:0:"], #service_list # ["PREMIERE"], #provider_list, # [] #caid_list # )); def runNextScreen(session, screensToRun, *result): if result: enigma.quitMainloop(*result) return screen = screensToRun[0][1] args = screensToRun[0][2:] if screensToRun: session.openWithCallback(boundFunction(runNextScreen, session, screensToRun[1:]), screen, *args) else: session.open(screen, *args) config.misc.epgcache_filename.addNotifier(setEPGCachePath) if not RestoreSettings: runNextScreen(session, screensToRun) profile("Init:VolumeControl") vol = VolumeControl(session) profile("Init:PowerKey") power = PowerKey(session) # we need session.scart to access it from within menu.xml session.scart = AutoScartControl(session) profile("Init:Trashcan") import Tools.Trashcan Tools.Trashcan.init(session) profile("RunReactor") profile_final() runReactor() profile("wakeup") from time import time, strftime, localtime from Tools.StbHardware import setFPWakeuptime, getFPWakeuptime, setRTCtime #get currentTime nowTime = time() wakeupList = [ x for x in ((session.nav.RecordTimer.getNextRecordingTime(), 0), (session.nav.RecordTimer.getNextZapTime(isWakeup=True), 1), (plugins.getNextWakeupTime(), 2)) if x[0] != -1 ] wakeupList.sort() if wakeupList: from time import strftime startTime = wakeupList[0] if (startTime[0] - nowTime) < 270: # no time to switch box back on wptime = nowTime + 30 # so switch back on in 30 seconds else: wptime = startTime[0] - 240 if not config.misc.useTransponderTime.value: print "dvb time sync disabled... so set RTC now to current linux time!", strftime("%Y/%m/%d %H:%M", localtime(nowTime)) setRTCtime(nowTime) print "set wakeup time to", strftime("%Y/%m/%d %H:%M", localtime(wptime)) setFPWakeuptime(wptime) profile("stopService") session.nav.stopService() profile("nav shutdown") session.nav.shutdown() profile("configfile.save") configfile.save() from Screens import InfoBarGenerics InfoBarGenerics.saveResumePoints() return 0
def runScreenTest(): config.misc.startCounter.value += 1 profile("readPluginList") plugins.readPluginList(resolveFilename(SCOPE_PLUGINS)) profile("Init:Session") nav = Navigation(config.misc.isNextRecordTimerAfterEventActionAuto.getValue()) session = Session(desktop = enigma.getDesktop(0), summary_desktop = enigma.getDesktop(1), navigation = nav) CiHandler.setSession(session) screensToRun = [ p.__call__ for p in plugins.getPlugins(PluginDescriptor.WHERE_WIZARD) ] profile("wizards") screensToRun += wizardManager.getWizards() screensToRun.append((100, InfoBar.InfoBar)) screensToRun.sort() enigma.ePythonConfigQuery.setQueryFunc(configfile.getResolvedKey) # eDVBCIInterfaces.getInstance().setDescrambleRules(0 # Slot Number # ,( ["1:0:1:24:4:85:C00000:0:0:0:"], #service_list # ["PREMIERE"], #provider_list, # [] #caid_list # )); def runNextScreen(session, screensToRun, *result): if result: enigma.quitMainloop(*result) return screen = screensToRun[0][1] args = screensToRun[0][2:] if screensToRun: session.openWithCallback(boundFunction(runNextScreen, session, screensToRun[1:]), screen, *args) else: session.open(screen, *args) config.misc.epgcache_filename.addNotifier(setEPGCachePath) runNextScreen(session, screensToRun) profile("Init:VolumeControl") vol = VolumeControl(session) profile("Init:PowerKey") power = PowerKey(session) # we need session.scart to access it from within menu.xml session.scart = AutoScartControl(session) profile("Init:Trashcan") import Tools.Trashcan Tools.Trashcan.init(session) profile("RunReactor") profile_final() if getBoxType() == 'gb800se' or getBoxType() == 'gb800solo' or getBoxType() == 'gb800seplus': from enigma import evfd, eConsoleAppContainer try: cmd = 'vfdctl " openmips starting e2"' container = eConsoleAppContainer() container.execute(cmd) except: evfd.getInstance().vfd_write_string("-E2-") evfd.getInstance().vfd_led(str(1)) runReactor() config.misc.startCounter.save() profile("wakeup") try: from Plugins.SystemPlugins.VFDControl.plugin import SetTime SetTime() except: print"Failed SetTime from VFDControl !!" from time import time, strftime, localtime from Tools.StbHardware import setFPWakeuptime, getFPWakeuptime, setRTCtime #get currentTime nowTime = time() wakeupList = [ x for x in ((session.nav.RecordTimer.getNextRecordingTime(), 0, session.nav.RecordTimer.isNextRecordAfterEventActionAuto()), (session.nav.RecordTimer.getNextZapTime(), 1), (plugins.getNextWakeupTime(), 2)) if x[0] != -1 ] wakeupList.sort() recordTimerWakeupAuto = False if wakeupList: from time import strftime, altzone, timezone startTime = wakeupList[0] if (startTime[0] - nowTime) < 270: # no time to switch box back on wptime = nowTime + 30 # so switch back on in 30 seconds else: wptime = startTime[0] - 120 if not config.misc.useTransponderTime.value: print "dvb time sync disabled... so set RTC now to current linux time!", strftime("%Y/%m/%d %H:%M", localtime(nowTime)) setRTCtime(nowTime) print "set wakeup time to", strftime("%Y/%m/%d %H:%M", localtime(wptime)) setFPWakeuptime(wptime) recordTimerWakeupAuto = startTime[1] == 0 and startTime[2] print 'recordTimerWakeupAuto',recordTimerWakeupAuto config.misc.isNextRecordTimerAfterEventActionAuto.value = recordTimerWakeupAuto config.misc.isNextRecordTimerAfterEventActionAuto.save() profile("stopService") session.nav.stopService() profile("nav shutdown") session.nav.shutdown() profile("configfile.save") configfile.save() from Screens import InfoBarGenerics InfoBarGenerics.saveResumePoints() return 0
def runScreenTest(): config.misc.startCounter.value += 1 profile("readPluginList") plugins.readPluginList(resolveFilename(SCOPE_PLUGINS)) profile("Init:Session") nav = Navigation(config.misc.isNextRecordTimerAfterEventActionAuto.value, config.misc.isNextPowerTimerAfterEventActionAuto.value) session = Session(desktop = enigma.getDesktop(0), summary_desktop = enigma.getDesktop(1), navigation = nav) CiHandler.setSession(session) profile("wizards") screensToRun = [] RestoreSettings = None if os.path.exists("/media/hdd/images/config/settings") and config.misc.firstrun.value: if autorestoreLoop(): RestoreSettings = True from Plugins.SystemPlugins.SoftwareManager.BackupRestore import RestoreScreen session.open(RestoreScreen, runRestore = True) else: screensToRun = [ p.__call__ for p in plugins.getPlugins(PluginDescriptor.WHERE_WIZARD) ] screensToRun += wizardManager.getWizards() else: if os.path.exists("/media/hdd/images/config/autorestore"): os.system('rm -f /media/hdd/images/config/autorestore') screensToRun = [ p.__call__ for p in plugins.getPlugins(PluginDescriptor.WHERE_WIZARD) ] screensToRun += wizardManager.getWizards() screensToRun.append((100, InfoBar.InfoBar)) screensToRun.sort() print screensToRun enigma.ePythonConfigQuery.setQueryFunc(configfile.getResolvedKey) def runNextScreen(session, screensToRun, *result): if result: print "[mytest.py] quitMainloop #3" enigma.quitMainloop(*result) return screen = screensToRun[0][1] args = screensToRun[0][2:] if screensToRun: session.openWithCallback(boundFunction(runNextScreen, session, screensToRun[1:]), screen, *args) else: session.open(screen, *args) if not RestoreSettings: runNextScreen(session, screensToRun) profile("Init:VolumeControl") vol = VolumeControl(session) profile("Init:PowerKey") power = PowerKey(session) if boxtype in ('sf3038', 'tomcat', 'nano', 'nanoc', 'et7500', 'mixosf5', 'mixosf7', 'mixoslumi', 'gi9196m', 'maram9', 'ixussone', 'ixussone', 'uniboxhd1', 'uniboxhd2', 'uniboxhd3', 'sezam5000hd', 'mbtwin', 'sezam1000hd', 'mbmini', 'atemio5x00', 'beyonwizt3') or getBrandOEM() in ('fulan'): profile("VFDSYMBOLS") import Components.VfdSymbols Components.VfdSymbols.SymbolsCheck(session) # we need session.scart to access it from within menu.xml session.scart = AutoScartControl(session) profile("Init:Trashcan") import Tools.Trashcan Tools.Trashcan.init(session) profile("Init:AutoVideoMode") import Screens.VideoMode Screens.VideoMode.autostart(session) profile("RunReactor") profile_final() if boxtype in ('sf8', 'classm', 'axodin', 'axodinc', 'starsatlx', 'genius', 'evo'): f = open("/dev/dbox/oled0", "w") f.write('-E2-') f.close() print "lastshutdown=%s (True = last shutdown was OK)" % config.usage.shutdownOK.value print "NOK shutdown action=%s" % config.usage.shutdownNOK_action.value print "bootup action=%s" % config.usage.boot_action.value if not config.usage.shutdownOK.value and not config.usage.shutdownNOK_action.value == 'normal' or not config.usage.boot_action.value == 'normal': print "last shutdown = %s" % config.usage.shutdownOK.value import Screens.PowerLost Screens.PowerLost.PowerLost(session) config.usage.shutdownOK.setValue(False) config.usage.shutdownOK.save() if not RestoreSettings: configfile.save() # kill showiframe if it is running (sh4 hack...) os.system("killall -9 showiframe") runReactor() print "[mytest.py] normal shutdown" config.misc.startCounter.save() config.usage.shutdownOK.setValue(True) config.usage.shutdownOK.save() profile("wakeup") #get currentTime nowTime = time() if not config.misc.SyncTimeUsing.value == "0" or boxtype.startswith('gb') or getBrandOEM().startswith('ini'): print "dvb time sync disabled... so set RTC now to current linux time!", strftime("%Y/%m/%d %H:%M", localtime(nowTime)) setRTCtime(nowTime) wakeupList = [ x for x in ((session.nav.RecordTimer.getNextRecordingTime(), 0, session.nav.RecordTimer.isNextRecordAfterEventActionAuto()), (session.nav.RecordTimer.getNextZapTime(), 1), (plugins.getNextWakeupTime(), 2), (session.nav.PowerTimer.getNextPowerManagerTime(), 3, session.nav.PowerTimer.isNextPowerManagerAfterEventActionAuto())) if x[0] != -1 ] wakeupList.sort() recordTimerWakeupAuto = False if wakeupList and wakeupList[0][1] != 3: startTime = wakeupList[0] if (startTime[0] - nowTime) < 270: # no time to switch box back on wptime = nowTime + 30 # so switch back on in 30 seconds else: if boxtype.startswith("gb"): wptime = startTime[0] - 120 # Gigaboxes already starts 2 min. before wakeup time else: wptime = startTime[0] - 240 # if not config.misc.SyncTimeUsing.value == "0" or boxtype.startswith('gb'): # print "dvb time sync disabled... so set RTC now to current linux time!", strftime("%Y/%m/%d %H:%M", localtime(nowTime)) # setRTCtime(nowTime) print "set wakeup time to", strftime("%Y/%m/%d %H:%M", localtime(wptime)) setFPWakeuptime(wptime) recordTimerWakeupAuto = startTime[1] == 0 and startTime[2] print 'recordTimerWakeupAuto',recordTimerWakeupAuto config.misc.isNextRecordTimerAfterEventActionAuto.value = recordTimerWakeupAuto config.misc.isNextRecordTimerAfterEventActionAuto.save() PowerTimerWakeupAuto = False if wakeupList and wakeupList[0][1] == 3: startTime = wakeupList[0] if (startTime[0] - nowTime) < 60: # no time to switch box back on wptime = nowTime + 30 # so switch back on in 30 seconds else: if config.workaround.deeprecord.value: wptime = startTime[0] - 240 # Gigaboxes already starts 2 min. before wakeup time else: wptime = startTime[0] # if not config.misc.SyncTimeUsing.value == "0" or getBrandOEM() == 'gigablue': # print "dvb time sync disabled... so set RTC now to current linux time!", strftime("%Y/%m/%d %H:%M", localtime(nowTime)) # setRTCtime(nowTime) print "set wakeup time to", strftime("%Y/%m/%d %H:%M", localtime(wptime+60)) setFPWakeuptime(wptime) PowerTimerWakeupAuto = startTime[1] == 3 and startTime[2] print 'PowerTimerWakeupAuto',PowerTimerWakeupAuto config.misc.isNextPowerTimerAfterEventActionAuto.value = PowerTimerWakeupAuto config.misc.isNextPowerTimerAfterEventActionAuto.save() profile("stopService") session.nav.stopService() profile("nav shutdown") session.nav.shutdown() profile("configfile.save") configfile.save() from Screens import InfoBarGenerics InfoBarGenerics.saveResumePoints() return 0
def runScreenTest(): config.misc.startCounter.value += 1 config.misc.startCounter.save() profile("readPluginList") plugins.readPluginList(resolveFilename(SCOPE_PLUGINS)) profile("Init:Session") nav = Navigation() session = Session(desktop=enigma.getDesktop(0), summary_desktop=enigma.getDesktop(1), navigation=nav) CiHandler.setSession(session) screensToRun = [ p.__call__ for p in plugins.getPlugins(PluginDescriptor.WHERE_WIZARD) ] profile("wizards") screensToRun += wizardManager.getWizards() screensToRun.append((100, InfoBar.InfoBar)) screensToRun.sort() enigma.ePythonConfigQuery.setQueryFunc(configfile.getResolvedKey) def runNextScreen(session, screensToRun, *result): if result: enigma.quitMainloop(*result) return screen = screensToRun[0][1] args = screensToRun[0][2:] if screensToRun: session.openWithCallback( boundFunction(runNextScreen, session, screensToRun[1:]), screen, *args) else: session.open(screen, *args) config.misc.epgcache_filename.addNotifier(setEPGCachePath) runNextScreen(session, screensToRun) profile("Init:VolumeControl") vol = VolumeControl(session) profile("Init:PowerKey") power = PowerKey(session) # we need session.scart to access it from within menu.xml session.scart = AutoScartControl(session) profile("Init:Trashcan") import Tools.Trashcan Tools.Trashcan.init(session) profile("Init:AutoVideoMode") import Screens.VideoMode Screens.VideoMode.autostart(session) profile("RunReactor") profile_final() if boxtype in ('sf8', 'classm', 'axodin', 'axodinc', 'starsatlx', 'genius', 'evo'): f = open("/dev/dbox/oled0", "w") f.write('-E2-') f.close() runReactor() profile("wakeup") from time import time, strftime, localtime from Tools.StbHardware import setFPWakeuptime, getFPWakeuptime, setRTCtime from Screens.SleepTimerEdit import isNextWakeupTime #get currentTime nowTime = time() if not config.misc.SyncTimeUsing.value == "0" or boxtype.startswith( 'gb') or getBrandOEM().startswith('ini'): print "dvb time sync disabled... so set RTC now to current linux time!", strftime( "%Y/%m/%d %H:%M", localtime(nowTime)) setRTCtime(nowTime) wakeupList = [ x for x in ((session.nav.RecordTimer.getNextRecordingTime(), 0), (session.nav.RecordTimer.getNextZapTime(isWakeup=True), 1), (plugins.getNextWakeupTime(), 2), (isNextWakeupTime(), 3)) if x[0] != -1 ] wakeupList.sort() if wakeupList: from time import strftime startTime = wakeupList[0] if (startTime[0] - nowTime) < 270: # no time to switch box back on wptime = nowTime + 30 # so switch back on in 30 seconds else: if boxtype.startswith("gb"): wptime = startTime[ 0] - 120 # Gigaboxes already starts 2 min. before wakeup time else: wptime = startTime[0] - 240 # if not config.misc.SyncTimeUsing.getValue() == "0" or getBoxType().startswith('gb'): # print "dvb time sync disabled... so set RTC now to current linux time!", strftime("%Y/%m/%d %H:%M", localtime(nowTime)) # setRTCtime(nowTime) print "set wakeup time to", strftime("%Y/%m/%d %H:%M", localtime(wptime)) setFPWakeuptime(wptime) config.misc.prev_wakeup_time.value = startTime[0] config.misc.prev_wakeup_time_type.value = startTime[1] config.misc.prev_wakeup_time_type.save() else: config.misc.prev_wakeup_time.value = 0 config.misc.prev_wakeup_time.save() profile("stopService") session.nav.stopService() profile("nav shutdown") session.nav.shutdown() profile("configfile.save") configfile.save() from Screens import InfoBarGenerics InfoBarGenerics.saveResumePoints() return 0