当前位置: 首页>>代码示例>>Python>>正文


Python Screens.InfoBarGenerics类代码示例

本文整理汇总了Python中Screens.InfoBarGenerics的典型用法代码示例。如果您正苦于以下问题:Python InfoBarGenerics类的具体用法?Python InfoBarGenerics怎么用?Python InfoBarGenerics使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了InfoBarGenerics类的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: runScreenTest


#.........这里部分代码省略.........

	CiHandler.setSession(session)

	screensToRun = [ p.__call__ for p in plugins.getPlugins(PluginDescriptor.WHERE_WIZARD) ]

	profile("wizards")
	screensToRun += wizardManager.getWizards()

	screensToRun.append((100, InfoBar.InfoBar))

# iq - [
	if os.path.exists("/etc/.run_factory_test"):
		from Screens.TestMenu import TestMenu
		screensToRun.append((-100, TestMenu))
# ]
	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()

	config.misc.startCounter.save()

	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.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()
	from Screens import InfoBarGenerics
	InfoBarGenerics.saveResumePoints()

	return 0
开发者ID:digidudeofdw,项目名称:enigma2-1,代码行数:101,代码来源:mytest.py

示例2: runScreenTest


#.........这里部分代码省略.........

	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
开发者ID:dbhrscom,项目名称:enigma2,代码行数:101,代码来源:mytest.py

示例3: runScreenTest


#.........这里部分代码省略.........
	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
开发者ID:Huevos,项目名称:enigma2,代码行数:101,代码来源:mytest.py

示例4: runScreenTest


#.........这里部分代码省略.........
	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
开发者ID:sklnet,项目名称:openhdf-enigma2,代码行数:101,代码来源:mytest.py

示例5: runScreenTest


#.........这里部分代码省略.........
	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
开发者ID:kingvuplus,项目名称:eg-e2,代码行数:101,代码来源:mytest.py

示例6: runScreenTest


#.........这里部分代码省略.........
		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
开发者ID:OpenSH4,项目名称:enigma2,代码行数:101,代码来源:mytest.py

示例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
#.........这里部分代码省略.........
开发者ID:Antonio-Team,项目名称:enigma2,代码行数:101,代码来源:mytest.py

示例8: runScreenTest


#.........这里部分代码省略.........
	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
开发者ID:Open-Plus,项目名称:opgui,代码行数:101,代码来源:mytest.py

示例9: runScreenTest


#.........这里部分代码省略.........
    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
开发者ID:vitmod,项目名称:dvbapp,代码行数:101,代码来源:mytest.py

示例10: runScreenTest


#.........这里部分代码省略.........
		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
开发者ID:sklnet,项目名称:opennfr-enigma2,代码行数:101,代码来源:mytest.py

示例11: runScreenTest


#.........这里部分代码省略.........

	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
			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 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 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
开发者ID:popazerty,项目名称:EG-2,代码行数:101,代码来源:mytest.py

示例12: runScreenTest


#.........这里部分代码省略.........

	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 enigma.getBoxType() == 'gb800se' or enigma.getBoxType() == 'gb800solo' or enigma.getBoxType() == 'gb800seplus':
		from enigma import evfd, eConsoleAppContainer, getDistro
		try:
			cmd = 'vfdctl "    %s starting e2"' % getDistro().lower()
			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.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
开发者ID:kingvuplus,项目名称:ZDE-tools,代码行数:101,代码来源:mytest.py

示例13: runScreenTest


#.........这里部分代码省略.........
    elif "SerienRecorder" in nextPluginIdent or "serienrecorder" in nextPluginIdent:
        nextPluginName = "SerienRecorder"
        nextPluginTimeInStandby = 0
    elif "Elektro" in nextPluginIdent:
        nextPluginName = "Elektro"
        nextPluginTimeInStandby = 0
    elif "EnhancedPowersave" in nextPluginIdent or "Enhanced Powersave" in nextPluginIdent:
        nextPluginName = "EnhancedPowersave"
        nextPluginTimeInStandby = 0
    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:
            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"
        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
开发者ID:synologix,项目名称:enigma2,代码行数:101,代码来源:mytest.py


注:本文中的Screens.InfoBarGenerics类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。