Ejemplo n.º 1
0
    def populate(self):
        self["lab1"] = StaticText(_("Virtuosso Image Xtreme"))
        self["lab2"] = StaticText(_("By Team ViX"))
        model = None
        AboutText = ""
        self["lab3"] = StaticText(
            _("Support at") + " www.world-of-satellite.com")

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

        if about.getChipSetString() != _("unavailable"):
            if SystemInfo["HasHiSi"]:
                AboutText += _("Chipset:\tHiSilicon %s\n"
                               ) % about.getChipSetString().upper()
            elif about.getIsBroadcom():
                AboutText += _("Chipset:\tBroadcom %s\n"
                               ) % about.getChipSetString().upper()
            else:
                AboutText += _(
                    "Chipset:\t%s\n") % about.getChipSetString().upper()

        AboutText += _("CPU:\t%s %s %s\n") % (about.getCPUArch(),
                                              about.getCPUSpeedString(),
                                              about.getCpuCoresString())
        imageSubBuild = ""
        if getImageType() != 'release':
            imageSubBuild = ".%s" % getImageDevBuild()
        AboutText += _("Image:\t%s.%s%s (%s)\n") % (getImageVersion(
        ), getImageBuild(), imageSubBuild, getImageType().title())

        if SystemInfo["canMultiBoot"]:
            image = GetCurrentImage()
            bootmode = ""
            part = ""
            if SystemInfo["canMode12"]:
                bootmode = "bootmode = %s" % GetCurrentImageMode()
            if SystemInfo["HasHiSi"]:
                if image != 0:
                    part = "%s%s" % (SystemInfo["canMultiBoot"][2], image * 2)
                    image += 1
                else:
                    part = "MMC"
                    image += 1
            AboutText += _("Image Slot:\t%s") % "STARTUP_" + str(
                image) + " " + part + " " + bootmode + "\n"

        if getMachineName() in ('ET8500') and path.exists('/proc/mtd'):
            self.dualboot = self.dualBoot()
            if self.dualboot:
                AboutText += _("ET8500 Multiboot: Installed\n")

        skinWidth = getDesktop(0).size().width()
        skinHeight = getDesktop(0).size().height()

        string = getDriverDate()
        year = string[0:4]
        month = string[4:6]
        day = string[6:8]
        driversdate = '-'.join((year, month, day))
        AboutText += _("Drivers:\t%s\n") % driversdate
        AboutText += _("Kernel:\t%s\n") % about.getKernelVersionString()
        AboutText += _("GStreamer:\t%s\n") % about.getGStreamerVersionString(
        ).replace("GStreamer ", "")
        AboutText += _("Python:\t%s\n") % about.getPythonVersionString()
        AboutText += _("Installed:\t%s\n") % about.getFlashDateString()
        AboutText += _("Last update:\t%s\n") % getEnigmaVersionString()
        AboutText += _("E2 (re)starts:\t%s\n") % config.misc.startCounter.value
        AboutText += _("Skin:\t%s") % config.skin.primary_skin.value[0:-9] + _(
            "  (%s x %s)") % (skinWidth, skinHeight) + "\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 temp:\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('/sys/devices/virtual/thermal/thermal_zone0/temp'):
            try:
                f = open('/sys/devices/virtual/thermal/thermal_zone0/temp',
                         'r')
                tempinfo = f.read()
                tempinfo = tempinfo[:-4]
                f.close()
            except:
                tempinfo = ""
        elif path.exists('/proc/hisi/msp/pm_cpu'):
            try:
                for line in open('/proc/hisi/msp/pm_cpu').readlines():
                    line = [x.strip() for x in line.strip().split(":")]
                    if line[0] in ("Tsensor"):
                        temp = line[1].split("=")
                        temp = line[1].split(" ")
                        tempinfo = temp[2]
            except:
                tempinfo = ""
        if tempinfo and int(tempinfo.replace('\n', '')) > 0:
            mark = str('\xc2\xb0')
            AboutText += _("Processor temp:\t%s") % tempinfo.replace(
                '\n', '').replace(' ', '') + mark + "C\n"
        AboutLcdText = AboutText.replace('\t', ' ')

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

        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%s\n") % (bootloader)

        self["AboutScrollLabel"] = ScrollLabel(AboutText)
Ejemplo n.º 2
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)
Ejemplo n.º 3
0
def getInfo(session=None, need_fullinfo=False):
    # TODO: get webif versione somewhere!
    info = {}
    global STATICBOXINFO

    if not (STATICBOXINFO is None or need_fullinfo):
        return STATICBOXINFO

    info['brand'] = getBoxBrand()
    info['model'] = getBoxType()
    info['platform'] = boxbranding.getMachineBuild()

    try:
        info['procmodel'] = getBoxProc()
    except:  # noqa: E722
        info['procmodel'] = boxbranding.getMachineProcModel()

    try:
        info['procmodeltype'] = getBoxProcType()
    except:  # noqa: E722
        info['procmodeltype'] = None

    try:
        info['lcd'] = getLcd()
    except:  # noqa: E722
        info['lcd'] = 0

    try:
        info['grabpip'] = getGrabPip()
    except:  # noqa: E722
        info['grabpip'] = 0

    cpu = about.getCPUInfoString()
    info['chipset'] = cpu
    info['cpubrand'] = about.getCPUBrand()
    info['socfamily'] = boxbranding.getSoCFamily()
    info['cpuarch'] = about.getCPUArch()
    if config.OpenWebif.about_benchmark.value is True:
        info['cpubenchmark'] = about.getCPUBenchmark()
    else:
        info['cpubenchmark'] = _("Disabled in configuration")
    info['flashtype'] = about.getFlashType()

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

    info['uptime'] = about.getBoxUptime()

    info["webifver"] = OPENWEBIFVER
    info['imagedistro'] = boxbranding.getImageDistro()
    info['oever'] = boxbranding.getImageBuild()
    info['visionversion'] = boxbranding.getVisionVersion()
    info['visionrevision'] = boxbranding.getVisionRevision()
    info['visionmodule'] = about.getVisionModule()

    if fileExists("/etc/openvision/multiboot"):
        multibootflag = open("/etc/openvision/multiboot", "r").read().strip()
        if multibootflag == "1":
            info['multiboot'] = _("Yes")
        else:
            info['multiboot'] = _("No")
    else:
        info['multiboot'] = _("Yes")

    info['enigmaver'] = getEnigmaVersionString()
    info['driverdate'] = about.getDriverInstalledDate()
    info['kernelver'] = boxbranding.getKernelVersion()
    info['dvbapitype'] = about.getDVBAPI()
    info['gstreamerversion'] = about.getGStreamerVersionString(cpu)
    info['ffmpegversion'] = about.getFFmpegVersionString()
    info['pythonversion'] = about.getPythonVersionString()

    try:
        info['hwserial'] = getHWSerial()
    except:  # noqa: E722
        info['hwserial'] = None

    if (info['hwserial'] is None or info['hwserial'] == "unknown"):
        info['hwserial'] = about.getCPUSerial()

    try:
        info['boxrctype'] = getBoxRCType()
    except:  # noqa: E722
        info['boxrctype'] = None

    if (info['boxrctype'] is None or info['boxrctype'] == "unknown"):
        if fileExists("/usr/bin/remotecfg"):
            info['boxrctype'] = _("Amlogic remote")
        elif fileExists("/usr/sbin/lircd"):
            info['boxrctype'] = _("LIRC remote")

    info['ovrctype'] = boxbranding.getRCType()
    info['ovrcname'] = boxbranding.getRCName()
    info['ovrcidnum'] = boxbranding.getRCIDNum()

    info['transcoding'] = boxbranding.getHaveTranscoding()
    info['multitranscoding'] = boxbranding.getHaveMultiTranscoding()

    info['displaytype'] = boxbranding.getDisplayType()

    info['updatedatestring'] = about.getUpdateDateString()
    info['enigmadebuglvl'] = eGetEnigmaDebugLvl()

    info['imagearch'] = boxbranding.getImageArch()
    info['imagefolder'] = boxbranding.getImageFolder()
    info['imagefilesystem'] = boxbranding.getImageFileSystem()
    info['feedsurl'] = boxbranding.getFeedsUrl()
    info['developername'] = boxbranding.getDeveloperName()
    info['builddatestring'] = about.getBuildDateString()
    info['imagefpu'] = boxbranding.getImageFPU()
    info['havemultilib'] = boxbranding.getHaveMultiLib()

    try:
        info['fp_version'] = getFPVersion()
    except:  # noqa: E722
        info['fp_version'] = None

    info['tuners'] = []
    for i in list(range(0, nimmanager.getSlotCount())):
        print(
            "[OpenWebif] -D- tuner '%d' '%s' '%s'" %
            (i, nimmanager.getNimName(i), nimmanager.getNim(i).getSlotName()))
        info['tuners'].append({
            "name":
            nimmanager.getNim(i).getSlotName(),
            "type":
            nimmanager.getNimName(i) + " (" +
            nimmanager.getNim(i).getFriendlyType() + ")",
            "rec":
            "",
            "live":
            ""
        })

    info['ifaces'] = []
    ifaces = iNetwork.getConfiguredAdapters()
    for iface in ifaces:
        info['ifaces'].append({
            "name":
            iNetwork.getAdapterName(iface),
            "friendlynic":
            getFriendlyNICChipSet(iface),
            "linkspeed":
            getLinkSpeed(iface),
            "mac":
            iNetwork.getAdapterAttribute(iface, "mac"),
            "dhcp":
            iNetwork.getAdapterAttribute(iface, "dhcp"),
            "ipv4method":
            getIPv4Method(iface),
            "ip":
            formatIp(iNetwork.getAdapterAttribute(iface, "ip")),
            "mask":
            formatIp(iNetwork.getAdapterAttribute(iface, "netmask")),
            "v4prefix":
            sum([
                bin(int(x)).count('1') for x in formatIp(
                    iNetwork.getAdapterAttribute(iface, "netmask")).split('.')
            ]),
            "gw":
            formatIp(iNetwork.getAdapterAttribute(iface, "gateway")),
            "ipv6":
            getAdapterIPv6(iface)['addr'],
            "ipmethod":
            getIPMethod(iface),
            "firstpublic":
            getAdapterIPv6(iface)['firstpublic']
        })

    info['hdd'] = []
    for hdd in harddiskmanager.hdd:
        dev = hdd.findMount()
        if dev:
            stat = os.statvfs(dev)
            free = stat.f_bavail * stat.f_frsize / 1048576.
        else:
            free = -1

        if free <= 1024:
            free = "%i %s" % (free, _("MB"))
        else:
            free = free / 1024.
            free = "%.1f %s" % (free, _("GB"))

        size = hdd.diskSize() * 1000000 / 1048576.
        if size > 1048576:
            size = "%.1f %s" % ((size / 1048576.), _("TB"))
        elif size > 1024:
            size = "%.1f %s" % ((size / 1024.), _("GB"))
        else:
            size = "%d %s" % (size, _("MB"))

        iecsize = hdd.diskSize()
        # Harddisks > 1000 decimal Gigabytes are labelled in TB
        if iecsize > 1000000:
            iecsize = (iecsize + 50000) // float(100000) / 10
            # Omit decimal fraction if it is 0
            if (iecsize % 1 > 0):
                iecsize = "%.1f %s" % (iecsize, _("TB"))
            else:
                iecsize = "%d %s" % (iecsize, _("TB"))
        # Round harddisk sizes beyond ~300GB to full tens: 320, 500, 640, 750GB
        elif iecsize > 300000:
            iecsize = "%d %s" % (((iecsize + 5000) // 10000 * 10), _("GB"))
        # ... be more precise for media < ~300GB (Sticks, SSDs, CF, MMC, ...): 1, 2, 4, 8, 16 ... 256GB
        elif iecsize > 1000:
            iecsize = "%d %s" % (((iecsize + 500) // 1000), _("GB"))
        else:
            iecsize = "%d %s" % (iecsize, _("MB"))

        info['hdd'].append({
            "model":
            hdd.model(),
            "capacity":
            size,
            "labelled_capacity":
            iecsize,
            "free":
            free,
            "mount":
            dev,
            "friendlycapacity":
            _("%s free / %s total") % (free, size + ' ("' + iecsize + '")')
        })

    info['shares'] = []
    autofiles = ('/etc/auto.network', '/etc/auto.network_vti')
    for autofs in autofiles:
        if fileExists(autofs):
            method = "autofs"
            for line in open(autofs).readlines():
                if not line.startswith('#'):
                    # Replace escaped spaces that can appear inside credentials with underscores
                    # Not elegant but we wouldn't want to expose credentials on the OWIF anyways
                    tmpline = line.replace("\ ", "_")
                    tmp = tmpline.split()
                    if not len(tmp) == 3:
                        continue
                    name = tmp[0].strip()
                    type = "unknown"
                    if "cifs" in tmp[1]:
                        # Linux still defaults to SMBv1
                        type = "SMBv1.0"
                        settings = tmp[1].split(",")
                        for setting in settings:
                            if setting.startswith("vers="):
                                type = setting.replace("vers=", "SMBv")
                    elif "nfs" in tmp[1]:
                        type = "NFS"

                    # Default is r/w
                    mode = _("r/w")
                    settings = tmp[1].split(",")
                    for setting in settings:
                        if setting == "ro":
                            mode = _("r/o")

                    uri = tmp[2]
                    parts = []
                    parts = tmp[2].split(':')
                    if parts[0] == "":
                        server = uri.split('/')[2]
                        uri = uri.strip()[1:]
                    else:
                        server = parts[0]

                    ipaddress = None
                    if server:
                        # Will fail on literal IPs
                        try:
                            # Try IPv6 first, as will Linux
                            if has_ipv6:
                                tmpaddress = None
                                tmpaddress = getaddrinfo(server, 0, AF_INET6)
                                if tmpaddress:
                                    ipaddress = "[" + list(
                                        tmpaddress)[0][4][0] + "]"
                            # Use IPv4 if IPv6 fails or is not present
                            if ipaddress is None:
                                tmpaddress = None
                                tmpaddress = getaddrinfo(server, 0, AF_INET)
                                if tmpaddress:
                                    ipaddress = list(tmpaddress)[0][4][0]
                        except:  # noqa: E722
                            pass

                    friendlyaddress = server
                    if ipaddress is not None and not ipaddress == server:
                        friendlyaddress = server + " (" + ipaddress + ")"
                    info['shares'].append({
                        "name": name,
                        "method": method,
                        "type": type,
                        "mode": mode,
                        "path": uri,
                        "host": server,
                        "ipaddress": ipaddress,
                        "friendlyaddress": friendlyaddress
                    })
    # TODO: fstab

    info['EX'] = ''

    if session:
        try:
            #  gets all current stream clients for images using eStreamServer
            #  TODO: merge eStreamServer and streamList
            #  TODO: get tuner info for streams
            #  TODO: get recoding/timer info if more than one
            info['streams'] = []
            try:
                from enigma import eStreamServer
                streamServer = eStreamServer.getInstance()
                if streamServer is not None:
                    for x in streamServer.getConnectedClients():
                        servicename = ServiceReference(
                            x[1]).getServiceName() or "(unknown service)"
                        if int(x[2]) == 0:
                            strtype = "S"
                        else:
                            strtype = "T"
                        info['streams'].append({
                            "ref": x[1],
                            "name": servicename,
                            "ip": x[0],
                            "type": strtype
                        })
            except Exception as error:
                print("[OpenWebif] -D- no eStreamServer %s" % error)
            recs = NavigationInstance.instance.getRecordings()
            if recs:
                #  only one stream and only TV
                from Plugins.Extensions.OpenWebif.controllers.stream import streamList
                s_name = ''
                # s_cip = ''

                print("[OpenWebif] -D- streamList count '%d'" %
                      len(streamList))
                if len(streamList) == 1:
                    from Screens.ChannelSelection import service_types_tv
                    # from enigma import eEPGCache
                    # epgcache = eEPGCache.getInstance()
                    serviceHandler = eServiceCenter.getInstance()
                    services = serviceHandler.list(
                        eServiceReference('%s ORDER BY name' %
                                          (service_types_tv)))
                    channels = services and services.getContent("SN", True)
                    s = streamList[0]
                    srefs = s.ref.toString()
                    for channel in channels:
                        if srefs == channel[0]:
                            s_name = channel[1] + ' (' + s.clientIP + ')'
                            break
                print("[OpenWebif] -D- s_name '%s'" % s_name)

                # only for debug
                for stream in streamList:
                    srefs = stream.ref.toString()
                    print("[OpenWebif] -D- srefs '%s'" % srefs)

                sname = ''
                timers = []
                for timer in NavigationInstance.instance.RecordTimer.timer_list:
                    if timer.isRunning() and not timer.justplay:
                        timers.append(
                            removeBad(timer.service_ref.getServiceName()))
                        print("[OpenWebif] -D- timer '%s'" %
                              timer.service_ref.getServiceName())


# TODO: more than one recording
                if len(timers) == 1:
                    sname = timers[0]

                if sname == '' and s_name != '':
                    sname = s_name

                print("[OpenWebif] -D- recs count '%d'" % len(recs))

                for rec in recs:
                    feinfo = rec.frontendInfo()
                    frontendData = feinfo and feinfo.getAll(True)
                    if frontendData is not None:
                        cur_info = feinfo.getTransponderData(True)
                        if cur_info:
                            nr = frontendData['tuner_number']
                            info['tuners'][nr]['rec'] = getOrbitalText(
                                cur_info) + ' / ' + sname

            service = session.nav.getCurrentService()
            if service is not None:
                sname = service.info().getName()
                feinfo = service.frontendInfo()
                frontendData = feinfo and feinfo.getAll(True)
                if frontendData is not None:
                    cur_info = feinfo.getTransponderData(True)
                    if cur_info:
                        nr = frontendData['tuner_number']
                        info['tuners'][nr]['live'] = getOrbitalText(
                            cur_info) + ' / ' + sname
        except Exception as error:
            info['EX'] = error

    info['timerpipzap'] = False
    info['timerautoadjust'] = False

    try:
        timer = RecordTimerEntry('', 0, 0, '', '', 0)
        if hasattr(timer, "pipzap"):
            info['timerpipzap'] = True
        if hasattr(timer, "autoadjust"):
            info['timerautoadjust'] = True
    except Exception as error:
        print("[OpenWebif] -D- RecordTimerEntry check %s" % error)

    STATICBOXINFO = info
    return info
Ejemplo n.º 4
0
    def populate(self):
        self["lab1"] = StaticText(_("Open Black Hole"))
        self["lab2"] = StaticText(_("From the BH Team"))
        model = None
        AboutText = ""
        self["lab3"] = StaticText(
            _("Support at %s") % "www.vuplus-community.net")

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

        if about.getChipSetString() != _("unavailable"):
            if SystemInfo["HasHiSi"]:
                AboutText += _("Chipset:\tHiSilicon %s\n"
                               ) % about.getChipSetString().upper()
            elif about.getIsBroadcom():
                AboutText += _("Chipset:\tBroadcom %s\n"
                               ) % about.getChipSetString().upper()
            else:
                AboutText += _(
                    "Chipset:\t%s\n") % about.getChipSetString().upper()

        AboutText += _("CPU:\t%s %s %s\n") % (about.getCPUArch(),
                                              about.getCPUSpeedString(),
                                              about.getCpuCoresString())
        imageSubBuild = ""
        if getImageType() != 'release':
            imageSubBuild = ".%s" % getImageDevBuild()
        AboutText += _("Image:\t%s.%s%s (%s)\n") % (getImageVersion(
        ), getImageBuild(), imageSubBuild, getImageType().title())

        if SystemInfo["HasH9SD"]:
            if "rootfstype=ext4" in open(
                    '/sys/firmware/devicetree/base/chosen/bootargs',
                    'r').read():
                part = "        - SD card in use for Image root \n"
            else:
                part = "        - eMMC slot in use for Image root \n"
            AboutText += _("%s") % part

        if SystemInfo["canMultiBoot"]:
            slot = image = GetCurrentImage()
            part = "eMMC slot %s" % slot
            bootmode = ""
            if SystemInfo["canMode12"]:
                bootmode = "bootmode = %s" % GetCurrentImageMode()
            print "[About] HasHiSi = %s, slot = %s" % (SystemInfo["HasHiSi"],
                                                       slot)
            if SystemInfo["HasHiSi"] and "sda" in SystemInfo["canMultiBoot"][
                    slot]['root']:
                if slot > 4:
                    image -= 4
                else:
                    image -= 1
                part = "SDcard slot %s (%s) " % (
                    image, SystemInfo["canMultiBoot"][slot]['root'])
            AboutText += _("Image Slot:\t%s") % "STARTUP_" + str(
                slot) + "  " + part + " " + bootmode + "\n"

        skinWidth = getDesktop(0).size().width()
        skinHeight = getDesktop(0).size().height()

        string = getDriverDate()
        year = string[0:4]
        month = string[4:6]
        day = string[6:8]
        driversdate = '-'.join((year, month, day))
        AboutText += _("Drivers:\t%s\n") % driversdate
        AboutText += _("Kernel:\t%s\n") % about.getKernelVersionString()
        AboutText += _("GStreamer:\t%s\n") % about.getGStreamerVersionString(
        ).replace("GStreamer ", "")
        AboutText += _("FFmpeg:\t%s\n") % about.getFFmpegVersionString(
        ).replace("FFmpeg ", "")
        AboutText += _("Python:\t%s\n") % about.getPythonVersionString()
        AboutText += _("Installed:\t%s\n") % about.getFlashDateString()
        AboutText += _("Last update:\t%s\n") % getEnigmaVersionString()
        AboutText += _("E2 (re)starts:\t%s\n") % config.misc.startCounter.value
        AboutText += _("Skin:\t%s") % config.skin.primary_skin.value[0:-9] + _(
            "  (%s x %s)") % (skinWidth, skinHeight) + "\n"

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

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

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

        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%s\n") % (bootloader)

        self["AboutScrollLabel"] = ScrollLabel(AboutText)
Ejemplo n.º 5
0
    def populate(self):
        self["lab1"] = StaticText(_("Virtuosso Image Xtreme"))
        self["lab2"] = StaticText(_("By Team ViX"))
        model = None
        AboutText = ""
        self["lab3"] = StaticText(
            _("Support at") + " www.world-of-satellite.com")

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

        if about.getChipSetString() != _("unavailable"):
            if SystemInfo["HasHiSi"]:
                AboutText += _("Chipset:\tHiSilicon %s\n"
                               ) % about.getChipSetString().upper()
            elif about.getIsBroadcom():
                AboutText += _("Chipset:\tBroadcom %s\n"
                               ) % about.getChipSetString().upper()
            else:
                AboutText += _(
                    "Chipset:\t%s\n") % about.getChipSetString().upper()

        AboutText += _("CPU:\t%s %s %s\n") % (about.getCPUArch(),
                                              about.getCPUSpeedString(),
                                              about.getCpuCoresString())

        if SystemInfo["BoxInfo"]:
            BoxInfo = SystemInfo["BoxInfo"]
            AboutText += _("SoC:\t%s\n") % BoxInfo.getItem("socfamily").upper()

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

        tempinfo = ""
        if path.exists("/proc/stb/fp/temp_sensor_avs"):
            with open("/proc/stb/fp/temp_sensor_avs", "r") as f:
                tempinfo = f.read()
        elif path.exists("/sys/devices/virtual/thermal/thermal_zone0/temp"):
            try:
                with open("/sys/devices/virtual/thermal/thermal_zone0/temp",
                          "r") as f:
                    tempinfo = f.read()
                    tempinfo = tempinfo[:-4]
            except:
                tempinfo = ""
        elif path.exists("/proc/hisi/msp/pm_cpu"):
            try:
                tempinfo = search(
                    "temperature = (\d+) degree",
                    open("/proc/hisi/msp/pm_cpu").read()).group(1)
            except:
                tempinfo = ""
        if tempinfo and int(tempinfo) > 0:
            AboutText += _("Processor temp:\t%s") % tempinfo.replace(
                "\n", "").replace(" ", "") + "\xb0" + "C\n"

        imageSubBuild = ""
        if getImageType() != "release":
            imageSubBuild = ".%s" % getImageDevBuild()
        AboutText += _("Image:\t%s.%s%s (%s)\n") % (getImageVersion(
        ), getImageBuild(), imageSubBuild, getImageType().title())

        if SystemInfo["BoxInfo"]:
            BoxInfo = SystemInfo["BoxInfo"]
            if BoxInfo.getItem(
                    "mtdbootfs") != "" and " " not in BoxInfo.getItem(
                        "mtdbootfs"):
                AboutText += _("Boot Device:\t%s\n") % BoxInfo.getItem(
                    "mtdbootfs")
        if SystemInfo["HasH9SD"]:
            if "rootfstype=ext4" in open(
                    "/sys/firmware/devicetree/base/chosen/bootargs",
                    "r").read():
                part = "        - SD card in use for Image root \n"
            else:
                part = "        - eMMC slot in use for Image root \n"
            AboutText += _("%s") % part

        if SystemInfo["canMultiBoot"]:
            slot = image = SystemInfo["MultiBootSlot"]
            part = "eMMC slot %s" % slot
            bootmode = ""
            if SystemInfo["canMode12"]:
                bootmode = "bootmode = %s" % GetCurrentImageMode()
            print("[About] HasHiSi = %s, slot = %s" %
                  (SystemInfo["HasHiSi"], slot))
            if SystemInfo["HasHiSi"] and "sda" in SystemInfo["canMultiBoot"][
                    slot]["root"]:
                if slot > 4:
                    image -= 4
                else:
                    image -= 1
                part = "SDcard slot %s (%s) " % (
                    image, SystemInfo["canMultiBoot"][slot]["root"])
            AboutText += _("Image Slot:\t%s") % "Startup " + str(
                slot) + " - " + part + " " + bootmode + "\n"

        if getMachineName() in ("ET8500") and path.exists("/proc/mtd"):
            self.dualboot = self.dualBoot()
            if self.dualboot:
                AboutText += _("ET8500 Multiboot: Installed\n")

        skinWidth = getDesktop(0).size().width()
        skinHeight = getDesktop(0).size().height()

        string = getDriverDate()
        year = string[0:4]
        month = string[4:6]
        day = string[6:8]
        driversdate = "-".join((day, month, year))

        AboutText += _("Drivers:\t%s\n") % driversdate
        AboutText += _("Kernel:\t%s\n") % about.getKernelVersionString()
        AboutText += _("GStreamer:\t%s\n") % about.getGStreamerVersionString(
        ).replace("GStreamer ", "")
        if isPluginInstalled(
                "ServiceApp"
        ) and config.plugins.serviceapp.servicemp3.replace.value == True:
            AboutText += _(
                "4097 iptv player:\t%s\n"
            ) % config.plugins.serviceapp.servicemp3.player.value
        else:
            AboutText += _("4097 iptv player:\tDefault player\n")
        AboutText += _("Python:\t%s\n") % about.getPythonVersionString()
        flashDate = about.getFlashDateString()[8:] + about.getFlashDateString(
        )[4:8] + about.getFlashDateString()[0:4]
        AboutText += _("Installed:\t%s\n") % flashDate
        lastUpdate = getEnigmaVersionString()[8:] + getEnigmaVersionString(
        )[4:8] + getEnigmaVersionString()[0:4]
        AboutText += _("Last update:\t%s\n") % lastUpdate
        AboutText += _("E2 (re)starts:\t%s\n") % config.misc.startCounter.value
        uptime = about.getBoxUptime()
        if uptime:
            AboutText += _("Uptime:\t%s\n") % uptime
        e2uptime = about.getEnigmaUptime()
        if e2uptime:
            AboutText += _("Enigma2 uptime:\t%s\n") % e2uptime
        AboutText += _("Skin:\t%s") % config.skin.primary_skin.value[0:-9] + _(
            "  (%s x %s)") % (skinWidth, skinHeight) + "\n"

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

        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%s\n") % (bootloader)

        self["AboutScrollLabel"] = ScrollLabel(AboutText)
Ejemplo n.º 6
0
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
Ejemplo n.º 7
0
    def __init__(self, session):
        Screen.__init__(self, session)
        self.setTitle(_("About"))
        hddsplit = skin.parameters.get("AboutHddSplit", 0)

        procmodel = getBoxProc()

        AboutText = _("Hardware: ") + about.getHardwareTypeString() + "\n"
        if procmodel != about.getHardwareTypeString():
            AboutText += _("Proc model: ") + procmodel + "\n"
        if fileExists("/proc/stb/info/sn"):
            hwserial = open("/proc/stb/info/sn", "r").read().strip()
            AboutText += _("Hardware serial: ") + hwserial + "\n"

        AboutText += _("Brand: ") + about.getHardwareBrand() + "\n"

        cpu = about.getCPUInfoString()
        AboutText += _("CPU: ") + cpu + "\n"
        AboutText += _("CPU brand: ") + about.getCPUBrand() + "\n"
        AboutText += _("CPU architecture: ") + about.getCPUArch() + "\n"
        if boxbranding.getImageFPU() != "":
            AboutText += _("FPU: ") + boxbranding.getImageFPU() + "\n"
        AboutText += _(
            "Image architecture: ") + boxbranding.getImageArch() + "\n"

        if boxbranding.getImageArch() == "aarch64":
            if boxbranding.getHaveMultiLib() == "True":
                AboutText += _("MultiLib: ") + _("Yes") + "\n"
            else:
                AboutText += _("MultiLib: ") + _("No") + "\n"

        AboutText += _("Flash type: ") + about.getFlashType() + "\n"

        AboutText += "\n" + _("Image: ") + about.getImageTypeString() + "\n"
        AboutText += _("Feed URL: ") + boxbranding.getFeedsUrl() + "\n"

        AboutText += _(
            "Open Vision version: ") + about.getVisionVersion() + "\n"
        AboutText += _(
            "Open Vision revision: ") + about.getVisionRevision() + "\n"
        AboutText += _("Open Vision module: ") + about.getVisionModule() + "\n"

        AboutText += _("Build date: ") + about.getBuildDateString() + "\n"
        AboutText += _("Last update: ") + about.getUpdateDateString() + "\n"

        # [WanWizard] Removed until we find a reliable way to determine the installation date
        # AboutText += _("Installed: ") + about.getFlashDateString() + "\n"

        EnigmaVersion = about.getEnigmaVersionString()
        EnigmaVersion = EnigmaVersion.rsplit("-", EnigmaVersion.count("-") - 2)
        if len(EnigmaVersion) == 3:
            EnigmaVersion = EnigmaVersion[0] + " (" + EnigmaVersion[
                2] + "-" + EnigmaVersion[1] + ")"
        else:
            EnigmaVersion = EnigmaVersion[0] + " (" + EnigmaVersion[1] + ")"
        EnigmaVersion = _("Enigma version: ") + EnigmaVersion
        self["EnigmaVersion"] = StaticText(EnigmaVersion)
        AboutText += "\n" + EnigmaVersion + "\n"
        AboutText += _(
            "Enigma (re)starts: %d\n") % config.misc.startCounter.value
        AboutText += _("Enigma debug level: %d\n") % eGetEnigmaDebugLvl()

        AboutText += "\n" + _(
            "Kernel version: ") + about.getKernelVersionString() + "\n"

        AboutText += _(
            "DVB driver version: ") + about.getDriverInstalledDate() + "\n"
        AboutText += _("DVB API: ") + about.getDVBAPI() + "\n"
        if fileExists("/usr/bin/dvb-fe-tool"):
            import time
            try:
                cmd = 'dvb-fe-tool > /tmp/dvbfetool.txt'
                res = Console().ePopen(cmd)
                time.sleep(0.1)
            except:
                pass
        if fileExists("/tmp/dvbfetool.txt"):
            if fileHas("/tmp/dvbfetool.txt", "DVBC") or fileHas(
                    "/tmp/dvbfetool.txt", "DVB-C"):
                AboutText += _("DVB-C: ") + _("Yes") + "\n"
            else:
                AboutText += _("DVB-C: ") + _("No") + "\n"
            if fileHas("/tmp/dvbfetool.txt", "DVBS") or fileHas(
                    "/tmp/dvbfetool.txt", "DVB-S"):
                AboutText += _("DVB-S: ") + _("Yes") + "\n"
            else:
                AboutText += _("DVB-S: ") + _("No") + "\n"
            if fileHas("/tmp/dvbfetool.txt", "DVBT") or fileHas(
                    "/tmp/dvbfetool.txt", "DVB-T"):
                AboutText += _("DVB-T: ") + _("Yes") + "\n"
            else:
                AboutText += _("DVB-T: ") + _("No") + "\n"
            if fileHas("/tmp/dvbfetool.txt", "MULTISTREAM"):
                AboutText += _("Multistream: ") + _("Yes") + "\n"
            else:
                AboutText += _("Multistream: ") + _("No") + "\n"
            if fileHas("/tmp/dvbfetool.txt", "ANNEX_A") or fileHas(
                    "/tmp/dvbfetool.txt", "ANNEX-A"):
                AboutText += _("ANNEX-A: ") + _("Yes") + "\n"
            else:
                AboutText += _("ANNEX-A: ") + _("No") + "\n"
            if fileHas("/tmp/dvbfetool.txt", "ANNEX_B") or fileHas(
                    "/tmp/dvbfetool.txt", "ANNEX-B"):
                AboutText += _("ANNEX-B: ") + _("Yes") + "\n"
            else:
                AboutText += _("ANNEX-B: ") + _("No") + "\n"
            if fileHas("/tmp/dvbfetool.txt", "ANNEX_C") or fileHas(
                    "/tmp/dvbfetool.txt", "ANNEX-C"):
                AboutText += _("ANNEX-C: ") + _("Yes") + "\n"
            else:
                AboutText += _("ANNEX-C: ") + _("No") + "\n"

        GStreamerVersion = _("GStreamer version: "
                             ) + about.getGStreamerVersionString(cpu).replace(
                                 "GStreamer", "")
        self["GStreamerVersion"] = StaticText(GStreamerVersion)
        AboutText += "\n" + GStreamerVersion + "\n"

        FFmpegVersion = _("FFmpeg version: ") + about.getFFmpegVersionString()
        self["FFmpegVersion"] = StaticText(FFmpegVersion)
        AboutText += FFmpegVersion + "\n"

        AboutText += _(
            "Python version: ") + about.getPythonVersionString() + "\n"

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

        self["FPVersion"] = StaticText(fp_version)

        if boxbranding.getHaveTranscoding() != "":
            AboutText += _("Transcoding: ") + _("Yes") + "\n"
        else:
            AboutText += _("Transcoding: ") + _("No") + "\n"

        if boxbranding.getHaveMultiTranscoding() != "":
            AboutText += _("MultiTranscoding: ") + _("Yes") + "\n"
        else:
            AboutText += _("MultiTranscoding: ") + _("No") + "\n"

        AboutText += _('Skin & Resolution: %s (%sx%s)\n') % (
            config.skin.primary_skin.value.split('/')[0],
            getDesktop(0).size().width(), getDesktop(0).size().height())

        self["TunerHeader"] = StaticText(_("Detected NIMs:"))
        AboutText += "\n" + _("Detected NIMs:") + "\n"

        nims = nimmanager.nimListCompressed()
        for count in range(len(nims)):
            if count < 4:
                self["Tuner" + str(count)] = StaticText(nims[count])
            else:
                self["Tuner" + str(count)] = StaticText("")
            AboutText += nims[count] + "\n"

        self["HDDHeader"] = StaticText(_("Detected HDD:"))
        AboutText += "\n" + _("Detected HDD:") + "\n"

        hddlist = harddiskmanager.HDDList()
        hddinfo = ""
        if hddlist:
            formatstring = hddsplit and "%s:%s, %.1f %sB %s" or "%s\n(%s, %.1f %sB %s)"
            for count in range(len(hddlist)):
                if hddinfo:
                    hddinfo += "\n"
                hdd = hddlist[count][1]
                if int(hdd.free()) > 1024:
                    hddinfo += formatstring % (hdd.model(), hdd.capacity(),
                                               hdd.free() / 1024.0, "G",
                                               _("free"))
                else:
                    hddinfo += formatstring % (hdd.model(), hdd.capacity(),
                                               hdd.free(), "M", _("free"))
        else:
            hddinfo = _("none")
        self["hddA"] = StaticText(hddinfo)
        AboutText += hddinfo + "\n\n" + _("Network Info:")
        for x in about.GetIPsFromNetworkInterfaces():
            AboutText += "\n" + x[0] + ": " + x[1]

        self["AboutScrollLabel"] = ScrollLabel(AboutText)
        self["key_green"] = Button(_("Translations"))
        self["key_red"] = Button(_("Latest Commits"))
        self["key_yellow"] = Button(_("Troubleshoot"))
        self["key_blue"] = Button(_("Memory Info"))

        self["actions"] = ActionMap(
            ["ColorActions", "SetupActions", "DirectionActions"], {
                "cancel": self.close,
                "ok": self.close,
                "red": self.showCommits,
                "green": self.showTranslationInfo,
                "blue": self.showMemoryInfo,
                "yellow": self.showTroubleshoot,
                "up": self["AboutScrollLabel"].pageUp,
                "down": self["AboutScrollLabel"].pageDown
            })
Ejemplo n.º 8
0
	def __init__(self, session):
		Screen.__init__(self, session)
		self.setTitle(_("About"))
		hddsplit = skin.parameters.get("AboutHddSplit", 0)

		model = getBoxType()

		procmodel = getBoxProc()

		stbplatform = boxbranding.getMachineBuild()

		AboutText = _("Hardware: ") + model + "\n"
		if stbplatform != model:
			AboutText += _("Platform: ") + stbplatform + "\n"
		if procmodel != model:
			AboutText += _("Proc model: ") + procmodel + "\n"

		procmodeltype = getBoxProcType()
		if procmodeltype is not None and procmodeltype != "unknown":
			AboutText += _("Hardware type: ") + procmodeltype + "\n"

		hwserial = getHWSerial()
		if hwserial is not None and hwserial != "unknown":
			AboutText += _("Hardware serial: ") + hwserial + "\n"
		if hwserial is not None and hwserial == "unknown":
			AboutText += _("Hardware serial: ") + about.getCPUSerial() + "\n"

		AboutText += _("Brand/Meta: ") + getBoxBrand() + "\n"

		AboutText += "\n"
		cpu = about.getCPUInfoString()
		AboutText += _("CPU: ") + cpu + "\n"
		AboutText += _("CPU brand: ") + about.getCPUBrand() + "\n"

		socfamily = boxbranding.getSoCFamily()
		if socfamily is not None:
			AboutText += _("SoC family: ") + socfamily + "\n"

		AboutText += _("CPU architecture: ") + about.getCPUArch() + "\n"

		if not boxbranding.getDisplayType().startswith(' '):
			AboutText += "\n"
			AboutText += _("Display type: ") + boxbranding.getDisplayType() + "\n"

		# [WanWizard] Removed until we find a reliable way to determine the installation date
		# AboutText += _("Installed: ") + about.getFlashDateString() + "\n"

		EnigmaVersion = about.getEnigmaVersionString()
		EnigmaVersion = EnigmaVersion.rsplit("-", EnigmaVersion.count("-") - 2)
		if len(EnigmaVersion) == 3:
			EnigmaVersion = EnigmaVersion[0] + " (" + EnigmaVersion[2] + "-" + EnigmaVersion[1] + ")"
		else:
			EnigmaVersion = EnigmaVersion[0] + " (" + EnigmaVersion[1] + ")"
		EnigmaVersion = _("Enigma2 version: ") + EnigmaVersion
		self["EnigmaVersion"] = StaticText(EnigmaVersion)
		AboutText += "\n" + EnigmaVersion + "\n"
		AboutText += _("Last update: ") + about.getUpdateDateString() + "\n"
		AboutText += _("Enigma2 (re)starts: %d\n") % config.misc.startCounter.value
		AboutText += _("Enigma2 debug level: %d\n") % eGetEnigmaDebugLvl()

		if fileExists("/etc/openvision/mediaservice"):
			mediaservice = open("/etc/openvision/mediaservice", "r").read().strip()
			AboutText += _("Media service: ") + mediaservice.replace("enigma2-plugin-systemplugins-","") + "\n"

		AboutText += "\n"

		AboutText += _("Drivers version: ") + about.getDriverInstalledDate() + "\n"
		AboutText += _("Kernel version: ") + boxbranding.getKernelVersion() + "\n"

		GStreamerVersion = _("GStreamer version: ") + about.getGStreamerVersionString(cpu).replace("GStreamer","")
		self["GStreamerVersion"] = StaticText(GStreamerVersion)
		AboutText += "\n" + GStreamerVersion + "\n"

		FFmpegVersion = _("FFmpeg version: ") + about.getFFmpegVersionString()
		self["FFmpegVersion"] = StaticText(FFmpegVersion)
		AboutText += FFmpegVersion + "\n"

		AboutText += "\n"
		AboutText += _("Python version: ") + about.getPythonVersionString() + "\n"
		AboutText += "\n"

		fp_version = getFPVersion()
		if fp_version is None:
			fp_version = ""
		else:
			fp_version = _("Frontprocessor version: %s") % fp_version

			AboutText += fp_version + "\n"

		self["FPVersion"] = StaticText(fp_version)

		AboutText += _('Skin & Resolution: %s (%sx%s)\n') % (config.skin.primary_skin.value.split('/')[0], getDesktop(0).size().width(), getDesktop(0).size().height())

		self["TunerHeader"] = StaticText(_("Detected NIMs:"))
		AboutText += "\n"
		AboutText += _("Detected NIMs:") + "\n"

		nims = nimmanager.nimListCompressed()
		for count in range(len(nims)):
			if count < 4:
				self["Tuner" + str(count)] = StaticText(nims[count])
			else:
				self["Tuner" + str(count)] = StaticText("")
			AboutText += nims[count] + "\n"

		self["HDDHeader"] = StaticText(_("Detected HDD:"))
		AboutText += "\n"
		AboutText += _("Detected HDD:") + "\n"

		hddlist = harddiskmanager.HDDList()
		hddinfo = ""
		if hddlist:
			formatstring = hddsplit and "%s:%s, %.1f %sB %s" or "%s\n(%s, %.1f %sB %s)"
			for count in range(len(hddlist)):
				if hddinfo:
					hddinfo += "\n"
				hdd = hddlist[count][1]
				if int(hdd.free()) > 1024:
					hddinfo += formatstring % (hdd.model(), hdd.capacity(), hdd.Totalfree()/1024.0, "G", _("free"))
				else:
					hddinfo += formatstring % (hdd.model(), hdd.capacity(), hdd.Totalfree(), "M", _("free"))
		else:
			hddinfo = _("none")
		self["hddA"] = StaticText(hddinfo)
		AboutText += hddinfo + "\n\n" + _("Network Info:")
		for x in about.GetIPsFromNetworkInterfaces():
			AboutText += "\n" + x[0] + ": " + x[1]
		AboutText += '\n\n' + _("Uptime") + ": " + about.getBoxUptime()

		self["AboutScrollLabel"] = ScrollLabel(AboutText)
		self["key_green"] = Button(_("Translations"))
		self["key_red"] = Button(_("Latest Commits"))
		self["key_yellow"] = Button(_("Troubleshoot"))
		self["key_blue"] = Button(_("Memory Info"))

		self["actions"] = ActionMap(["ColorActions", "SetupActions", "DirectionActions"],
			{
				"cancel": self.close,
				"ok": self.close,
				"red": self.showCommits,
				"green": self.showTranslationInfo,
				"blue": self.showMemoryInfo,
				"yellow": self.showTroubleshoot,
				"up": self["AboutScrollLabel"].pageUp,
				"down": self["AboutScrollLabel"].pageDown
			})
Ejemplo n.º 9
0
	def populate(self):
		self["lab1"] = StaticText(_("Virtuosso Image Xtreme"))
		self["lab2"] = StaticText(_("By Team ViX"))
		model = None
		AboutText = ""
		self["lab3"] = StaticText(_("Support at") + " www.world-of-satellite.com")

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

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

		AboutText += _("CPU:\t%s %s %s\n") % (about.getCPUArch(), about.getCPUSpeedString(), about.getCpuCoresString())
		imageSubBuild = ""
		if getImageType() != 'release':
			imageSubBuild = ".%s" % getImageDevBuild()
		AboutText += _("Image:\t%s.%s%s (%s)\n") % (getImageVersion(), getImageBuild(), imageSubBuild, getImageType().title())
		skinWidth = getDesktop(0).size().width()
		skinHeight = getDesktop(0).size().height()

		string = getDriverDate()
		year = string[0:4]
		month = string[4:6]
		day = string[6:8]
		driversdate = '-'.join((year, month, day))
		AboutText += _("Drivers:\t%s\n") % driversdate
		AboutText += _("Kernel:\t%s\n") % about.getKernelVersionString()
		AboutText += _("GStreamer:\t%s\n") % about.getGStreamerVersionString().replace("GStreamer ","")
		AboutText += _("Python:\t%s\n") % about.getPythonVersionString()
		AboutText += _("Installed:\t%s\n") % about.getFlashDateString()
		AboutText += _("Last update:\t%s\n") % getEnigmaVersionString()
		AboutText += _("E2 (re)starts:\t%s\n") % config.misc.startCounter.value
		AboutText += _("Skin:\t%s") % config.skin.primary_skin.value[0:-9] + _("  (%s x %s)") % (skinWidth, skinHeight) + "\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 temp:\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('/sys/devices/virtual/thermal/thermal_zone0/temp'):
			try:
				f = open('/sys/devices/virtual/thermal/thermal_zone0/temp', 'r')
				tempinfo = f.read()
				tempinfo = tempinfo[:-4]
				f.close()
			except:
				tempinfo = ""
		if tempinfo and int(tempinfo.replace('\n', '')) > 0:
			mark = str('\xc2\xb0')
			AboutText += _("Processor temp:\t%s") % tempinfo.replace('\n', '').replace(' ','') + mark + "C\n"
		AboutLcdText = AboutText.replace('\t', ' ')

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

		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%s\n") % (bootloader)

		self["AboutScrollLabel"] = ScrollLabel(AboutText)
Ejemplo n.º 10
0
    def populate(self):
        self["lab1"] = StaticText(_("Virtuosso Image Xtreme"))
        self["lab2"] = StaticText(_("By Team ViX"))
        model = None
        AboutText = ""
        self["lab3"] = StaticText(
            _("Support at") + " www.world-of-satellite.com")

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

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

        AboutText += _("CPU:\t%s %s %s\n") % (about.getCPUArch(),
                                              about.getCPUSpeedString(),
                                              about.getCpuCoresString())
        imageSubBuild = ""
        if getImageType() != 'release':
            imageSubBuild = ".%s" % getImageDevBuild()
        AboutText += _("Image:\t%s.%s%s (%s)\n") % (getImageVersion(
        ), getImageBuild(), imageSubBuild, getImageType().title())
        skinWidth = getDesktop(0).size().width()
        skinHeight = getDesktop(0).size().height()

        string = getDriverDate()
        year = string[0:4]
        month = string[4:6]
        day = string[6:8]
        driversdate = '-'.join((year, month, day))
        AboutText += _("Drivers:\t%s\n") % driversdate
        AboutText += _("Kernel:\t%s\n") % about.getKernelVersionString()
        AboutText += _("GStreamer:\t%s\n") % about.getGStreamerVersionString(
        ).replace("GStreamer ", "")
        AboutText += _("Python:\t%s\n") % about.getPythonVersionString()
        AboutText += _("Installed:\t%s\n") % about.getFlashDateString()
        AboutText += _("Last update:\t%s\n") % getEnigmaVersionString()
        AboutText += _("E2 (re)starts:\t%s\n") % config.misc.startCounter.value
        AboutText += _("Skin:\t%s") % config.skin.primary_skin.value[0:-9] + _(
            "  (%s x %s)") % (skinWidth, skinHeight) + "\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 temp:\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('/sys/devices/virtual/thermal/thermal_zone0/temp'):
            try:
                f = open('/sys/devices/virtual/thermal/thermal_zone0/temp',
                         'r')
                tempinfo = f.read()
                tempinfo = tempinfo[:-4]
                f.close()
            except:
                tempinfo = ""
        if tempinfo and int(tempinfo.replace('\n', '')) > 0:
            mark = str('\xc2\xb0')
            AboutText += _("Processor temp:\t%s") % tempinfo.replace(
                '\n', '').replace(' ', '') + mark + "C\n"
        AboutLcdText = AboutText.replace('\t', ' ')

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

        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%s\n") % (bootloader)

        self["AboutScrollLabel"] = ScrollLabel(AboutText)
Ejemplo n.º 11
0
	def __init__(self, session):
		Screen.__init__(self, session)
		self.setTitle(_("About"))
		hddsplit = skin.parameters.get("AboutHddSplit", 0)

		AboutText = _("Hardware: ") + about.getHardwareTypeString() + "\n"
		AboutText += _("Brand: ") + about.getHardwareBrand() + "\n"
		cpu = about.getCPUInfoString()
		AboutText += _("CPU: ") + cpu + "\n"
		AboutText += _("CPU brand: ") + about.getCPUBrand() + "\n"
		AboutText += _("CPU architecture: ") + about.getCPUArch() + "\n"
		AboutText += _("Flash type: ") + about.getFlashType() + "\n"
		AboutText += _("Image: ") + about.getImageTypeString() + "\n"
		AboutText += _("Open Vision version: ") + about.getVisionVersion() + "\n"
		AboutText += _("Open Vision revision: ") + about.getVisionRevision() + "\n"
		AboutText += _("Open Vision module: ") + about.getVisionModule() + "\n"
		AboutText += _("Build date: ") + about.getBuildDateString() + "\n"
		AboutText += _("Last upgrade: ") + about.getUpdateDateString() + "\n"

		# [WanWizard] Removed until we find a reliable way to determine the installation date
		# AboutText += _("Installed: ") + about.getFlashDateString() + "\n"

		EnigmaVersion = about.getEnigmaVersionString()
		EnigmaVersion = EnigmaVersion.rsplit("-", EnigmaVersion.count("-") - 2)
		if len(EnigmaVersion) == 3:
			EnigmaVersion = EnigmaVersion[0] + " (" + EnigmaVersion[2] + "-" + EnigmaVersion[1] + ")"
		else:
			EnigmaVersion = EnigmaVersion[0] + " (" + EnigmaVersion[1] + ")"
		EnigmaVersion = _("Enigma version: ") + EnigmaVersion
		self["EnigmaVersion"] = StaticText(EnigmaVersion)
		AboutText += "\n" + EnigmaVersion + "\n"

		AboutText += _("Kernel version: ") + about.getKernelVersionString() + "\n"

		AboutText += _("DVB driver version: ") + about.getDriverInstalledDate() + "\n"

		GStreamerVersion = _("GStreamer version: ") + about.getGStreamerVersionString(cpu).replace("GStreamer","")
		self["GStreamerVersion"] = StaticText(GStreamerVersion)
		AboutText += GStreamerVersion + "\n"

		AboutText += _("Python version: ") + about.getPythonVersionString() + "\n"

		AboutText += _("Enigma (re)starts: %d\n") % config.misc.startCounter.value
		AboutText += _("Enigma debug level: %d\n") % eGetEnigmaDebugLvl()

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

		self["FPVersion"] = StaticText(fp_version)

		AboutText += _('Skin & Resolution: %s (%sx%s)\n') % (config.skin.primary_skin.value.split('/')[0], getDesktop(0).size().width(), getDesktop(0).size().height())

		self["TunerHeader"] = StaticText(_("Detected NIMs:"))
		AboutText += "\n" + _("Detected NIMs:") + "\n"

		nims = nimmanager.nimListCompressed()
		for count in range(len(nims)):
			if count < 4:
				self["Tuner" + str(count)] = StaticText(nims[count])
			else:
				self["Tuner" + str(count)] = StaticText("")
			AboutText += nims[count] + "\n"

		self["HDDHeader"] = StaticText(_("Detected HDD:"))
		AboutText += "\n" + _("Detected HDD:") + "\n"

		hddlist = harddiskmanager.HDDList()
		hddinfo = ""
		if hddlist:
			formatstring = hddsplit and "%s:%s, %.1f %sB %s" or "%s\n(%s, %.1f %sB %s)"
			for count in range(len(hddlist)):
				if hddinfo:
					hddinfo += "\n"
				hdd = hddlist[count][1]
				if int(hdd.free()) > 1024:
					hddinfo += formatstring % (hdd.model(), hdd.capacity(), hdd.free()/1024.0, "G", _("free"))
				else:
					hddinfo += formatstring % (hdd.model(), hdd.capacity(), hdd.free(), "M", _("free"))
		else:
			hddinfo = _("none")
		self["hddA"] = StaticText(hddinfo)
		AboutText += hddinfo + "\n\n" + _("Network Info:")
		for x in about.GetIPsFromNetworkInterfaces():
			AboutText += "\n" + x[0] + ": " + x[1]

		self["AboutScrollLabel"] = ScrollLabel(AboutText)
		self["key_green"] = Button(_("Translations"))
		self["key_red"] = Button(_("Latest Commits"))
		self["key_yellow"] = Button(_("Troubleshoot"))
		self["key_blue"] = Button(_("Memory Info"))

		self["actions"] = ActionMap(["ColorActions", "SetupActions", "DirectionActions"],
			{
				"cancel": self.close,
				"ok": self.close,
				"red": self.showCommits,
				"green": self.showTranslationInfo,
				"blue": self.showMemoryInfo,
				"yellow": self.showTroubleshoot,
				"up": self["AboutScrollLabel"].pageUp,
				"down": self["AboutScrollLabel"].pageDown
			})
Ejemplo n.º 12
0
    def populate(self, bootLoaderInfo):
        # Check that About wasn't closed while the boot loader search
        # ran
        if "list" not in self:
            return

        self.list = []

        self.list.append(
            self.makeHeadingInfoEntry(
                _("Model:"), "%s %s" % (getMachineBrand(), getMachineName())))

        self.list.append(self.makeEmptyEntry())

        if about.getChipSetString() != _("unknown"):
            if about.getIsBroadcom():
                self.list.append(
                    self.makeInfoEntry(
                        _("Chipset:"),
                        "BCM%s" % about.getChipSetString().upper()))
            else:
                self.list.append(
                    self.makeInfoEntry(_("Chipset:"),
                                       about.getChipSetString().upper()))
        self.list.append(
            self.makeInfoEntry(_("CPU:"),
                               about.getCPUString().replace('bcm', 'BCM')))
        self.list.append(
            self.makeInfoEntry(_("Architecture:"), about.getCPUArch()))
        self.list.append(
            self.makeInfoEntry(_("Speed:"), about.getCPUSpeedString()))
        self.list.append(
            self.makeInfoEntry(_("Cores:"), str(about.getCpuCoresString())))
        tempinfo = ""
        if path.exists('/proc/stb/sensors/temp0/value'):
            tempinfo = file('/proc/stb/sensors/temp0/value').read()
        elif path.exists('/proc/stb/fp/temp_sensor'):
            tempinfo = file('/proc/stb/fp/temp_sensor').read()
        elif path.exists('/proc/stb/sensors/temp/value'):
            tempinfo = file('/proc/stb/sensors/temp/value').read()
        if tempinfo and int(tempinfo.replace('\n', '')) > 0:
            mark = str('\xc2\xb0')
            self.list.append(
                self.makeInfoEntry(_("System temperature:"),
                                   tempinfo.replace('\n', '') + mark + "C"))
        tempinfo = ""
        if path.exists('/proc/stb/fp/temp_sensor_avs'):
            tempinfo = file('/proc/stb/fp/temp_sensor_avs').read()
        if tempinfo and int(tempinfo.replace('\n', '')) > 0:
            mark = str('\xc2\xb0')
            self.list.append(
                self.makeInfoEntry(_("Processor temperature:"),
                                   tempinfo.replace('\n', '') + mark + "C"))
        if path.exists('/sys/class/thermal/thermal_zone0/temp'):
            tempinfo = file(
                '/sys/class/thermal/thermal_zone0/temp').read().replace(
                    '\n', '')
        if tempinfo and int(tempinfo) > 0:
            self.list.append(
                self.makeInfoEntry(
                    _("CPU temperature:"),
                    "%d\xc2\xb0C" % ((int(tempinfo) + 500) / 1000)))
        fp_version = getFPVersion()
        if fp_version is not None:
            self.list.append(
                self.makeInfoEntry(_("Front Panel:"), "%d" % fp_version))
        self.list.append(self.makeInfoEntry(_("Bootloader:"), bootLoaderInfo))
        self.list.append(
            self.makeInfoEntry(_("Kernel:"), about.getKernelVersionString()))
        self.list.append(self.makeInfoEntry(_("Drivers:"), getDriverDate()))

        self.list.append(self.makeEmptyEntry())

        self.list.append(
            self.makeInfoEntry(_("WWW:"), about.getImageUrlString()))
        self.list.append(
            self.makeInfoEntry(_("Version:"), about.getImageVersionString()))
        self.list.append(
            self.makeInfoEntry(_("Build:"), about.getBuildString()))
        self.list.append(self.makeInfoEntry(_("Revision:"), getImageBuild()))
        self.list.append(
            self.makeInfoEntry(_("Enigma2:"), about.getEnigmaVersionString()))
        self.list.append(
            self.makeInfoEntry(
                _("GStreamer:"),
                about.getGStreamerVersionString().replace("GStreamer",
                                                          "").strip()))
        self.list.append(
            self.makeInfoEntry(_("Python:"), about.getPythonVersionString()))

        self["list"].updateList(self.list)
Ejemplo n.º 13
0
	def populate(self):
		self["lab1"] = StaticText(_("Virtuosso Image Xtreme"))
		self["lab2"] = StaticText(_("By Team ViX"))
		model = None
		AboutText = ""
		self["lab3"] = StaticText(_("Support at") + " www.world-of-satellite.com")

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

		if about.getChipSetString() != _("unavailable"):
			if SystemInfo["HasHiSi"]:
				AboutText += _("Chipset:\tHiSilicon %s\n") % about.getChipSetString().upper()
			elif about.getIsBroadcom():
				AboutText += _("Chipset:\tBroadcom %s\n") % about.getChipSetString().upper()
			else:
				AboutText += _("Chipset:\t%s\n") % about.getChipSetString().upper()

		AboutText += _("CPU:\t%s %s %s\n") % (about.getCPUArch(), about.getCPUSpeedString(), about.getCpuCoresString())
		imageSubBuild = ""
		if getImageType() != 'release':
			imageSubBuild = ".%s" % getImageDevBuild()
		AboutText += _("Image:\t%s.%s%s (%s)\n") % (getImageVersion(), getImageBuild(), imageSubBuild, getImageType().title())

		if SystemInfo["canMultiBoot"]:
			slot = image = GetCurrentImage()
			part = "eMMC slot %s" %slot
			bootmode = ""
			if SystemInfo["canMode12"]:
				bootmode = "bootmode = %s" %GetCurrentImageMode()
			if SystemInfo["HasSDmmc"]:
				slot += 1
				if image != 0:
					part = "SDC slot %s (%s%s) " %(image, SystemInfo["canMultiBoot"][2], image*2)
				else:
					part = "eMMC slot %s" %slot
			AboutText += _("Image Slot:\t%s") % "STARTUP_" + str(slot) + "  " + part + " " + bootmode + "\n"

		if getMachineName() in ('ET8500') and path.exists('/proc/mtd'):
			self.dualboot = self.dualBoot()
			if self.dualboot:
				AboutText += _("ET8500 Multiboot: Installed\n")

		skinWidth = getDesktop(0).size().width()
		skinHeight = getDesktop(0).size().height()

		string = getDriverDate()
		year = string[0:4]
		month = string[4:6]
		day = string[6:8]
		driversdate = '-'.join((year, month, day))
		AboutText += _("Drivers:\t%s\n") % driversdate
		AboutText += _("Kernel:\t%s\n") % about.getKernelVersionString()
		AboutText += _("GStreamer:\t%s\n") % about.getGStreamerVersionString().replace("GStreamer ","")
		AboutText += _("Python:\t%s\n") % about.getPythonVersionString()
		AboutText += _("Installed:\t%s\n") % about.getFlashDateString()
		AboutText += _("Last update:\t%s\n") % getEnigmaVersionString()
		AboutText += _("E2 (re)starts:\t%s\n") % config.misc.startCounter.value
		AboutText += _("Skin:\t%s") % config.skin.primary_skin.value[0:-9] + _("  (%s x %s)") % (skinWidth, skinHeight) + "\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 temp:\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('/sys/devices/virtual/thermal/thermal_zone0/temp'):
			try:
				f = open('/sys/devices/virtual/thermal/thermal_zone0/temp', 'r')
				tempinfo = f.read()
				tempinfo = tempinfo[:-4]
				f.close()
			except:
				tempinfo = ""
		elif path.exists('/proc/hisi/msp/pm_cpu'):
			try:
				tempinfo = search('temperature = (\d+) degree', open("/proc/hisi/msp/pm_cpu").read()).group(1)
			except:
				tempinfo = ""
		if tempinfo and int(tempinfo) > 0:
			mark = str('\xc2\xb0')
			AboutText += _("Processor temp:\t%s") % tempinfo.replace('\n', '').replace(' ','') + mark + "C\n"
		AboutLcdText = AboutText.replace('\t', ' ')

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

		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%s\n") % (bootloader)

		self["AboutScrollLabel"] = ScrollLabel(AboutText)