Ejemplo n.º 1
0
 def getTranslation(self, text):
     return _(text).replace(
         "%s %s (kernel %s)", "%s %s (kernel %s)" %
         (getBoxBrand(), getBoxType(),
          boxbranding.getKernelVersion())).replace(
              "%s-%s", "%s-%s" %
              (boxbranding.getVisionVersion(),
               boxbranding.getVisionRevision())).replace(
                   "%s (type %s id %s)", "%s (type %s id %s)" %
                   (boxbranding.getRCName(), boxbranding.getRCType(),
                    boxbranding.getRCIDNum()))
Ejemplo n.º 2
0
	def __init__(self, session):
		Screen.__init__(self, session)
		self.setTitle(_("Latest Commits"))
		self.skinName = ["CommitInfo", "About"]
		self["AboutScrollLabel"] = ScrollLabel(_("Please wait"))

		self["actions"] = ActionMap(["SetupActions", "DirectionActions"],
			{
				"cancel": self.close,
				"ok": self.close,
				"up": self["AboutScrollLabel"].pageUp,
				"down": self["AboutScrollLabel"].pageDown,
				"left": self.left,
				"right": self.right
			})

		self["key_red"] = Button(_("Cancel"))

		# get the branch to display from the Enigma version
		try:
			branch = "?sha=" + "-".join(about.getEnigmaVersionString().split("-")[3:])
		except:
			branch = ""

		if boxbranding.getVisionVersion().startswith("10"):
			oegiturl = "https://api.github.com/repos/OpenVisionE2/openvision-development-platform/commits"
		else:
			oegiturl = "https://api.github.com/repos/OpenVisionE2/openvision-oe/commits"

		self.project = 0
		self.projects = [
			("https://api.github.com/repos/OpenVisionE2/enigma2-openvision/commits" + branch, "Enigma2 - Vision"),
			(oegiturl, "OE - Vision"),
			("https://api.github.com/repos/OpenVisionE2/enigma2-plugins/commits", "Enigma2 plugins"),
			("https://api.github.com/repos/OpenVisionE2/alliance-plugins/commits", "Alliance plugins"),
			("https://api.github.com/repos/OpenVisionE2/OpenWebif/commits", "Open WebIF"),
			("https://api.github.com/repos/OpenVisionE2/openvision-core-plugin/commits", "Vision core plugin"),
			("https://api.github.com/repos/OpenVisionE2/BackupSuite/commits", "Backup Suite plugin"),
			("https://api.github.com/repos/OpenVisionE2/OctEtFHD-skin/commits", "OctEtFHD skin")
		]
		self.cachedProjects = {}
		self.Timer = eTimer()
		self.Timer.callback.append(self.readGithubCommitLogs)
		self.Timer.start(50, True)
Ejemplo n.º 3
0
from __future__ import print_function
import sys
import os
from time import time
from Tools.Profile import profile, profile_final
profile("PYTHON_START")

# Don't remove this line. It may seem to do nothing, but if removed,
# it will break output redirection for crash logs.
import Tools.RedirectOutput
from boxbranding import getVisionVersion, getVisionRevision, getHaveMultiLib
print("[mytest] Open Vision version = %s" % getVisionVersion())
print("[mytest] Open Vision revision = %s" % getVisionRevision())
import enigma
import eConsoleImpl
import eBaseImpl
enigma.eTimer = eBaseImpl.eTimer
enigma.eSocketNotifier = eBaseImpl.eSocketNotifier
enigma.eConsoleAppContainer = eConsoleImpl.eConsoleAppContainer

from Components.SystemInfo import SystemInfo
if not SystemInfo["OpenVisionModule"]:
    print(
        "[mytest] Open Vision in multiboot! Now we have to remove what relies on our kernel module!"
    )
    from Components.Console import Console
    Console = Console()
    Console.ePopen('opkg remove enigma2-plugin-extensions-e2iplayer')
    print("[mytest] Removed, this is on you not us!")

from traceback import print_exc
Ejemplo n.º 4
0
from Tools.Profile import profile, profile_final
profile("PYTHON_START")

# Don't remove this line. It may seem to do nothing, but if removed,
# it will break output redirection for crash logs.
from Tools import RedirectOutput
from Tools.Directories import resolveFilename, fileExists
from boxbranding import getVisionVersion, getVisionRevision, getHaveMultiLib, getMachineBuild, getSoCFamily
from enigma import getBoxType, getBoxBrand

model = getBoxType()
brand = getBoxBrand()
platform = getMachineBuild()
socfamily = getSoCFamily()

print("[mytest] Open Vision version = %s" % getVisionVersion())
print("[mytest] Open Vision revision = %s" % getVisionRevision())
print("[mytest] Brand/Meta = %s" % brand)
print("[mytest] Model = %s" % model)
print("[mytest] Platform = %s" % platform)
print("[mytest] SoC family = %s" % socfamily)

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

if getVisionVersion().startswith("10") and not fileExists(
        "/var/tmp/ntpv4.local") and platform != "dm4kgen":
Ejemplo n.º 5
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.º 6
0
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())
print("getHaveCI%s<" % boxbranding.getHaveCI())
print("getVisionVersion=%s<" % boxbranding.getVisionVersion())
print("getVisionRevision=%s<" % boxbranding.getVisionRevision())
print("getDeveloperName=%s<" % boxbranding.getDeveloperName())
print("getBoxBrand=%s<" % boxbranding.getBoxBrand())
print("getMachineMtdBoot=%s<" % boxbranding.getMachineMtdBoot())
print("getForceMode=%s<" % boxbranding.getForceMode())
print("getImageFPU=%s<" % boxbranding.getImageFPU())
print("getHaveSmallFlash=%s<" % boxbranding.getHaveSmallFlash())
print("getHaveMiddleFlash=%s<" % boxbranding.getHaveMiddleFlash())
print("getHaveTranscoding=%s<" % boxbranding.getHaveTranscoding())
print("getHaveMultiTranscoding=%s<" % boxbranding.getHaveMultiTranscoding())
print("getHaveMultiLib=%s<" % boxbranding.getHaveMultiLib())
print("getHaveSVIDEO=%s<" % boxbranding.getHaveSVIDEO())
print("getBlindscanBin=%s<" % boxbranding.getBlindscanBin())
print("getSoCFamily=%s<" % boxbranding.getSoCFamily())
print("getHaveVFDSymbol=%s<" % boxbranding.getHaveVFDSymbol())
Ejemplo n.º 7
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
			})
Ejemplo n.º 8
0
import os
from time import time

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

from Tools.Profile import profile, profile_final

profile("PYTHON_START")

# Don't remove this line. It may seem to do nothing, but if removed,
# it will break output redirection for crash logs.
import Tools.RedirectOutput
from boxbranding import getVisionVersion, getVisionRevision, getHaveMultiLib

print("Open Vision version = %s" % getVisionVersion())
print("Open Vision revision = %s" % getVisionRevision())
import enigma
import eConsoleImpl
import eBaseImpl

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

from Components.SystemInfo import SystemInfo
if not SystemInfo["OpenVisionModule"]:
    print(
        "[mytest] Open Vision in multiboot! Now we have to remove what relies on our kernel module!"
    )
    from Components.Console import Console
Ejemplo n.º 9
0
#!/usr/bin/python
# -*- coding: utf-8 -*-
from __future__ import print_function
import sys
import os
from time import time
from Tools.Profile import profile, profile_final
profile("PYTHON_START")

# Don't remove this line. It may seem to do nothing, but if removed,
# it will break output redirection for crash logs.
import Tools.RedirectOutput
from Tools.Directories import resolveFilename, fileExists
from boxbranding import getVisionVersion, getVisionRevision, getHaveMultiLib
print("[mytest] Open Vision version = %s" % getVisionVersion())
print("[mytest] Open Vision revision = %s" % getVisionRevision())

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

if getVisionVersion().startswith("10") and not fileExists ("/var/tmp/ntpv4.local"):
	from Components.Console import Console
	print("[mytest] Try load all network interfaces.")
	Console = Console()
	Console.ePopen('/etc/init.d/networking restart ; /etc/init.d/samba.sh restart ; mount -a -t nfs,smbfs,cifs,ncpfs')
	print("[mytest] All network interfaces loaded.")
Ejemplo n.º 10
0
from Tools.Directories import resolveFilename, fileExists
from boxbranding import getVisionVersion, getVisionRevision, getHaveMultiLib, getMachineBuild, getSoCFamily
from enigma import getBoxType, getBoxBrand, getE2Rev

model = getBoxType()
brand = getBoxBrand()
platform = getMachineBuild()
socfamily = getSoCFamily()

REDCOLOR = '\033[31m'
NOCOLOR = '\033[m'
GREENCOLOR = '\033[32m'
BLUECOLOR = '\033[34m'
YELLOWCOLOR = '\033[33m'

print(REDCOLOR + "[StartEnigma] Open Vision version = %s" % getVisionVersion() + NOCOLOR)
print(BLUECOLOR + "[StartEnigma] Open Vision revision = %s" % getVisionRevision() + NOCOLOR)
print(GREENCOLOR + "[StartEnigma] Brand/Meta = %s" % brand + NOCOLOR)
print(GREENCOLOR + "[StartEnigma] Model = %s" % model + NOCOLOR)
print(GREENCOLOR + "[StartEnigma] Platform = %s" % platform + NOCOLOR)
print(GREENCOLOR + "[StartEnigma] SoC family = %s" % socfamily + NOCOLOR)
print(YELLOWCOLOR + "[StartEnigma] Enigma2 revision = %s" % getE2Rev() + NOCOLOR)

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

if fileExists("/etc/init.d/inetd.busybox"):
Ejemplo n.º 11
0
from __future__ import print_function
import os
import re
from socket import *
from Components.Console import Console
from Components.PluginComponent import plugins
from Plugins.Plugin import PluginDescriptor
from boxbranding import getVisionVersion

oeversion = getVisionVersion()

class Network:
	def __init__(self):
		self.ifaces = {}
		self.configuredNetworkAdapters = []
		self.NetworkState = 0
		self.DnsState = 0
		self.nameservers = []
		self.ethtool_bin = "/usr/sbin/ethtool"
		self.console = Console()
		self.linkConsole = Console()
		self.restartConsole = Console()
		self.deactivateInterfaceConsole = Console()
		self.activateInterfaceConsole = Console()
		self.resetNetworkConsole = Console()
		self.dnsConsole = Console()
		self.pingConsole = Console()
		self.config_ready = None
		self.friendlyNames = {}
		self.lan_interfaces = []
		self.wlan_interfaces = []
Ejemplo n.º 12
0
import sys
import os
from time import time

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

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

# Don't remove this line. It may seem to do nothing, but if removed,
# it will break output redirection for crash logs.
import Tools.RedirectOutput
from boxbranding import getVisionVersion, getVisionRevision
print "BlackHole version = %s" % getVisionVersion()
print "BlackHole revision = %s" % getVisionRevision()
import enigma
import eConsoleImpl
import eBaseImpl
enigma.eTimer = eBaseImpl.eTimer
enigma.eSocketNotifier = eBaseImpl.eSocketNotifier
enigma.eConsoleAppContainer = eConsoleImpl.eConsoleAppContainer

from traceback import print_exc

profile("ClientMode")
import Components.ClientMode
Components.ClientMode.InitClientMode()

profile("SimpleSummary")
from Screens import InfoBar