コード例 #1
0
ファイル: plugin.py プロジェクト: raya1111/enigma2-plugins
def startSetup(menuid, **kwargs):
	distro = None
	try:
		from enigma import getDistro
		distro = getDistro()
	except:
		try:
			file = open('/etc/image-version', 'r')
			lines = file.readlines()
			file.close()
			for x in lines:
				splitted = x.split('=')
				if splitted[0] == "comment":
					distro = splitted[1].replace('\n','')
		except:
			distro = None

	if distro == "ventonsupport":
		if menuid == "expert":
			return [(_("Audio Sync Setup"), setup, "audiosync_setup", 41)]
		else:
			return []
	else:
		if menuid == "system":
			return [(_("Audio Sync Setup"), setup, "audiosync_setup", 41)]
		else:
			return []
コード例 #2
0
def Plugins(**kwargs):
	try:
		from enigma import getDistro
		distro = getDistro()
	except:
		distro = None
	
	if distro == "openvix":
		return PluginDescriptor(name=_("Tuner Server setup"), description=_("Allow Streaming From Box Tuners"), where = PluginDescriptor.WHERE_MENU, needsRestart = True, fnc=settings)
	else:
		return PluginDescriptor(name=_("Tuner Server"), description=_("Allow Streaming From Box Tuners"), where = PluginDescriptor.WHERE_PLUGINMENU, needsRestart = False, fnc=main)
コード例 #3
0
ファイル: plugin.py プロジェクト: jall19/oe-alliance-plugins
def Plugins(**kwargs):
    try:
        from enigma import getDistro
        distro = getDistro()
    except:
        distro = None

    if distro == "openvix":
        return PluginDescriptor(
            name=_("Tuner Server setup"),
            description=_("Allow Streaming From Box Tuners"),
            where=PluginDescriptor.WHERE_MENU,
            needsRestart=True,
            fnc=settings)
    else:
        return PluginDescriptor(
            name=_("Tuner Server"),
            description=_("Allow Streaming From Box Tuners"),
            where=PluginDescriptor.WHERE_PLUGINMENU,
            needsRestart=False,
            fnc=main)
コード例 #4
0
ファイル: Flash_online.py プロジェクト: mcron/stb-gui
from Components.FileList import FileList
from Components.Task import Task, Job, job_manager, Condition
from Components.Sources.StaticText import StaticText
from Screens.Console import Console
from Screens.MessageBox import MessageBox
from Screens.Screen import Screen
from Screens.Console import Console
from Screens.HelpMenu import HelpableScreen
from Screens.TaskView import JobView
from Tools.Downloader import downloadWithProgress
from enigma import getBoxType, getDistro, getMachineName
import urllib2
import os
import shutil

distro = getDistro()

#############################################################################################################
feedurl_mcron = 'http://sat-world-forum.com/ronny/images/ventonhdx/online'
imagePath = '/hdd/images'
flashPath = '/hdd/images/flash'
flashTmp = '/hdd/images/tmp'
ofgwritePath = '/usr/bin/ofgwrite'
#############################################################################################################


def Freespace(dev):
    statdev = os.statvfs(dev)
    space = (statdev.f_bavail * statdev.f_frsize) / 1024
    print "[Flash Online] Free space on %s = %i kilobytes" % (dev, space)
    return space
コード例 #5
0
ファイル: Flash_online.py プロジェクト: Nobody28/stbgui
from Components.FileList import FileList
from Components.Task import Task, Job, job_manager, Condition
from Components.Sources.StaticText import StaticText
from Screens.Console import Console
from Screens.MessageBox import MessageBox
from Screens.Screen import Screen
from Screens.Console import Console
from Screens.HelpMenu import HelpableScreen
from Screens.TaskView import JobView
from Tools.Downloader import downloadWithProgress
from enigma import getBoxType, getDistro
import urllib2
import os
import shutil

distro = getDistro()

#############################################################################################################
image = 0 # 0=openATV / 1=openMips
if distro.lower() == "openmips":
	image = 1
elif distro.lower() == "openatv":
	from enigma import getMachineBrand, getMachineName
	image = 0
feedurl_atv = 'http://images.mynonpublic.com/openatv/nightly'
feedurl_om = 'http://image.openmips.com/2.0'
imagePath = '/hdd/images'
flashPath = '/hdd/images/flash'
flashTmp = '/hdd/images/tmp'
ofgwritePath = '/usr/bin/ofgwrite'
#############################################################################################################
コード例 #6
0
ファイル: mytest.py プロジェクト: kingvuplus/ZDE-tools
def runScreenTest():
	config.misc.startCounter.value += 1

	profile("readPluginList")
	plugins.readPluginList(resolveFilename(SCOPE_PLUGINS))

	profile("Init:Session")
	nav = Navigation()
	session = Session(desktop = enigma.getDesktop(0), summary_desktop = enigma.getDesktop(1), navigation = nav)

	CiHandler.setSession(session)

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

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

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

	screensToRun.sort()

	enigma.ePythonConfigQuery.setQueryFunc(configfile.getResolvedKey)

#	eDVBCIInterfaces.getInstance().setDescrambleRules(0 # Slot Number
#		,(	["1:0:1:24:4:85:C00000:0:0:0:"], #service_list
#			["PREMIERE"], #provider_list,
#			[] #caid_list
#		));

	def runNextScreen(session, screensToRun, *result):
		if result:
			enigma.quitMainloop(*result)
			return

		screen = screensToRun[0][1]
		args = screensToRun[0][2:]

		if screensToRun:
			session.openWithCallback(boundFunction(runNextScreen, session, screensToRun[1:]), screen, *args)
		else:
			session.open(screen, *args)

	config.misc.epgcache_filename.addNotifier(setEPGCachePath)

	runNextScreen(session, screensToRun)

	profile("Init:VolumeControl")
	vol = VolumeControl(session)
	profile("Init:PowerKey")
	power = PowerKey(session)

	# we need session.scart to access it from within menu.xml
	session.scart = AutoScartControl(session)

	profile("Init:Trashcan")
	import Tools.Trashcan
	Tools.Trashcan.init(session)

	profile("RunReactor")
	profile_final()
	
	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
コード例 #7
0
ファイル: e2info.py プロジェクト: LoSoS85/OpenStore
def getInfo():
	# TODO: get webif versione somewhere!
	info = {}

	brand = "Dream Multimedia"
	model = "unknown"
	chipset = "unknown"

	if fileExists("/proc/stb/info/hwmodel"):
		file = open("/proc/stb/info/hwmodel")
		model = file.read().strip().lower()
		file.close()
		if model == "tmtwinoe":
			model = "TM-TWIN-OE"
			brand = "Technomate"
		elif model == "tm2toe":
			model = "TM-2T-OE"
			brand = "Technomate"
		elif model == "tmsingle":
			model = "TM-SINGLE"
			brand = "Technomate"
		elif model == "tmnanooe":
			model = "TM-NANO-OE"
			brand = "Technomate"
		elif model == "ios100hd":
			model = "IOS-100HD"
			brand = "Iqon"
		elif model == "ios200hd":
			model = "IOS-200HD"
			brand = "Iqon"
		elif model == "ios300hd":
			model = "IOS-300HD"
			brand = "Iqon"
		elif model == "optimussos1":
			model = "Optimuss-OS1"
			brand = "Edision"
		elif model == "optimussos2":
			model = "Optimuss-OS2"
			brand = "Edision"
	elif fileExists("/proc/stb/info/boxtype"):
		file = open("/proc/stb/info/boxtype")
		model = file.read().strip().lower()
		file.close()
		if model == "gigablue":
			brand = "GigaBlue"
			if fileExists("/proc/stb/info/gbmodel"):
				file = open("/proc/stb/info/gbmodel")
				model = file.read().strip().lower()
				file.close()
				if model == "quad":
					model = "gbquad"
			else:
				model = 'gb800solo'
		elif model.startswith("et"):
			brand = "Clarke-Xtrend"
			if model == "et9500":
				model = "et9x00"
		elif model.startswith("ini"):
			if model.endswith("sv"):
				brand = "MiracleBox"
				if model == "ini-5000sv":
					model = "Premium Twin"
				elif model == "ini-1000sv":
					model = "Premium Mini"
				else:
					model
			elif model.endswith("de"):
				brand = "Golden Interstar"
				if model == "ini-1000de":
					model = "Xpeed LX"
				elif model == "ini-9000de":
					model = "Xpeed LX3"
				else:
					model
			elif model.endswith("ru"):
				brand = "Sezam"
				if model == "ini-1000ru":
					model = "Sezam 1000-HD"
				elif model == "ini-5000ru":
					model = "Sezam 5000-HD"
				elif model == "ini-9000ru":
					model = "Sezam Marvel"
				else:
					model
			else:
				brand = "Venton"
		elif model == "xp1000":
			brand = "XP-Series"
		elif model == "xp1000s":
			brand = "Octagon"
			model = "SF8 HD"
		elif model == "odinm9":
			brand = "Odin-Series"
		elif model == "odinm7":
			if getDistro() == 'axassupport':
				brand = "AXAS"
				model = "Class M"
			elif getBoxType() == 'odinm6':
				brand = "TELESTAR"
				model = "STARSAT LX"
			elif getMachineName() == 'AX-Odin':
				brand = "Opticum"
				model = "AX-Odin"	
			else:
				brand = "Odin-Series"
		elif model == "e3hd":
			if getDistro() == 'axassupport':
				brand = "AXAS"
				model = "Class E"
			else:
				brand = "E3-Series"
		elif model == "ebox5000":
			brand = "MixOs-Series"
			model = "MixOs F5"
		elif model == "ebox5100":
			brand = "MixOs-Series"
			model = "MixOs F5mini"
		elif model == "ebox7358":
			brand = "MixOs-Series"
			model = "MixOs F7"
		elif model.startswith("ixuss"):
			brand = "Ixuss-Series"
			chipset = "BCM7405"
	elif fileExists("/proc/stb/info/azmodel"):
		brand = "AZBOX"
		file = open("/proc/stb/info/model")
		model = file.read().strip().lower()
		file.close()
		if model == "me":
			chipset = "SIGMA 8655"
		elif model == "minime":
			chipset = "SIGMA 8653"
		else:
			chipset = "SIGMA 8634"
	elif fileExists("/proc/stb/info/vumodel"):
		brand = "Vu Plus"
		file = open("/proc/stb/info/vumodel")
		model = file.read().strip().lower()
		file.close()
	else:
		file = open("/proc/stb/info/model")
		model = file.read().strip().lower()
 		if model.startswith('spar'):
		    brand = "Spark"
		file.close()

	info['brand'] = brand
	info['model'] = model

	if fileExists("/proc/stb/info/chipset"):
		f = open("/proc/stb/info/chipset",'r')
		chipset = f.readline().strip()
		f.close()

	info['chipset'] = chipset

	memFree = 0
	file = open("/proc/meminfo",'r')
	for line in file:
		parts = line.split(':')
		key = parts[0].strip()
		if key == "MemTotal":
			info['mem1'] = parts[1].strip()
		elif key in ("MemFree", "Buffers", "Cached"):
			memFree += int(parts[1].strip().split(' ',1)[0])
	info['mem2'] = "%s kB" % memFree
	file.close()

	try:
		f = open("/proc/uptime", "rb")
		uptime = int(float(f.readline().split(' ', 2)[0].strip()))
		f.close()
		uptimetext = ''
		if uptime > 86400:
			d = uptime/86400
			uptime = uptime % 86400
			uptimetext += '%dd ' % d
		uptimetext += "%d:%.2d" % (uptime/3600, (uptime%3600)/60)
	except:
		uptimetext = "?"
	info['uptime'] = uptimetext

	info["webifver"] = getOpenWebifVer()
	try:
		from enigma import getImageVersionString, getBuildVersionString, getEnigmaVersionString
		info['imagever'] = getImageVersionString() + '.' + getBuildVersionString()
		info['enigmaver'] = getEnigmaVersionString()
	except:
		info['imagever'] = about.getImageVersionString()
		info['enigmaver'] = about.getEnigmaVersionString()
	info['kernelver'] = about.getKernelVersionString()

	try:
		from Tools.StbHardware import getFPVersion
	except ImportError:
		from Tools.DreamboxHardware import getFPVersion

	info['fp_version'] = getFPVersion()

	info['tuners'] = []
	for i in range(0, nimmanager.getSlotCount()):
		info['tuners'].append({
			"name": nimmanager.getNim(i).getSlotName(),
			"type": nimmanager.getNimName(i) + " (" + nimmanager.getNim(i).getFriendlyType() + ")"
		})

	info['ifaces'] = []
	ifaces = iNetwork.getConfiguredAdapters()
	for iface in ifaces:
		info['ifaces'].append({
			"name": iNetwork.getAdapterName(iface),
			"mac": iNetwork.getAdapterAttribute(iface, "mac"),
			"dhcp": iNetwork.getAdapterAttribute(iface, "dhcp"),
			"ip": formatIp(iNetwork.getAdapterAttribute(iface, "ip")),
			"mask": formatIp(iNetwork.getAdapterAttribute(iface, "netmask")),
			"gw": formatIp(iNetwork.getAdapterAttribute(iface, "gateway"))
		})

	info['hdd'] = []
	for hdd in harddiskmanager.hdd:
		if hdd.free() <= 1024:
			free = "%i MB" % (hdd.free())
		else:
			free = float(hdd.free()) / float(1024)
			free = "%.3f GB" % free
		info['hdd'].append({
			"model": hdd.model(),
			"capacity": hdd.capacity(),
			"free": free
		})
	return info
コード例 #8
0
ファイル: info.py プロジェクト: sklnet/e2openplugin-OpenWebif
def getInfo():
	# TODO: get webif versione somewhere!
	info = {}

	brand = "Dream Multimedia"
	model = "unknown"
	chipset = "unknown"

	if fileExists("/proc/stb/info/hwmodel"):
		file = open("/proc/stb/info/hwmodel")
		model = file.read().strip().lower()
		file.close()
		if model == "tmtwinoe":
			model = "TM-TWIN-OE"
			brand = "Technomate"
		elif model == "tm2toe":
			model = "TM-2T-OE"
			brand = "Technomate"
		elif model == "tmsingle":
			model = "TM-SINGLE"
			brand = "Technomate"
		elif model == "tmnanooe":
			model = "TM-NANO-OE"
			brand = "Technomate"
		elif model == "ios100hd":
			model = "IOS-100HD"
			brand = "Iqon"
		elif model == "ios200hd":
			model = "IOS-200HD"
			brand = "Iqon"
		elif model == "ios300hd":
			model = "IOS-300HD"
			brand = "Iqon"
		elif model == "optimussos1":
			model = "Optimuss-OS1"
			brand = "Edision"
		elif model == "optimussos2":
			model = "Optimuss-OS2"
			brand = "Edision"
	elif fileExists("/proc/stb/info/boxtype"):
		file = open("/proc/stb/info/boxtype")
		model = file.read().strip().lower()
		file.close()
		if model == "gigablue":
			brand = "GigaBlue"
			if fileExists("/proc/stb/info/gbmodel"):
				file = open("/proc/stb/info/gbmodel")
				model = file.read().strip().lower()
				file.close()
				if model == "quad":
					model = "gbquad"
			else:
				model = 'gb800solo'
		elif model.startswith("et"):
			brand = "Clarke-Xtrend"
			if model == "et9500":
				model = "et9x00"
		elif model.startswith("ini"):
			if model.endswith("sv"):
				brand = "MiracleBox"
				if model == "ini-5000sv":
					model = "Premium Twin"
				elif model == "ini-1000sv":
					model = "Premium Mini"
				else:
					model
			elif model.endswith("de"):
				brand = "Golden Interstar"
				if model == "ini-1000de":
					model = "Xpeed LX"
				elif model == "ini-9000de":
					model = "Xpeed LX3"
				else:
					model
			elif model.endswith("ru"):
				brand = "Sezam"
				if model == "ini-1000ru":
					model = "Sezam 1000-HD"
				elif model == "ini-5000ru":
					model = "Sezam 5000-HD"
				elif model == "ini-9000ru":
					model = "Sezam Marvel"
				else:
					model
			else:
				brand = "Venton"
		elif model == "xp1000":
			brand = "XP-Series"
		elif model == "xp1000s":
			brand = "Octagon"
			model = "SF8 HD"
		elif model == "odinm9":
			brand = "Odin-Series"
		elif model == "odinm7":
			if getDistro() == 'axassupport':
				brand = "AXAS"
				model = "Class M"
			elif getBoxType() == 'odinm6':
				brand = "TELESTAR"
				model = "STARSAT LX"
			elif getMachineName() == 'AX-Odin':
				brand = "Opticum"
				model = "AX-Odin"	
			else:
				brand = "Odin-Series"
		elif model == "e3hd":
			if getDistro() == 'axassupport':
				brand = "AXAS"
				model = "Class E"
			else:
				brand = "E3-Series"
		elif model == "ebox5000":
			brand = "MixOs-Series"
			model = "MixOs F5"
		elif model == "ebox5100":
			brand = "MixOs-Series"
			model = "MixOs F5mini"
		elif model == "ebox7358":
			brand = "MixOs-Series"
			model = "MixOs F7"
		elif model.startswith("ixuss"):
			brand = "Ixuss-Series"
			chipset = "BCM7405"
	elif fileExists("/proc/stb/info/azmodel"):
		brand = "AZBOX"
		file = open("/proc/stb/info/model")
		model = file.read().strip().lower()
		file.close()
		if model == "me":
			chipset = "SIGMA 8655"
		elif model == "minime":
			chipset = "SIGMA 8653"
		else:
			chipset = "SIGMA 8634"
	elif fileExists("/proc/stb/info/vumodel"):
		brand = "Vu Plus"
		file = open("/proc/stb/info/vumodel")
		model = file.read().strip().lower()
		file.close()
	else:
		file = open("/proc/stb/info/model")
		model = file.read().strip().lower()
 		if model.startswith('spar'):
		    brand = "Spark"
		file.close()

	info['brand'] = brand
	info['model'] = model

	if fileExists("/proc/stb/info/chipset"):
		f = open("/proc/stb/info/chipset",'r')
		chipset = f.readline().strip()
		f.close()

	info['chipset'] = chipset

	memFree = 0
	file = open("/proc/meminfo",'r')
	for line in file:
		parts = line.split(':')
		key = parts[0].strip()
		if key == "MemTotal":
			info['mem1'] = parts[1].strip()
		elif key in ("MemFree", "Buffers", "Cached"):
			memFree += int(parts[1].strip().split(' ',1)[0])
	info['mem2'] = "%s kB" % memFree
	file.close()

	try:
		f = open("/proc/uptime", "rb")
		uptime = int(float(f.readline().split(' ', 2)[0].strip()))
		f.close()
		uptimetext = ''
		if uptime > 86400:
			d = uptime/86400
			uptime = uptime % 86400
			uptimetext += '%dd ' % d
		uptimetext += "%d:%.2d" % (uptime/3600, (uptime%3600)/60)
	except:
		uptimetext = "?"
	info['uptime'] = uptimetext

	info["webifver"] = getOpenWebifVer()
	try:
		from enigma import getImageVersionString, getBuildVersionString, getEnigmaVersionString
		info['imagever'] = getImageVersionString() + '.' + getBuildVersionString()
		info['enigmaver'] = getEnigmaVersionString()
	except:
		info['imagever'] = about.getImageVersionString()
		info['enigmaver'] = about.getEnigmaVersionString()
	info['kernelver'] = about.getKernelVersionString()

	try:
		from Tools.StbHardware import getFPVersion
	except ImportError:
		from Tools.DreamboxHardware import getFPVersion

	info['fp_version'] = getFPVersion()

	info['tuners'] = []
	for i in range(0, nimmanager.getSlotCount()):
		info['tuners'].append({
			"name": nimmanager.getNim(i).getSlotName(),
			"type": nimmanager.getNimName(i) + " (" + nimmanager.getNim(i).getFriendlyType() + ")"
		})

	info['ifaces'] = []
	ifaces = iNetwork.getConfiguredAdapters()
	for iface in ifaces:
		info['ifaces'].append({
			"name": iNetwork.getAdapterName(iface),
			"mac": iNetwork.getAdapterAttribute(iface, "mac"),
			"dhcp": iNetwork.getAdapterAttribute(iface, "dhcp"),
			"ip": formatIp(iNetwork.getAdapterAttribute(iface, "ip")),
			"mask": formatIp(iNetwork.getAdapterAttribute(iface, "netmask")),
			"gw": formatIp(iNetwork.getAdapterAttribute(iface, "gateway"))
		})

	info['hdd'] = []
	for hdd in harddiskmanager.hdd:
		if hdd.free() <= 1024:
			free = "%i MB" % (hdd.free())
		else:
			free = float(hdd.free()) / float(1024)
			free = "%.3f GB" % free
		info['hdd'].append({
			"model": hdd.model(),
			"capacity": hdd.capacity(),
			"free": free
		})
	return info