예제 #1
0
	def updateInfo(self):
		#self.DynamicTimer.start(6000)
		rc = system("df -h > /tmp/syinfo.tmp")
		self.text = _("BOX\n")
		f = open("/proc/stb/info/model",'r')
		self.text += _("Model:\t%s") % str(getMachineBrand()) + " " + str(getMachineName()) + "\n"
		f.close()
		#f = open("/proc/stb/info/chipset",'r')
		#self.text += "Chipset:\t" + about.getChipSetString() + "\n"
		#f.close()
		cmd = 'cat /proc/cpuinfo | grep "cpu MHz" -m 1 | awk -F ": " ' + "'{print $2}'"
		cmd2 = 'cat /proc/cpuinfo | grep "BogoMIPS" -m 1 | awk -F ": " ' + "'{print $2}'"
		try:
			res = popen(cmd).read()
			res2 = popen(cmd2).read()
		except:
			res = ""
			res2 = ""
		cpuMHz = ""
		bogoMIPS = ""
		if getMachineBuild() in ('vusolo4k','vuultimo4k','vuzero4k'):
			cpuMHz = "  \t(1,5 GHz)"
		elif getMachineBuild() in ('formuler1tc','formuler1','triplex','tiviaraplus'):
			cpuMHz = "  \t(1,3 GHz)"
		elif getMachineBuild() in ('u51','u5','u53','u52','u5pvr','h9'):
			cpuMHz = "  \t(1,6 GHz)"
		elif getMachineBuild() in ('vuuno4kse','vuuno4k','gbquad4k','dm900','dm920','gb7252','dags7252','xc7439','8100s'):
			cpuMHz = "  \t(1,7 GHz)"
		elif getMachineBuild() in ('alien5'):
			cpuMHz = "  \t(2,0 GHz)"
		elif getMachineBuild() in ('sf5008','et13000','et1x000','hd52','hd51','sf4008','vs1500','h7'):
			try:
				import binascii
				f = open('/sys/firmware/devicetree/base/cpus/cpu@0/clock-frequency', 'rb')
				clockfrequency = f.read()
				f.close()
				cpuMHz = "  \t(%s MHz)" % str(round(int(binascii.hexlify(clockfrequency), 16)/1000000,1))
			except:
				cpuMHz = "  \t(1,7 GHz)"
		elif res:
			cpuMHz = "  \t(" + res.replace("\n", "") + " MHz)"
		if res2:
			bogoMIPS = "" + res2.replace("\n", "")
		f = open('/proc/cpuinfo', 'r')
		self.text += "CPU: \t" + str(about.getCPUString()) + cpuMHz + "  " + str(about.getCpuCoresString2()) + "\n"
		self.text += _("Cores:\t %s") % str(about.getCpuCoresString()) + "\n"
		self.text += _("Architecture:\t %s") % str(about.getCPUArch()) + "\n"
		#self.text += _("CPU Load:\t %s") % str(about.getLoadCPUString()) + "\n"
		self.text += "BogoMIPS: \t" + bogoMIPS + "\n"
		f.close()
		#self.text += _("\nMEMORY\n")
		#self.text += _("Total:\t%s") % str(about.getRAMTotalString()) + " MB\n"
		#self.text += _("Free:\t%s ") % str(about.getRAMFreeString()) + " MB  (" + str(about.getRAMFreePorcString()) + ")\n"
		#self.text += _("Usage:\t%s") % str(about.getRAMUsedString()) + " MB  (" + str(about.getRAMusageString()) + ")\n"
		#self.text += _("Shared:\t%s") % str(about.getRAMSharingString()) + " MB" +  "\n"
		#self.text += _("Stored:\t%s") % str(about.getRAMStoredString()) + " MB" +  "\n"
		#self.text += _("Cached:\t%s") % str(about.getRAMCachedString()) + " MB" +  "\n"
		#out_lines = file("/proc/meminfo").readlines()
		#for lidx in range(len(out_lines) - 1):
		#	tstLine = out_lines[lidx].split()
		#	if "Buffers:" in tstLine:
		#		Buffers = out_lines[lidx].split()
		#		self.text += _("Buffers:") + "\t" + Buffers[1] + ' kB'"\n"
		#	if "Cached:" in tstLine:
		#		Cached = out_lines[lidx].split()
		#		self.text += _("Cached:") + "\t" + Cached[1] + ' kB'"\n"
		#self.text += _("Swap total:\t%s") % str(about.getRAMSwapTotalString()) + " MB\n"
		#self.text += _("Swap free:\t%s") % str(about.getRAMSwapFreeString()) + " MB\n"
		#self.text += _("\nSTORAGE\n")
		#if os.path.exists('/tmp/syinfo.tmp'):
		#	try:
		#		f = open("/tmp/syinfo.tmp",'r')
		#		line = f.readline()
		#		parts = line.split()
		#		self.text += parts[0] + "\t" + parts[1].strip() + "      " + parts[2].strip() + "    " + parts[3].strip() + "    " + parts[4] + "\n"
		#		line = f.readline()
		#		parts = line.split()
		#		self.text += "Flash" + "\t" + parts[1].strip() + "  " + parts[2].strip()  + "  " +  parts[3].strip()  + "  " +  parts[4] + "\n"
		#		for line in f.readlines():
		#			if line.find('/media/') != -1:
		#				line = line.replace('/media/', '   ')
		#				parts = line.split()
		#				if len(parts) == 6:
		#					self.text += parts[5] + "\t" + parts[1].strip() + "  " + parts[2].strip() + "  " + parts[3].strip() + "  " + parts[4] + "\n"
		#		f.close()
		#		os_remove("/tmp/syinfo.tmp")
		#	except:
		#		return

		self.text += "\nSOFTWARE\n"
		openLD = "OpenLD "
		self.text += "Firmware:\t %s" % openLD + str(about.getImageVersion()) + "\n"
		self.text += _("CodeName:\t %s") % str(getImageCodeName()) + "\n"
		self.text += "Kernel: \t " + about.getKernelVersionString() + "\n"
		self.text += _("DVB drivers:\t %s") % MyDateConverter(str(about.getDriverInstalledDate())) + "\n"
		self.text += _("Last update:\t %s") % MyDateConverter(str(getEnigmaVersionString())) + "\n"
		self.text += _("Restarts:\t %d ") % config.misc.startCounter.value + "\n"
		self.text += _("Uptime:\t %s") % str(about.getUptimeString()) + "\n"
		self.text += _("GStreamer:\t %s") % str(about.getGStreamerVersionString().replace('GStreamer','')) + "\n"
		if path.exists('/usr/bin/ffmpeg'):
			try:
				self.text += _("FFmpeg:\t %s") % str(about.getFFmpegVersionString()) + "\n"
			except:
				pass
		self.text += _("Python:\t %s") % about.getPythonVersionString() + "\n\n"

		self["lab1"].setText(self.text)
예제 #2
0
except:
    pass

if os.path.isfile("/usr/lib/enigma2/python/enigma.zip"):
    sys.path.append("/usr/lib/enigma2/python/enigma.zip")

from Tools.Profile import profile, profile_final
profile("PYTHON_START")

import Tools.RedirectOutput
from boxbranding import getBoxType, getBrandOEM, getImageCodeName, getImageType, getImageVersion, getImageBuild, getMachineBuild, getImageArch
print "----------------------------"
print "[Image Type] %s" % getImageType()
print "[Image Version] %s" % getImageVersion()
print "[Image Build] %s" % getImageBuild()
print "[Image CodeName] %s" % getImageCodeName()
print "[Image Arch] %s" % getImageArch()
print "----------------------------"

import enigma
import eConsoleImpl
import eBaseImpl
enigma.eTimer = eBaseImpl.eTimer
enigma.eSocketNotifier = eBaseImpl.eSocketNotifier
enigma.eConsoleAppContainer = eConsoleImpl.eConsoleAppContainer

print "Init Import modules for test"
from enigma import eTimer

from Screens.MessageBox import MessageBox
from Screens.Screen import Screen
예제 #3
0
import boxbranding
print "getMachineBuild=%s<" % boxbranding.getMachineBuild()
print "getMachineMake=%s<" % boxbranding.getMachineMake()
print "getMachineProcModel=%s<" % boxbranding.getMachineProcModel()
print "getMachineBrand=%s<" % boxbranding.getMachineBrand()
print "getMachineName=%s<" % boxbranding.getMachineName()
print "getMachineMtdKernel=%s<" % boxbranding.getMachineMtdKernel()
print "getMachineKernelFile=%s<" % boxbranding.getMachineKernelFile()
print "getMachineMtdRoot=%s<" % boxbranding.getMachineMtdRoot()
print "getMachineRootFile=%s<" % boxbranding.getMachineRootFile()
print "getMachineMKUBIFS=%s<" % boxbranding.getMachineMKUBIFS()
print "getMachineUBINIZE=%s<" % boxbranding.getMachineUBINIZE()
print "getBoxType=%s<" % boxbranding.getBoxType()
print "getBrandOEM=%s<" % boxbranding.getBrandOEM()
print "getOEVersion=%s<" % boxbranding.getOEVersion()
print "getDriverDate=%s<" % boxbranding.getDriverDate()
print "getImageVersion=%s<" % boxbranding.getImageVersion()
print "getImageBuild=%s<" % boxbranding.getImageBuild()
print "getImageDevBuild=%s<" % boxbranding.getImageDevBuild()
print "getImageCodeName=%s<" % boxbranding.getImageCodeName()
print "getImageType=%s<" % boxbranding.getImageType()
print "getImageDistro=%s<" % boxbranding.getImageDistro()
print "getImageFolder=%s<" % boxbranding.getImageFolder()
print "getImageFileSystem=%s<" % boxbranding.getImageFileSystem()
print "getImageArch=%s<" % boxbranding.getImageArch()
예제 #4
0
파일: About.py 프로젝트: miuipower/openLD
def getAboutText():
    AboutText = ""

    AboutText += _("Model:\t %s %s\n") % (getMachineBrand(), getMachineName())

    bootloader = ""
    if path.exists('/sys/firmware/devicetree/base/bolt/tag'):
        f = open('/sys/firmware/devicetree/base/bolt/tag', 'r')
        bootloader = f.readline().replace('\x00', '').replace('\n', '')
        f.close()
        AboutText += _("Bootloader:\t\t%s\n") % (bootloader)

    if about.getChipSetString() != _("unavailable"):
        if about.getIsBroadcom():
            AboutText += _("Chipset:\t BCM%s\n") % str(
                about.getChipSetString().upper())
        else:
            AboutText += _("Chipset:\t %s\n") % str(
                about.getChipSetString().upper())

    bogoMIPS = ""
    if path.exists('/proc/cpuinfo'):
        f = open('/proc/cpuinfo', 'r')
        temp = f.readlines()
        f.close()
        try:
            for lines in temp:
                lisp = lines.split(': ')
                if lisp[0].startswith('BogoMIPS'):
                    bogoMIPS = "" + str(int(float(lisp[1].replace('\n',
                                                                  '')))) + ""
                    #bogoMIPS = "" + lisp[1].replace('\n','') + ""
                    break
        except:
            pass

    cpuMHz = ""
    if getMachineBuild() in ('vusolo4k', 'vuultimo4k', 'vuzero4k'):
        cpuMHz = "   (1,5 GHz)"
    elif getMachineBuild() in ('formuler1tc', 'formuler1', 'triplex',
                               'tiviaraplus'):
        cpuMHz = "   (1,3 GHz)"
    elif getMachineBuild() in ('u51', 'u5', 'u53', 'u52', 'u5pvr', 'h9'):
        cpuMHz = "   (1,6 GHz)"
    elif getMachineBuild() in ('vuuno4kse', 'vuuno4k', 'dm900', 'dm920',
                               'gb7252', 'dags7252', 'xc7439', '8100s'):
        cpuMHz = "   (1,7 GHz)"
    elif getMachineBuild() in ('alien5'):
        cpuMHz = "   (2,0 GHz)"
    elif getMachineBuild() in ('sf5008', 'et13000', 'et1x000', 'hd52', 'hd51',
                               'sf4008', 'vs1500', 'h7'):
        try:
            import binascii
            f = open(
                '/sys/firmware/devicetree/base/cpus/cpu@0/clock-frequency',
                'rb')
            clockfrequency = f.read()
            f.close()
            cpuMHz = "   (%s MHz)" % str(
                round(int(binascii.hexlify(clockfrequency), 16) / 1000000, 1))
        except:
            cpuMHz = "   (1,7 GHz)"
    else:
        if path.exists('/proc/cpuinfo'):
            f = open('/proc/cpuinfo', 'r')
            temp = f.readlines()
            f.close()
            try:
                for lines in temp:
                    lisp = lines.split(': ')
                    if lisp[0].startswith('cpu MHz'):
                        #cpuMHz = "   (" +  lisp[1].replace('\n', '') + " MHz)"
                        cpuMHz = "   (" + str(
                            int(float(lisp[1].replace('\n', '')))) + " MHz)"
                        break
            except:
                pass

    openLD = "OpenLD "

    AboutText += _("CPU:\t %s") % str(
        about.getCPUString()) + cpuMHz + " " + str(
            about.getCpuCoresString2()) + "\n"
    AboutText += _("Cores:\t %s") % str(about.getCpuCoresString()) + "\n"

    imagestarted = ""
    bootname = ''
    if path.exists('/boot/bootname'):
        f = open('/boot/bootname', 'r')
        bootname = f.readline().split('=')[1]
        f.close()

    if path.exists('/boot/STARTUP'):
        f = open('/boot/STARTUP', 'r')
        f.seek(22)
        image = f.read(1)
        f.close()
        if bootname: bootname = "   (%s)" % bootname
        AboutText += _(
            "Selected Image:\t%s") % "STARTUP_" + image + bootname + "\n"
    elif path.exists('/boot/cmdline.txt'):
        f = open('/boot/cmdline.txt', 'r')
        f.seek(38)
        image = f.read(1)
        f.close()
        if bootname: bootname = "   (%s)" % bootname
        AboutText += _(
            "Selected Image:\t%s") % "STARTUP_" + image + bootname + "\n"

    AboutText += _("Architecture:\t %s") % str(about.getCPUArch()) + "\n"
    AboutText += _("BogoMIPS:\t %s") % bogoMIPS + "\n"
    AboutText += _("Firmware:\t %s") % openLD + str(getImageVersion()) + "\n"
    #AboutText += _("Build:\t %s") % getImageBuild() + "\n"
    #AboutText += _("Image Type:\t%s\n") % getImageType() + "\n"
    AboutText += _("CodeName:\t %s") % getImageCodeName() + "\n"
    AboutText += _("Kernel:\t %s") % str(about.getKernelVersionString()) + "\n"
    AboutText += _("DVB drivers:\t %s") % str(
        about.getDriverInstalledDate()) + "\n"
    AboutText += _("Last update:\t %s") % MyDateConverter(
        str(getEnigmaVersionString())) + "\n"
    AboutText += _("Restarts:\t %d ") % config.misc.startCounter.value + "\n"
    AboutText += _("Uptime:\t %s") % str(about.getUptimeString()) + "\n"
    AboutText += _("GStreamer:\t %s") % str(
        about.getGStreamerVersionString().replace('GStreamer', '')) + "\n"
    if path.exists('/usr/bin/ffmpeg'):
        try:
            AboutText += _("FFmpeg:\t %s") % str(
                about.getFFmpegVersionString()) + "\n"
        except:
            pass
    AboutText += _("Python:\t %s") % str(
        about.getPythonVersionString()) + "\n\n"
    #AboutText += _("CPU Load:\t %s") % str(about.getLoadCPUString()) + "\n"

    #AboutText += _("Installed:\t ") + about.getFlashDateString() + "\n"
    #AboutText += _("Restarts:\t %d ") % config.misc.startCounter.value + "\n\n"

    fp_version = getFPVersion()
    if fp_version is None:
        fp_version = ""
    elif fp_version != 0:
        fp_version = _("Frontprocessor version: %s") % fp_version
    else:
        fp_version = _("Frontprocessor version: %d") % fp_version
        AboutText += fp_version + "\n"

    tempinfo = ""
    if path.exists('/proc/stb/sensors/temp0/value'):
        f = open('/proc/stb/sensors/temp0/value', 'r')
        tempinfo = f.read()
        f.close()
    elif path.exists('/proc/stb/fp/temp_sensor'):
        f = open('/proc/stb/fp/temp_sensor', 'r')
        tempinfo = f.read()
        f.close()
    elif path.exists('/proc/stb/sensors/temp/value'):
        f = open('/proc/stb/sensors/temp/value', 'r')
        tempinfo = f.read()
        f.close()
    if tempinfo and int(tempinfo.replace('\n', '')) > 0:
        mark = str('\xc2\xb0')
        AboutText += _("System temperature:\t%s") % tempinfo.replace(
            '\n', '').replace(' ', '') + mark + "C\n"

    tempinfo = ""
    if path.exists('/proc/stb/fp/temp_sensor_avs'):
        f = open('/proc/stb/fp/temp_sensor_avs', 'r')
        tempinfo = f.read()
        f.close()
    elif path.exists('/proc/stb/power/avs'):
        try:
            f = open('/proc/stb/power/avs', 'r')
            temp = f.read()
            celsius = temp[0:-1]
            tempinfo = celsius
            f.close()
        except:
            tempinfo = ""
    elif path.exists('/sys/devices/virtual/thermal/thermal_zone0/temp'):
        try:
            f = open('/sys/devices/virtual/thermal/thermal_zone0/temp', 'r')
            temp = f.read()
            tempinfo = temp[:-4]
            f.close()
        except:
            tempinfo = ""
    if tempinfo and str(round(int(tempinfo.replace('\n', '')))) > 0:
        mark = str('\xc2\xb0')
        AboutText += _("Processor temperature:\t%s") % tempinfo.replace(
            '\n', '').replace(' ', '') + mark + "C\n"
    AboutLcdText = AboutText.replace('\t', ' ')

    return AboutText, AboutLcdText
예제 #5
0
import boxbranding
print "getMachineBuild=%s<" %boxbranding.getMachineBuild()
print "getMachineProcModel=%s<" %boxbranding.getMachineProcModel()
print "getMachineBrand=%s<" %boxbranding.getMachineBrand()
print "getMachineName=%s<" %boxbranding.getMachineName()
print "getMachineMtdKernel=%s<" %boxbranding.getMachineMtdKernel()
print "getMachineKernelFile=%s<" %boxbranding.getMachineKernelFile()
print "getMachineMtdRoot=%s<" %boxbranding.getMachineMtdRoot()
print "getMachineRootFile=%s<" %boxbranding.getMachineRootFile()
print "getMachineMKUBIFS=%s<" %boxbranding.getMachineMKUBIFS()
print "getMachineUBINIZE=%s<" %boxbranding.getMachineUBINIZE()
print "getBoxType=%s<" %boxbranding.getBoxType()
print "getBrandOEM=%s<" %boxbranding.getBrandOEM()
print "getOEVersion=%s<" %boxbranding.getOEVersion()
print "getDriverDate=%s<" %boxbranding.getDriverDate()
print "getImageVersion=%s<" %boxbranding.getImageVersion()
print "getImageBuild=%s<" %boxbranding.getImageBuild()
print "getImageDistro=%s<" %boxbranding.getImageDistro()
print "getImageFolder=%s<" %boxbranding.getImageFolder()
print "getImageFileSystem=%s<" %boxbranding.getImageFileSystem()
print "getImageDevBuild=%s<" %boxbranding.getImageDevBuild()
print "getImageCodeName=%s<" %boxbranding.getImageCodeName()
print "getImageType=%s<" %boxbranding.getImageType()
print "getMachineMake=%s<" %boxbranding.getMachineMake()
print "getImageArch=%s<" %boxbranding.getImageArch()