本文整理汇总了Python中Screens.Ci.CiHandler类的典型用法代码示例。如果您正苦于以下问题:Python CiHandler类的具体用法?Python CiHandler怎么用?Python CiHandler使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了CiHandler类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: runScreenTest
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
示例2: runScreenTest
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()
#.........这里部分代码省略.........
示例3: runScreenTest
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':
#.........这里部分代码省略.........
示例4: runScreenTest
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:
#.........这里部分代码省略.........
示例5: runScreenTest
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)
#.........这里部分代码省略.........
示例6: runScreenTest
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'):
#.........这里部分代码省略.........
示例7: runScreenTest
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
#.........这里部分代码省略.........
示例8: runScreenTest
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"
#.........这里部分代码省略.........
示例9: runScreenTest
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:
#.........这里部分代码省略.........
示例10: runScreenTest
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
#.........这里部分代码省略.........
示例11: runScreenTest
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
#.........这里部分代码省略.........
示例12: runScreenTest
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)
#.........这里部分代码省略.........
示例13: runScreenTest
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:
#.........这里部分代码省略.........
示例14: runScreenTest
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:
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 getBoxType() in ('mixosf5', 'mixosf7', 'mixoslumi', 'gi9196m', 'maram9', 'ixussone', 'ixussone') or getMachineBuild() in ('inihdx'):
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()
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"
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 getBoxType().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
#.........这里部分代码省略.........
示例15: runScreenTest
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 (
"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()
#.........这里部分代码省略.........