Beispiel #1
0
 def getFeedStatus(self):
     officialReleaseFeedsUri = "openvix.co.uk"
     status = 1
     trafficLight = "unknown"
     if self.adapterAvailable():
         if self.NetworkUp():
             if getImageType(
             ) == "release" and officialReleaseFeedsUri in getFeedsUrl(
             ):  # we know the network is good now so only do this check on release images where the release domain applies
                 try:
                     print(
                         "[OnlineUpdateCheck][getFeedStatus] checking feeds state"
                     )
                     req = Request(
                         "http://openvix.co.uk/TrafficLightState.php")
                     d = urlopen(req)
                     trafficLight = d.read().decode()
                     if trafficLight == "stable":
                         status = 0
                     print("trafficLight", trafficLight)
                 except HTTPError as err:
                     print("[OnlineUpdateCheck][getFeedStatus] ERROR:", err)
                     trafficLight = err.code
                 except URLError as err:
                     print("[OnlineUpdateCheck][getFeedStatus] ERROR:",
                           err.reason[0])
                     trafficLight = err.reason[0]
                 except:
                     print("[OnlineUpdateCheck][getFeedStatus] ERROR:",
                           sys.exc_info()[0])
                     trafficLight = -2
             if getImageType(
             ) == "developer" and "openvixdev" in getFeedsUrl():
                 print(
                     "[OnlineUpdateCheck][getFeedStatus] Official developer feeds"
                 )
                 trafficLight = "developer"
             elif officialReleaseFeedsUri not in getFeedsUrl(
             ):  # if not using official feeds mark as alien. There is no status test for alien feeds (including official developer feeds).
                 print(
                     "[OnlineUpdateCheck][getFeedStatus] Alien feeds url: %s"
                     % getFeedsUrl())
                 status = 0
                 trafficLight = "alien"
             config.softwareupdate.updateisunstable.value = status
             return trafficLight
         else:  # network not up
             print("[OnlineUpdateCheck][getFeedStatus] ERROR: -2")
             return -2
     else:  # adapter not available
         print("[OnlineUpdateCheck][getFeedStatus] ERROR: -3")
         return -3
Beispiel #2
0
def kernelMismatch():
	# returns True if a kernal mismatch is found. i.e. STB kernel does not match feeds kernel
	import zlib
	import re

	kernelversion = about.getKernelVersionString().strip()
	if kernelversion == "unknown":
		print '[OnlineVersionCheck][kernelMismatch] unable to retrieve kernel version from STB'
		return False

	uri = "%s/%s/Packages.gz" % (getFeedsUrl(), getMachineBuild())
	try:
		req = urllib2.Request(uri)
		d = urllib2.urlopen(req)
		gz_data = d.read()
	except:
		print '[OnlineVersionCheck][kernelMismatch] error fetching %s' % uri
		return False

	try:
		packages = zlib.decompress(gz_data, 16+zlib.MAX_WBITS)
	except:
		print '[OnlineVersionCheck][kernelMismatch] failed to decompress gz_data'
		return False

	pattern = "kernel-([0-9]+[.][0-9]+[.][0-9]+)"
	matches = re.findall(pattern, packages)
	if matches:
		match = sorted(matches,key=lambda s: list(map(int, s.split('.'))))[-1]
		if match != kernelversion:
			print '[OnlineVersionCheck][kernelMismatch] kernel mismatch found. STB kernel=%s, feeds kernel=%s' % (kernelversion, match)
			return True

	print '[OnlineVersionCheck][kernelMismatch] no kernel mismatch found'
	return False
Beispiel #3
0
def kernelMismatch():
	# returns True if a kernal mismatch is found. i.e. STB kernel does not match feeds kernel
	import zlib
	import re

	kernelversion = about.getKernelVersionString().strip()
	if kernelversion == "unknown":
		print '[OnlineVersionCheck][kernelMismatch] unable to retrieve kernel version from STB'
		return False

	uri = "%s/%s/Packages.gz" % (getFeedsUrl(), getMachineBuild())
	try:
		req = urllib2.Request(uri)
		d = urllib2.urlopen(req)
		gz_data = d.read()
	except:
		print '[OnlineVersionCheck][kernelMismatch] error fetching %s' % uri
		return False

	try:
		packages = zlib.decompress(gz_data, 16+zlib.MAX_WBITS)
	except:
		print '[OnlineVersionCheck][kernelMismatch] failed to decompress gz_data'
		return False

	pattern = "kernel-([0-9]+[.][0-9]+[.][0-9]+)"
	matches = re.findall(pattern, packages)
	if matches:
		match = sorted(matches,key=lambda s: list(map(int, s.split('.'))))[-1]
		if match != kernelversion:
			print '[OnlineVersionCheck][kernelMismatch] kernel mismatch found. STB kernel=%s, feeds kernel=%s' % (kernelversion, match)
			return True

	print '[OnlineVersionCheck][kernelMismatch] no kernel mismatch found'
	return False
Beispiel #4
0
def fetchlog(logtype):
    releasenotes = ""
    try:
        sourceurl = "%s/%s-git.log" % (getFeedsUrl().rsplit("/",
                                                            1)[0], logtype)
        print "[GitLog]", sourceurl
        sourcefile, headers = urllib.urlretrieve(sourceurl)
        fd = open(sourcefile, 'r')
        for line in fd.readlines():
            if getImageType() == 'release' and line.startswith(
                    'openvix: developer'):
                print '[GitLog] Skipping dev line'
                continue
            elif getImageType() == 'developer' and line.startswith(
                    'openvix: release'):
                print '[GitLog] Skipping release line'
                continue
            releasenotes += line
        fd.close()
        releasenotes = releasenotes.replace('\nopenvix: build',
                                            "\n\nopenvix: build")
        releasenotes = releasenotes.replace('\nopenvix: %s' % getImageType(),
                                            "\n\nopenvix: %s" % getImageType())
    except:
        releasenotes = '404 Not Found'
    return releasenotes
Beispiel #5
0
def statusMessage():
	# returns message if status message is found, else False.
	# status-message.php goes in the root folder of the feeds webserver
	uri = "http://%s/status-message.php?machine=%s&version=%s&build=%s" % (getFeedsUrl().split("/")[2], getBoxType(), getImageVersion(), getImageBuild())
	try:
		req = urllib2.Request(uri)
		d = urllib2.urlopen(req)
		message = d.read()
	except:
		print '[OnlineVersionCheck][statusMessage] %s could not be fetched' % uri
		return False

	if message:
		return message
	return False
Beispiel #6
0
def statusMessage():
	# returns message if status message is found, else False.
	# status-message.php goes in the root folder of the feeds webserver
	uri = "http://%s/status-message.php?machine=%s&version=%s&build=%s" % (getFeedsUrl().split("/")[2], getBoxType(), getImageVersion(), getImageBuild())
	try:
		req = urllib2.Request(uri)
		d = urllib2.urlopen(req)
		message = d.read()
	except:
		print '[OnlineVersionCheck][statusMessage] %s could not be fetched' % uri
		return False

	if message:
		return message
	return False
Beispiel #7
0
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("getImageType=%s<" %boxbranding.getImageType())
print("getMachineMake=%s<" %boxbranding.getMachineMake())
print("getImageArch=%s<" %boxbranding.getImageArch())
print("getFeedsUrl=%s<" %boxbranding.getFeedsUrl())
print("getDisplayType=%s<" %boxbranding.getDisplayType())
print("getHaveHDMI%s<" %boxbranding.getHaveHDMI())
print("getHaveYUV%s<" %boxbranding.getHaveYUV())
print("getHaveRCA%s<" %boxbranding.getHaveRCA())
print("getHaveAVJACK%s<" %boxbranding.getHaveAVJACK())
print("getHaveSCART%s<" %boxbranding.getHaveSCART())
print("getHaveSCARTYUV%s<" %boxbranding.getHaveSCARTYUV())
print("getHaveDVI%s<" %boxbranding.getHaveDVI())
print("getHaveMiniTV%s<" %boxbranding.getHaveMiniTV())
print("getHaveHDMIinHD%s<" %boxbranding.getHaveHDMIinHD())
print("getHaveHDMIinFHD%s<" %boxbranding.getHaveHDMIinFHD())
print("getHaveWOL%s<" %boxbranding.getHaveWOL())
print("getHaveWWOL%s<" %boxbranding.getHaveWWOL())
print("getHaveTranscoding1%s<" %boxbranding.getHaveTranscoding1())
print("getHaveTranscoding2%s<" %boxbranding.getHaveTranscoding2())
Beispiel #8
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
Beispiel #9
0
	def __init__(self, session):
		Screen.__init__(self, session)
		self.setTitle(_("Open Vision information"))

		OpenVisionInformationText = _("Open Vision information") + "\n"

		OpenVisionInformationText += "\n"

		if config.misc.OVupdatecheck.value is True:
			try:
				if boxbranding.getVisionVersion().startswith("10"):
					ovurl = "https://raw.githubusercontent.com/OpenVisionE2/openvision-development-platform/python3/meta-openvision/conf/distro/revision.conf"
				else:
					ovurl = "https://raw.githubusercontent.com/OpenVisionE2/openvision-oe/develop/meta-openvision/conf/distro/revision.conf"
				ovresponse = urllib.request.urlopen(ovurl)
				ovrevision = ovresponse.read().decode()
				ovrevisionupdate = ovrevision.split('r')[1][:3]
			except Exception as e:
				ovrevisionupdate = _("Requires internet connection")
		else:
			ovrevisionupdate = _("Disabled in configuration")

		if fileExists("/etc/openvision/visionversion"):
			visionversion = open("/etc/openvision/visionversion", "r").read().strip()
			OpenVisionInformationText += _("Open Vision version: ") + visionversion + "\n"
		else:
			OpenVisionInformationText += _("Open Vision version: ") + boxbranding.getVisionVersion() + "\n"

		if fileExists("/etc/openvision/visionrevision"):
			visionrevision = open("/etc/openvision/visionrevision", "r").read().strip()
			OpenVisionInformationText += _("Open Vision revision: ") + visionrevision + " " + _("(Latest revision on github: ") + str(ovrevisionupdate) + ")" + "\n"
		else:
			OpenVisionInformationText += _("Open Vision revision: ") + boxbranding.getVisionRevision() + " " + _("(Latest revision on github: ") + str(ovrevisionupdate) + ")" + "\n"

		if fileExists("/etc/openvision/visionlanguage"):
			visionlanguage = open("/etc/openvision/visionlanguage", "r").read().strip()
			OpenVisionInformationText += _("Open Vision language: ") + visionlanguage + "\n"

		OpenVisionInformationText += _("Open Vision module: ") + about.getVisionModule() + "\n"
		OpenVisionInformationText += _("Flash type: ") + about.getFlashType() + "\n"

		OpenVisionInformationText += "\n"

		boxrctype = getBoxRCType()
		if boxrctype is not None and boxrctype != "unknown":
			OpenVisionInformationText += _("Factory RC type: ") + boxrctype + "\n"
		if boxrctype is not None and boxrctype == "unknown":
			if fileExists("/usr/bin/remotecfg"):
				OpenVisionInformationText += _("RC type: ") + _("Amlogic remote") + "\n"
			elif fileExists("/usr/sbin/lircd"):
				OpenVisionInformationText += _("RC type: ") + _("LIRC remote") + "\n"

		OpenVisionInformationText += _("Open Vision RC type: ") + boxbranding.getRCType() + "\n"
		OpenVisionInformationText += _("Open Vision RC name: ") + boxbranding.getRCName() + "\n"
		OpenVisionInformationText += _("Open Vision RC ID number: ") + boxbranding.getRCIDNum() + "\n"

		OpenVisionInformationText += "\n"

		if SystemInfo["HiSilicon"]:
			OpenVisionInformationText += _("HiSilicon dedicated information") + "\n"

			grab = os.popen("opkg list-installed | grep -- -grab | cut -f4 -d'-'").read().strip()
			if grab != "" and grab != "r0":
				OpenVisionInformationText += _("Grab: ") + grab + "\n"

			hihalt = os.popen("opkg list-installed | grep -- -hihalt | cut -f4 -d'-'").read().strip()
			if hihalt != "":
				OpenVisionInformationText += _("Halt: ") + hihalt + "\n"

			libs = os.popen("opkg list-installed | grep -- -libs | cut -f4 -d'-'").read().strip()
			if libs != "":
				OpenVisionInformationText += _("Libs: ") + libs + "\n"

			partitions = os.popen("opkg list-installed | grep -- -partitions | cut -f4 -d'-'").read().strip()
			if partitions != "":
				OpenVisionInformationText += _("Partitions: ") + partitions + "\n"

			reader = os.popen("opkg list-installed | grep -- -reader | cut -f4 -d'-'").read().strip()
			if reader != "":
				OpenVisionInformationText += _("Reader: ") + reader + "\n"

			showiframe = os.popen("opkg list-installed | grep -- -showiframe | cut -f4 -d'-'").read().strip()
			if showiframe != "":
				OpenVisionInformationText += _("Showiframe: ") + showiframe + "\n"

			OpenVisionInformationText += "\n"

		OpenVisionInformationText += _("Image architecture: ") + boxbranding.getImageArch() + "\n"
		if boxbranding.getImageFolder() != "":
			OpenVisionInformationText += _("Image folder: ") + boxbranding.getImageFolder() + "\n"
		if boxbranding.getImageFileSystem() != "":
			OpenVisionInformationText += _("Image file system: ") + boxbranding.getImageFileSystem() + "\n"
		OpenVisionInformationText += _("Image: ") + boxbranding.getImageDistro() + "\n"
		OpenVisionInformationText += _("Feed URL: ") + boxbranding.getFeedsUrl() + "\n"

		OpenVisionInformationText += _("Compiled by: ") + boxbranding.getDeveloperName() + "\n"
		OpenVisionInformationText += _("Build date: ") + about.getBuildDateString() + "\n"

		OpenVisionInformationText += _("OE: ") + boxbranding.getImageBuild() + "\n"

		OpenVisionInformationText += "\n"

		if boxbranding.getImageFPU() != "":
			OpenVisionInformationText += _("FPU: ") + boxbranding.getImageFPU() + "\n"

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

		OpenVisionInformationText += "\n"

		if boxbranding.getMachineMtdBoot() != "":
			OpenVisionInformationText += _("MTD boot: ") + boxbranding.getMachineMtdBoot() + "\n"
		if boxbranding.getMachineMtdRoot() != "":
			OpenVisionInformationText += _("MTD root: ") + boxbranding.getMachineMtdRoot() + "\n"
		if boxbranding.getMachineMtdKernel() != "":
			OpenVisionInformationText += _("MTD kernel: ") + boxbranding.getMachineMtdKernel() + "\n"

		if boxbranding.getMachineRootFile() != "":
			OpenVisionInformationText += _("Root file: ") + boxbranding.getMachineRootFile() + "\n"
		if boxbranding.getMachineKernelFile() != "":
			OpenVisionInformationText += _("Kernel file: ") + boxbranding.getMachineKernelFile() + "\n"

		if boxbranding.getMachineMKUBIFS() != "":
			OpenVisionInformationText += _("MKUBIFS: ") + boxbranding.getMachineMKUBIFS() + "\n"
		if boxbranding.getMachineUBINIZE() != "":
			OpenVisionInformationText += _("UBINIZE: ") + boxbranding.getMachineUBINIZE() + "\n"

		OpenVisionInformationText += "\n"

		if fileExists("/proc/device-tree/amlogic-dt-id"):
			devicetid = open("/proc/device-tree/amlogic-dt-id", "r").read().strip()
			OpenVisionInformationText += _("Device id: ") + devicetid + "\n"

		if fileExists("/proc/device-tree/le-dt-id"):
			giventid = open("/proc/device-tree/le-dt-id", "r").read().strip()
			OpenVisionInformationText += _("Given device id: ") + giventid + "\n"

		self["AboutScrollLabel"] = ScrollLabel(OpenVisionInformationText)
		self["key_red"] = Button(_("Close"))

		self["actions"] = ActionMap(["ColorActions", "SetupActions", "DirectionActions"],
			{
				"cancel": self.close,
				"ok": self.close,
				"up": self["AboutScrollLabel"].pageUp,
				"down": self["AboutScrollLabel"].pageDown
			})
Beispiel #10
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
            })
Beispiel #11
0
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 "getImageType=%s<" %boxbranding.getImageType()
print "getImageDistro=%s<" %boxbranding.getImageDistro()
print "getImageFolder=%s<" %boxbranding.getImageFolder()
print "getImageFileSystem=%s<" %boxbranding.getImageFileSystem()
print "getImageDevBuild=%s<" %boxbranding.getImageDevBuild()
print "getImageType=%s<" %boxbranding.getImageType()
print "getMachineMake=%s<" %boxbranding.getMachineMake()
print "getImageArch=%s<" %boxbranding.getImageArch()
print "getFeedsUrl=%s<" %boxbranding.getFeedsUrl()
print "getDisplayType=%s<" %boxbranding.getDisplayType()
print "getHaveHDMI=%s<" %boxbranding.getHaveHDMI()
print "getHaveYUV=%s<" %boxbranding.getHaveYUV()
print "getHaveRCA=%s<" %boxbranding.getHaveRCA()
print "getHaveAVJACK=%s<" %boxbranding.getHaveAVJACK()
print "getHaveSCART=%s<" %boxbranding.getHaveSCART()
print "getHaveSCARTYUV=%s<" %boxbranding.getHaveSCARTYUV()
print "getHaveDVI=%s<" %boxbranding.getHaveDVI()
print "getHaveMiniTV=%s<" %boxbranding.getHaveMiniTV()
print "getHaveHDMIinHD=%s<" %boxbranding.getHaveHDMIinHD()
print "getHaveHDMIinFHD=%s<" %boxbranding.getHaveHDMIinFHD()
print "getHaveWOL=%s<" %boxbranding.getHaveWOL()
print "getHaveWWOL=%s<" %boxbranding.getHaveWWOL()
print "getHaveTranscoding1=%s<" %boxbranding.getHaveTranscoding1()
print "getHaveTranscoding2=%s<" %boxbranding.getHaveTranscoding2()
Beispiel #12
0
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 'getImageType=%s<' % boxbranding.getImageType()
print 'getImageDistro=%s<' % boxbranding.getImageDistro()
print 'getImageFolder=%s<' % boxbranding.getImageFolder()
print 'getImageFileSystem=%s<' % boxbranding.getImageFileSystem()
print 'getImageDevBuild=%s<' % boxbranding.getImageDevBuild()
print 'getImageType=%s<' % boxbranding.getImageType()
print 'getMachineMake=%s<' % boxbranding.getMachineMake()
print 'getImageArch=%s<' % boxbranding.getImageArch()
print 'getFeedsUrl=%s<' % boxbranding.getFeedsUrl()
print 'getDisplayType=%s<' % boxbranding.getDisplayType()
print 'getHaveHDMI=%s<' % boxbranding.getHaveHDMI()
print 'getHaveYUV=%s<' % boxbranding.getHaveYUV()
print 'getHaveRCA=%s<' % boxbranding.getHaveRCA()
print 'getHaveAVJACK=%s<' % boxbranding.getHaveAVJACK()
print 'getHaveSCART=%s<' % boxbranding.getHaveSCART()
print 'getHaveSCARTYUV=%s<' % boxbranding.getHaveSCARTYUV()
print 'getHaveDVI=%s<' % boxbranding.getHaveDVI()
print 'getHaveMiniTV=%s<' % boxbranding.getHaveMiniTV()
print 'getHaveHDMIinHD=%s<' % boxbranding.getHaveHDMIinHD()
print 'getHaveHDMIinFHD=%s<' % boxbranding.getHaveHDMIinFHD()
print 'getHaveWOL=%s<' % boxbranding.getHaveWOL()
print 'getHaveWWOL=%s<' % boxbranding.getHaveWWOL()
print 'getHaveTranscoding1=%s<' % boxbranding.getHaveTranscoding1()
print 'getHaveTranscoding2=%s<' % boxbranding.getHaveTranscoding2()