Example #1
0
    def imageInstall(self):
        if self.check_free_space():
            pluginpath = '/usr/lib/enigma2/python/Plugins/Extensions/NFR4XBoot'
            myerror = ''
            source = self.source.value.replace(' ', '')
            target = self.target.value.replace(' ', '')
            for fn in os.listdir('/media/nfr4xboot/NFR4XBootI'):
                if fn == target:
                    myerror = _('Sorry, an Image with the name ') + target + _(
                        ' is already installed.\n Please try another name.')
                    continue

            if source == 'None':
                myerror = _(
                    'You have to select one Image to install.\nPlease, upload your zip file in the folder: /media/nfr4xboot/NFR4XBootUpload and select the image to install.'
                )
            if target == '':
                myerror = _('You have to provide a name for the new Image.')
            if target == 'Flash':
                myerror = _(
                    'Sorry this name is reserved. Choose another name for the new Image.'
                )
            if len(target) > 35:
                myerror = _('Sorry the name of the new Image is too long.')
            if myerror:
                myerror
                self.session.open(MessageBox, myerror, MessageBox.TYPE_INFO)
            else:
                myerror
                message = "echo -e '\n\n"
                message += _('NFR4XBoot will install the new image.\n\n')
                message += _(
                    'Please: DO NOT reboot your STB and turn off the power.\n\n'
                )
                message += _(
                    'The new image will be installed and auto booted in few minutes.\n\n'
                )
                message += "'"
                if fileExists(pluginpath + '/ex_init.py'):
                    cmd1 = 'python ' + pluginpath + '/ex_init.py'
                elif fileExists(pluginpath + '/ex_init.pyc'):
                    cmd1 = 'python ' + pluginpath + '/ex_init.pyc'
                else:
                    cmd1 = 'python ' + pluginpath + '/ex_init.pyo'
                cmd = '%s %s %s %s %s %s %s %s %s' % (
                    cmd1, source, target.replace(' ', '.'), str(
                        self.sett.value), str(
                            self.bootquest.value), str(self.zipdelete.value),
                    getImageFolder(), getMachineRootFile(), getImageArch())
                print('[NFR4X-BOOT]: ', cmd)
                self.session.open(Console, _('NFR4XBoot: Install new image'),
                                  [message, cmd])
Example #2
0
def getFFmpegVersionString():
    try:
        from glob import glob
        if not getImageArch() == "aarch64":
            ffmpeg = [
                x.split("Version: ") for x in open(
                    glob("/var/lib/opkg/info/ffmpeg.control")[0], "r")
                if x.startswith("Version:")
            ][0]
        else:
            ffmpeg = [
                x.split("Version: ") for x in open(
                    glob("/var/lib/opkg/info/ffmpeg.control")[0], "r")
                if x.startswith("Version:")
            ][0]
        return "%s" % ffmpeg[1].split("-")[0].replace("\n", "")
    except:
        return _("unknown")
    def green(self, ret = None):
        sel = self['imageList'].l.getCurrentSelection()
        if sel == None:
            print 'Nothing to select !!'
            return
        else:
            file_name = self.imagePath + '/' + sel
            self.filename = file_name
            self.sel = sel
            box = self.box()
            self.hide()
            if self.distro == 'openvix':
                url = self.feedurl + '/openvix-builds/' + box[1] + '/' + sel 
            elif self.distro == 'openpli':
                url = 'http://downloads.openpli.org/builds/' + box[0] + '/' + sel
            elif self.distro == 'openeight':
                url = self.feedurl + '/images/' + box[0] + '/' + sel
            elif self.distro == 'openhdf':
                url = self.feedurl + '/' + sel
                #url = 'http://images.hdfreaks.cc/' + box[0] + '/' + sel
            elif self.distro == 'pure2':
                url = 'http://pur-e2.club/OU/images/6.2/' + BRANDOEM + '/' + sel
            elif self.distro == 'opendroid':
                url = self.feedurl + '/' + BRANDOEMDROID + '/' + MASCHINEBUILD + '/' + sel				
            elif self.distro == 'satdreamgr':
                url = self.feedurl + '/' + sel
            elif self.distro == 'hdmu':
                self.feedurl2 = 'www.hdmedia-universe.com/images/'
		if "cortexa15hf" in getImageArch():
                    url = 'http://www.hdmedia-universe.com/images/arm/' + box[0] + '/' + sel					
		else:
                    url = 'http://www.hdmedia-universe.com/images/mips/' + box[0] + '/' + sel	
            elif self.distro == 'egami':
                if box[0] == "ax51":
                    url = 'http://image.egami-image.com/hd51/' + sel
                else: 
                    url = 'http://image.egami-image.com/' + box[0] + '/' + sel  				
            elif self.distro == 'opendroid':
                url = self.feedurl + '/' + box[0] + '/' + box[1] + '/' + sel            
            else:
                url = self.feedurl + '/' + box[0] + '/' + sel
            print '[NFR4XBoot] Image download url: ', url
            try:
                u = urllib2.urlopen(url)
            except:
                self.session.open(MessageBox, _('The URL to this image is not correct !!'), type=MessageBox.TYPE_ERROR)
                self.close()

            f = open(file_name, 'wb')
            f.close()
            try:		
                meta = u.info()
                file_size = int(meta.getheaders('Content-Length')[0])
                print 'Downloading: %s Bytes: %s' % (sel, file_size)
                job = ImageDownloadJob(url, file_name, sel)
                job.afterEvent = 'close'
                job_manager.AddJob(job)
                job_manager.failed_jobs = []
                self.session.openWithCallback(self.ImageDownloadCB, JobView, job, backgroundable=False, afterEventChangeable=False)
                return
            except:
                self.session.open(MessageBox, _('The URL to this image is not correct !!'), type=MessageBox.TYPE_ERROR)
                self.close()    	
Example #4
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
Example #5
0
def hassoftcaminstalled():
	from Tools.camcontrol import CamControl
	return len(CamControl("softcam").getList()) > 1

def getBootdevice():
	dev = ("root" in cmdline and cmdline["root"].startswith("/dev/")) and cmdline["root"][5:]
	while dev and not fileExists("/sys/block/%s" % dev):
		dev = dev[:-1]
	return dev

model = getBoxType()
brand = getBoxBrand()
platform = getMachineBuild()
displaytype = getDisplayType()
architecture = getImageArch()
socfamily = getSoCFamily()

SystemInfo["InDebugMode"] = eGetEnigmaDebugLvl() >= 4
SystemInfo["CommonInterface"] = eDVBCIInterfaces.getInstance().getNumOfSlots()
SystemInfo["CommonInterfaceCIDelay"] = fileCheck("/proc/stb/tsmux/rmx_delay")
for cislot in range(0, SystemInfo["CommonInterface"]):
	SystemInfo["CI%dSupportsHighBitrates" % cislot] = fileCheck("/proc/stb/tsmux/ci%d_tsclk" % cislot)
	SystemInfo["CI%dRelevantPidsRoutingSupport" % cislot] = fileCheck("/proc/stb/tsmux/ci%d_relevant_pids_routing" % cislot)
SystemInfo["HasSoftcamInstalled"] = hassoftcaminstalled()
SystemInfo["NumVideoDecoders"] = getNumVideoDecoders()
SystemInfo["Udev"] = not fileExists("/dev/.devfsd")
SystemInfo["PIPAvailable"] = SystemInfo["NumVideoDecoders"] > 1
SystemInfo["CanMeasureFrontendInputPower"] = eDVBResourceManager.getInstance().canMeasureFrontendInputPower()
SystemInfo["12V_Output"] = Misc_Options.getInstance().detected_12V_output()
SystemInfo["ZapMode"] = fileCheck("/proc/stb/video/zapmode") or fileCheck("/proc/stb/video/zapping_mode")
Example #6
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
			})
Example #7
0
    mem_info = []
    entrie = os.popen('cat /proc/cmdline').read()

    if getBoxType() in ('vusolo4k', 'zgemmah7', 'zgemmah9t', 'zgemmah9s',
                        'e4hdultra'):
        mem = re.findall('_cma=(.*?)M', entrie)
    else:
        mem = re.findall('bmem=(.*?)M', entrie)

    for info in mem:
        mem_info.append((info))

    if len(mem_info) > 1:
        bmem = int(mem_info[0]) + int(mem_info[1])
    else:
        if getImageArch() == 'cortexa15hf-neon-vfpv4' or getBoxType() in (
                'zgemmah9s', 'e4hdultra'):
            bmem = 250
        else:
            bmem = int(mem_info[0])

SkinModeList = []
SkinModeList.append(("hd", _("HD Skin 1280 x 720")))
if bmem > 180:
    SkinModeList.append(("fullhd", _("FullHD Skin 1920 x 1080")))
#if bmem > 440:
#   if getBoxType() == 'vusolo4k':
#      SkinModeList.append(("uhd", _("UHD Skin 3840 x 2160")))
#SkinModeList.append(("4khd", _("4K Skin 4096 x 2160")))
#if bmem > 880:
#SkinModeList.append(("fulluhd", _("FullUHD Skin 7680 x 4320")))
Example #8
0
print("getMachineRootFile=%s<" %boxbranding.getMachineRootFile())
print("getMachineMKUBIFS=%s<" %boxbranding.getMachineMKUBIFS())
print("getMachineUBINIZE=%s<" %boxbranding.getMachineUBINIZE())
print("getBoxType=%s<" %boxbranding.getBoxType())
print("getBrandOEM=%s<" %boxbranding.getBrandOEM())
print("getOEVersion=%s<" %boxbranding.getOEVersion())
print("getDriverDate=%s<" %boxbranding.getDriverDate())
print("getImageVersion=%s<" %boxbranding.getImageVersion())
print("getImageBuild=%s<" %boxbranding.getImageBuild())
print("getImageDistro=%s<" %boxbranding.getImageDistro())
print("getImageFolder=%s<" %boxbranding.getImageFolder())
print("getImageFileSystem=%s<" %boxbranding.getImageFileSystem())
print("getImageDevBuild=%s<" %boxbranding.getImageDevBuild())
print("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())
Example #9
0
from Tools.Profile import profile, profile_final
profile("PYTHON_START")

import Tools.RedirectOutput
import enigma

from boxbranding import getBoxType, getBrandOEM, getMachineBuild, getImageArch
import eConsoleImpl
import eBaseImpl
enigma.eTimer = eBaseImpl.eTimer
enigma.eSocketNotifier = eBaseImpl.eSocketNotifier
enigma.eConsoleAppContainer = eConsoleImpl.eConsoleAppContainer
boxtype = getBoxType()

if getImageArch() in ("aarch64"):
	import usb.core
	import usb.backend.libusb1
	usb.backend.libusb1.get_backend(find_library=lambda x: "/lib64/libusb-1.0.so.0")

#if os.path.isfile("/usr/lib/enigma2/python/Plugins/Extensions/MediaPortal/plugin.pyo") and boxtype in ('dm7080','dm820','dm520','dm525','dm900','dm920'):
#	import pyo_patcher

from traceback import print_exc

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

profile("Geolocation")
import Tools.Geolocation
Example #10
0
	def startShow(self):
		self.count = 0
		self['connect'].setPixmapNum(0)
		if startselectedcam.endswith('.sh'):
			if path.exists('/tmp/SoftcamsScriptsRunning'):
				file = open('/tmp/SoftcamsScriptsRunning')
				data = file.read()
				file.close()
				if data.find(startselectedcam) >= 0:
					filewrite = open('/tmp/SoftcamsScriptsRunning.tmp', 'w')
					fileread = open('/tmp/SoftcamsScriptsRunning')
					filewrite.writelines([l for l in fileread.readlines() if startselectedcam not in l])
					fileread.close()
					filewrite.close()
					rename('/tmp/SoftcamsScriptsRunning.tmp', '/tmp/SoftcamsScriptsRunning')
				elif data.find(startselectedcam) < 0:
					fileout = open('/tmp/SoftcamsScriptsRunning', 'a')
					line = startselectedcam + '\n'
					fileout.write(line)
					fileout.close()
			else:
				fileout = open('/tmp/SoftcamsScriptsRunning', 'w')
				line = startselectedcam + '\n'
				fileout.write(line)
				fileout.close()
			print('[SoftcamManager] Starting ' + startselectedcam)
			output = open('/tmp/cam.check.log', 'a')
			now = datetime.now()
			output.write(now.strftime("%Y-%m-%d %H:%M") + ": Starting " + startselectedcam + "\n")
			output.close()
			self.Console.ePopen('/usr/softcams/' + startselectedcam + ' start')
		else:
			if path.exists('/tmp/SoftcamsDisableCheck'):
				file = open('/tmp/SoftcamsDisableCheck')
				data = file.read()
				file.close()
				if data.find(startselectedcam) >= 0:
					output = open('/tmp/cam.check.log', 'a')
					now = datetime.now()
					output.write(now.strftime("%Y-%m-%d %H:%M") + ": Initialised timed check for " + stopselectedcam + "\n")
					output.close()
					fileread = open('/tmp/SoftcamsDisableCheck')
					filewrite = open('/tmp/SoftcamsDisableCheck.tmp', 'w')
					filewrite.writelines([l for l in fileread.readlines() if startselectedcam not in l])
					fileread.close()
					filewrite.close()
					rename('/tmp/SoftcamsDisableCheck.tmp', '/tmp/SoftcamsDisableCheck')
			print('[SoftcamManager] Starting ' + startselectedcam)
			output = open('/tmp/cam.check.log', 'a')
			now = datetime.now()
			output.write(now.strftime("%Y-%m-%d %H:%M") + ": Starting " + startselectedcam + "\n")
			output.close()
			if startselectedcam.lower().startswith('wicardd'):
				self.Console.ePopen('/usr/softcams/' + startselectedcam + ' -c' + ' /etc/tuxbox/config/wicardd/wicardd.conf')
			if startselectedcam.lower().startswith('CCcam'):
				self.Console.ePopen('/usr/softcams/' + startselectedcam)
			if getImageArch() == "armv7vehf-neon-vfpv4" and startselectedcam.lower().startswith('mgcamd') or getImageArch() == "cortexa15hf-neon-vfpv4" and startselectedcam.lower().startswith('mgcamd') or getImageArch() == "armv7ahf-neon" and startselectedcam.lower().startswith('mgcamd'):
				self.Console.ePopen('/usr/bin/env LD_PRELOAD=/usr/local/lib/libcrypto.so.1.0.0 /usr/softcams/' + startselectedcam)
			if startselectedcam.lower().startswith('oscam') or startselectedcam.lower().startswith('ncam') or startselectedcam.lower().startswith('oscam-smod') or startselectedcam.lower().startswith('oscam-emu'):
				self.Console.ePopen('ulimit -s 1024;/usr/softcams/' + startselectedcam + ' -b')

		self.activityTimer.start(1)
Example #11
0
    def makeActionOnDownloadItem(self, ret):
        item = self.getSelItem()
        if None != ret and None != item:
            printDBG("makeActionOnDownloadItem " + ret[1] +
                     (" for downloadIdx[%d]" % item.downloadIdx))
            if ret[1] == "play":
                title = item.fileName
                try:
                    title = os_path.basename(title)
                    title = os_path.splitext(title)[0]
                except Exception:
                    printExc()
                # when we watch we no need update sts
                self.DM.setUpdateProgress(False)
                player = ret[2]
                if "mini" == player:
                    self.session.openWithCallback(self.leaveMoviePlayer,
                                                  IPTVMiniMoviePlayer,
                                                  item.fileName, title)
                elif player in ["exteplayer", "extgstplayer"]:
                    additionalParams = {}
                    if item.fileName.split('.')[-1] in [
                            'mp3', 'm4a', 'ogg', 'wma', 'fla', 'wav', 'flac'
                    ]:
                        additionalParams[
                            'show_iframe'] = config.plugins.iptvplayer.show_iframe.value
                        additionalParams[
                            'iframe_file_start'] = config.plugins.iptvplayer.iframe_file.value
                        additionalParams[
                            'iframe_file_end'] = config.plugins.iptvplayer.clear_iframe_file.value
                        if getImageArch() == "sh4":
                            additionalParams['iframe_continue'] = True
                        else:
                            additionalParams['iframe_continue'] = False

                    if "exteplayer" == player:
                        self.session.openWithCallback(self.leaveMoviePlayer,
                                                      IPTVExtMoviePlayer,
                                                      item.fileName, title,
                                                      None, 'eplayer',
                                                      additionalParams)
                    else:
                        self.session.openWithCallback(self.leaveMoviePlayer,
                                                      IPTVExtMoviePlayer,
                                                      item.fileName, title,
                                                      None, 'gstplayer',
                                                      additionalParams)
                else:
                    self.session.openWithCallback(self.leaveMoviePlayer,
                                                  IPTVStandardMoviePlayer,
                                                  item.fileName, title)
            elif self.localMode:
                if ret[1] == "remove":
                    try:
                        os_remove(item.fileName)
                        for idx in range(len(self.localFiles)):
                            if item.fileName == self.localFiles[idx].fileName:
                                del self.localFiles[idx]
                                self.reloadList(True)
                                break
                    except Exception:
                        printExc()
            elif ret[1] == "continue":
                self.DM.continueDownloadItem(item.downloadIdx)
            elif ret[1] == "retry":
                self.DM.retryDownloadItem(item.downloadIdx)
            elif ret[1] == "stop":
                self.DM.stopDownloadItem(item.downloadIdx)
            elif ret[1] == "remove":
                self.DM.removeDownloadItem(item.downloadIdx)
            elif ret[1] == "delet":
                self.DM.deleteDownloadItem(item.downloadIdx)
            elif ret[1] == "move":
                self.DM.moveToTopDownloadItem(item.downloadIdx)
Example #12
0
enigma.eConsoleAppContainer = eConsoleImpl.eConsoleAppContainer

model = getBoxType()
brand = getBoxBrand()

if fileHas ("/var/log/samba/log.nmbd","ERROR: Could not determine network interfaces") and not fileHas ("/var/log/samba/log.nmbd","daemon_ready"):
	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.")

from Components.SystemInfo import SystemInfo
from traceback import print_exc

if getImageArch() == "aarch64":
	import usb.core
	import usb.backend.libusb1
	usb.backend.libusb1.get_backend(find_library=lambda x: "/lib/libusb-1.0.so.0")

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

profile("SimpleSummary")
from Screens import InfoBar
from Screens.SimpleSummary import SimpleSummary

from sys import stdout

profile("Bouquets")
Example #13
0
    "e4hdhybrid", "valalinux", "lunix", "tmnanom3", "purehd", "force2nano",
    "purehdse") or brand in ("linkdroid", "wetek")
SystemInfo["SecondCheckModel"] = model in (
    "osninopro", "osnino", "osninoplus", "dm7020hd", "dm7020hdv2", "9910lx",
    "9911lx", "9920lx", "tmnanose", "tmnanoseplus", "tmnanosem2",
    "tmnanosem2plus", "tmnanosecombo", "force2plus", "force2", "force2se",
    "optimussos", "fusionhd", "fusionhdse", "force2plushv") or brand == "ixuss"
SystemInfo["ThirdCheckModel"] = model in ("gbtrio4k", "gbip4k", "sf8008",
                                          "sf8008m", "ustym4kpro",
                                          "beyonwizv2", "viper4k")
SystemInfo["DifferentLCDSettings"] = model in ("spycat4kmini", "osmega")
SystemInfo["CanBTAudio"] = fileCheck("/proc/stb/audio/btaudio")
SystemInfo["CanBTAudioDelay"] = fileCheck("/proc/stb/audio/btaudio_delay")
SystemInfo["ArchIsARM64"] = brand in ("linkdroid", "mecool") or model in (
    "wetekplay2", "wetekhub", "osmio4k", "osmio4kplus",
    "osmini4k") or getImageArch() == "aarch64"
SystemInfo["ArchIsARM"] = SystemInfo["HiSilicon"] or brand in (
    "rpi", "maxytec", "octagon"
) or model in (
    "cube", "su980", "wetekplay", "x8hp", "odroidc2", "beyonwizu4", "bre2ze4k",
    "hd51", "hd60", "hd61", "h7", "h9", "h9combo", "h10", "i55plus",
    "e4hdultra", "protek4k", "vs1500", "et1x000", "et13000", "vusolo4k",
    "vuuno4k", "vuuno4kse", "vuzero4k", "vuultimo4k", "vuduo4k", "revo4k",
    "tmtwin4k", "galaxy4k", "tm4ksuper", "lunix34k", "force4",
    "lunix4k") or model.startswith("spycat4") or model.startswith(
        "dm9") or model.startswith("force3u") or SystemInfo["GigaBlueAudio"]
SystemInfo["SeekStatePlay"] = False
SystemInfo["StatePlayPause"] = False
SystemInfo["StandbyState"] = False
SystemInfo["LEDButtons"] = model == "vuultimo"
SystemInfo["HasH9SD"] = model in ("h9",
Example #14
0
print 'getMachineUBINIZE=%s<' % boxbranding.getMachineUBINIZE()
print 'getBoxType=%s<' % boxbranding.getBoxType()
print 'getBrandOEM=%s<' % boxbranding.getBrandOEM()
print 'getOEVersion=%s<' % boxbranding.getOEVersion()
print 'getDriverDate=%s<' % boxbranding.getDriverDate()
print 'getImageVersion=%s<' % boxbranding.getImageVersion()
print 'getImageBuild=%s<' % boxbranding.getImageBuild()
print 'getImageDevBuild=%s<' % boxbranding.getImageDevBuild()
print '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()
 def runSetup(self):
     list = []
     
     list.append(getConfigListEntry(_("Remember last watched position"), config.plugins.iptvplayer.remember_last_position))
     if config.plugins.iptvplayer.remember_last_position.value:
         list.append(getConfigListEntry("    " + _("Skip video shorter than [min]"), config.plugins.iptvplayer.remember_last_position_time))
     if getDesktop(0).size().width() >= 800:
         list.append(getConfigListEntry(_("Info bar clock format"), config.plugins.iptvplayer.extplayer_infobanner_clockformat))
     list.append(getConfigListEntry(_("Create LCD/VFD summary screen"), config.plugins.iptvplayer.extplayer_summary))
     list.append(getConfigListEntry(_("----------------- External exteplayer3 options -----------------"), config.plugins.iptvplayer.fakeExtePlayer3))
     list.append(getConfigListEntry("    " + _("RAM buffer size [MB] for network protocols"), config.plugins.iptvplayer.rambuffer_sizemb_network_proto))
     list.append(getConfigListEntry("    " + _("RAM buffer size [MB] for local files"), config.plugins.iptvplayer.rambuffer_sizemb_files))
     list.append(getConfigListEntry("    " + _("Use software decoder for the %s") % 'AAC', config.plugins.iptvplayer.aac_software_decode))
     list.append(getConfigListEntry("    " + _("Use software decoder for the %s") % 'AC3', config.plugins.iptvplayer.ac3_software_decode))
     list.append(getConfigListEntry("    " + _("Use software decoder for the %s") % 'EAC3', config.plugins.iptvplayer.eac3_software_decode))
     list.append(getConfigListEntry("    " + _("Use software decoder for the %s") % 'DTS', config.plugins.iptvplayer.dts_software_decode))
     list.append(getConfigListEntry("    " + _("Use software decoder for the %s") % 'WMA', config.plugins.iptvplayer.wma_software_decode))
     list.append(getConfigListEntry("    " + _("Use software decoder for the %s") % 'MP3', config.plugins.iptvplayer.mp3_software_decode))
     if getImageArch() != "sh4":
         list.append(getConfigListEntry("    " + _("Software decoding as"), config.plugins.iptvplayer.software_decode_as))
     list.append(getConfigListEntry("    " + _("Stereo downmix mode for software decoder"), config.plugins.iptvplayer.stereo_software_decode))
     if self.ac3_mix_avaliable:
         list.append(getConfigListEntry(_("AC3 downmix mode"), config.plugins.iptvplayer.ac3_mix))
     if self.aac_mix_avaliable:
         list.append(getConfigListEntry(_("AAC downmix mode"), config.plugins.iptvplayer.aac_mix))
         
     list.append(getConfigListEntry(_("Info bar timeout"), config.plugins.iptvplayer.extplayer_infobar_timeout))
     
     if self.aspect_avaliable:
         list.append(getConfigListEntry(_("Default video aspect ratio"), config.plugins.iptvplayer.extplayer_aspect) )
     if self.policy_avaliable:
         list.append(getConfigListEntry(_("Default video policy for 16:9"), config.plugins.iptvplayer.extplayer_policy) )
     if self.policy2_avaliable:
         list.append(getConfigListEntry(_("Default video policy for 4:3"), config.plugins.iptvplayer.extplayer_policy2) )
     
     list.append(getConfigListEntry(_("Automatically turn on external subtitles"), config.plugins.iptvplayer.extplayer_subtitle_auto_enable) )
     list.append(getConfigListEntry(_("Subtitle line wrapping"), config.plugins.iptvplayer.extplayer_subtitle_wrapping_enabled) )
     list.append(getConfigListEntry(_("Subtitle font"), config.plugins.iptvplayer.extplayer_subtitle_font) )
     list.append(getConfigListEntry(_("Subtitle font size"), config.plugins.iptvplayer.extplayer_subtitle_font_size) )
     if not config.plugins.iptvplayer.extplayer_subtitle_wrapping_enabled.value:
         list.append(getConfigListEntry(_("Subtitle line height"), config.plugins.iptvplayer.extplayer_subtitle_line_height) )
         list.append(getConfigListEntry(_("Line Spacing"), config.plugins.iptvplayer.extplayer_subtitle_line_spacing) )
     elif 'transparent' != config.plugins.iptvplayer.extplayer_subtitle_background.value:
         list.append(getConfigListEntry(_("Subtitle line height"), config.plugins.iptvplayer.extplayer_subtitle_line_height) )
     
     list.append(getConfigListEntry(_("Subtitle font color"), config.plugins.iptvplayer.extplayer_subtitle_font_color) )
     list.append(getConfigListEntry(_("Subtitle background"), config.plugins.iptvplayer.extplayer_subtitle_background) )
     
     list.append(getConfigListEntry(_("Subtitle box position"), config.plugins.iptvplayer.extplayer_subtitle_pos) )
     if config.plugins.iptvplayer.extplayer_subtitle_wrapping_enabled.value:
         if 'transparent' == config.plugins.iptvplayer.extplayer_subtitle_background.value:
             list.append(getConfigListEntry(_("Subtitle box height"), config.plugins.iptvplayer.extplayer_subtitle_box_height) )
             list.append(getConfigListEntry(_("Subtitle vertical alignment"), config.plugins.iptvplayer.extplayer_subtitle_box_valign) )
     
     if self.subtitle_border_avaliable:
         list.append(getConfigListEntry(_("Subtitle border enabled"), config.plugins.iptvplayer.extplayer_subtitle_border_enabled) )
         if config.plugins.iptvplayer.extplayer_subtitle_border_enabled.value:
             list.append(getConfigListEntry(_("Subtitle border color"), config.plugins.iptvplayer.extplayer_subtitle_border_color) )
             list.append(getConfigListEntry(_("Subtitle border width"), config.plugins.iptvplayer.extplayer_subtitle_border_width) )
             
     list.append(getConfigListEntry(_("Subtitle shadow enabled"), config.plugins.iptvplayer.extplayer_subtitle_shadow_enabled) )
     if config.plugins.iptvplayer.extplayer_subtitle_shadow_enabled.value:
         list.append(getConfigListEntry(_("Subtitle shadow color"), config.plugins.iptvplayer.extplayer_subtitle_shadow_color) )
         list.append(getConfigListEntry(_("Subtitle shadow X offset"), config.plugins.iptvplayer.extplayer_subtitle_shadow_xoffset) )
         list.append(getConfigListEntry(_("Subtitle shadow Y offset"), config.plugins.iptvplayer.extplayer_subtitle_shadow_yoffset) )
     
     list.append(getConfigListEntry(_("Inject black iframe at video playback finish"), config.plugins.iptvplayer.use_clear_iframe))
     list.append(getConfigListEntry(_("Show iframe during audio playback"), config.plugins.iptvplayer.show_iframe))
     if config.plugins.iptvplayer.show_iframe.value:
         list.append(getConfigListEntry("    " + _("Radio iframe file"), config.plugins.iptvplayer.iframe_file))
     if getImageArch() != "sh4" and (config.plugins.iptvplayer.show_iframe.value or config.plugins.iptvplayer.use_clear_iframe.value):
         list.append(getConfigListEntry("    " + _("Black iframe file"), config.plugins.iptvplayer.clear_iframe_file))
     self.list = list
     ConfigBaseWidget.runSetup(self)
Example #16
0
SystemInfo["grautec"] = fileExists("/tmp/usbtft")
SystemInfo["CanAC3plusTranscode"] = fileExists("/proc/stb/audio/ac3plus_choices")
SystemInfo["CanDTSHD"] = fileExists("/proc/stb/audio/dtshd_choices")
SystemInfo["CanWMAPRO"] = fileExists("/proc/stb/audio/wmapro")
SystemInfo["CanDownmixAACPlus"] = fileExists("/proc/stb/audio/aacplus_choices")
SystemInfo["CanAACTranscode"] = fileExists("/proc/stb/audio/aac_transcode_choices")
SystemInfo["GraphicLCD"] = model in ("vuultimo","xpeedlx3","et10000","hd2400","sezammarvel","atemionemesis","mbultra","beyonwizt4","osmio4kplus")
SystemInfo["LCDMiniTV"] = fileExists("/proc/stb/lcd/mode")
SystemInfo["LCDMiniTVPiP"] = SystemInfo["LCDMiniTV"] and model not in ("gb800ueplus","gbquad4k","gbue4k")
SystemInfo["DefaultDisplayBrightness"] = platform == "dm4kgen" and 8 or 5
SystemInfo["ConfigDisplay"] = SystemInfo["FrontpanelDisplay"] and getDisplayType() != "7segment"
SystemInfo["DreamBoxAudio"] = platform == "dm4kgen" or model in ("dm7080","dm800")
SystemInfo["AmlogicFamily"] = fileExists("/proc/device-tree/amlogic-dt-id") or fileExists("/usr/bin/amlhalt") or pathExists("/sys/module/amports")
SystemInfo["VFDDelay"] = model in ("sf4008","beyonwizu4")
SystemInfo["VFDRepeats"] = brand != "ixuss" and getDisplayType() != "7segment"
SystemInfo["FirstCheckModel"] = model in ("tmtwin4k","mbmicrov2","revo4k","force3uhd","mbmicro","e4hd","e4hdhybrid","valalinux","lunix","tmnanom3","purehd","force2nano","purehdse") or brand in ("linkdroid","wetek")
SystemInfo["SecondCheckModel"] = model in ("osninopro","osnino","osninoplus","dm7020hd","dm7020hdv2","9910lx","9911lx","9920lx","tmnanose","tmnanoseplus","tmnanosem2","tmnanosem2plus","tmnanosecombo","force2plus","force2","force2se","optimussos","fusionhd","fusionhdse","force2plushv") or brand == "ixuss"
SystemInfo["DifferentLCDSettings"] = model in ("spycat4kmini","osmega")
SystemInfo["CanBTAudio"] = fileCheck("/proc/stb/audio/btaudio")
SystemInfo["CanBTAudioDelay"] = fileCheck("/proc/stb/audio/btaudio_delay")
SystemInfo["ArchIsARM64"] = getImageArch() == "aarch64" or "64" in getImageArch()
SystemInfo["ArchIsARM"] = getImageArch().startswith("arm") or getImageArch().startswith("cortex")
SystemInfo["SeekStatePlay"] = False
SystemInfo["StatePlayPause"] = False
SystemInfo["StandbyState"] = False
SystemInfo["LEDButtons"] = model == "vuultimo"
SystemInfo["HasH9SD"] = model in ("h9","i55plus") and pathExists("/dev/mmcblk0p1")
SystemInfo["HasSDnomount"] = model in ("h9","h3","i55plus") and (False, "none") or model in ("multibox","h9combo","h3") and (True, "mmcblk0")
SystemInfo["canBackupEMC"] = model in ("hd51","h7") and ("disk.img", "%s" % SystemInfo["MultibootStartupDevice"]) or platform == "edision4k" and ("emmc.img", "%s" % SystemInfo["MultibootStartupDevice"]) or SystemInfo["DefineSat"] and ("usb_update.bin", "none")
SystemInfo["CanSyncMode"] = fileExists("/proc/stb/video/sync_mode_choices")
Example #17
0
	def JobStart(self):
		self.autostartcams = config.softcammanager.softcams_autostart.value
		self.Console = Console()
		if path.exists("/tmp/cam.check.log"):
			if path.getsize("/tmp/cam.check.log") > 40000:
				fh = open("/tmp/cam.check.log", "rb+")
				fh.seek(-40000, 2)
				data = fh.read()
				fh.seek(0)  # rewind
				fh.write(data)
				fh.truncate()
				fh.close()
		if SystemInfo["OScamInstalled"] and not path.exists("/usr/softcams/oscam"):
			self.Console.ePopen('ln -s /usr/bin/*oscam* /usr/softcams/')
		if SystemInfo["NCamInstalled"] and not path.exists("/usr/softcams/ncam"):
		    self.Console.ePopen('ln -s /usr/bin/ncam /usr/softcams/')
		if path.exists("/usr/bin/wicardd") and not path.exists("/usr/softcams/wicardd"):
		    self.Console.ePopen('ln -s /usr/bin/wicardd /usr/softcams/')
		if path.exists("/usr/bin/mgcamd_1.38") and not path.exists("/usr/softcams/mgcamd_1.38") or path.exists("/usr/bin/mgcamd_1.35a") and not path.exists("/usr/softcams/mgcamd_1.35a"):
		    self.Console.ePopen('ln -s /usr/bin/*mgcamd* /usr/softcams/')
		if path.exists("/usr/bin/CCcam") and not path.exists("/usr/softcams/CCcam"):
		    self.Console.ePopen('ln -s /usr/bin/CCcam /usr/softcams/')
		if not path.exists("/usr/bin/CCcam") and path.islink("/usr/softcams/CCcam"):
		    self.Console.ePopen('rm -f /usr/softcams/CCcam ')
		if not path.exists("/usr/bin/mgcamd_1.38") and path.islink("/usr/softcams/mgcamd_1.38"):
		    self.Console.ePopen('rm -f /usr/softcams/mgcamd_1.38 ')
		if not path.exists("/usr/bin/mgcamd_1.35a") and path.islink("/usr/softcams/mgcamd_1.35a"):
		    self.Console.ePopen('rm -f /usr/softcams/mgcamd_1.35a ')
		if not path.exists("/usr/bin/wicardd") and path.islink("/usr/softcams/wicardd"):
		    self.Console.ePopen('rm -f /usr/softcams/wicardd ')
		if not path.exists("/usr/bin/oscam") and path.islink("/usr/softcams/oscam"):
		    self.Console.ePopen('rm -f /usr/softcams/oscam ')
		if not path.exists("/usr/bin/ncam") and path.islink("/usr/softcams/ncam"):
		    self.Console.ePopen('rm -f /usr/softcams/ncam ')
		if not path.exists("/usr/bin/oscam-emu") and path.islink("/usr/softcams/oscam-emu"):
		    self.Console.ePopen('rm -f /usr/softcams/oscam-emu ')

		if path.exists("/etc/CCcam.cfg"):
			f = open("/etc/CCcam.cfg", "r")
			logwarn = ""
			for line in f.readlines():
				if line.find("LOG WARNINGS") != -1:
					parts = line.strip().split()
					logwarn = parts[2]
					if logwarn.find(":") >= 0:
						logwarn = logwarn.replace(":", "")
					if logwarn == "":
						logwarn = parts[3]
				else:
					logwarn = ""
			if path.exists(logwarn):
				if path.getsize(logwarn) > 40000:
					fh = open(logwarn, "rb+")
					fh.seek(-40000, 2)
					data = fh.read()
					fh.seek(0)  # rewind
					fh.write(data)
					fh.truncate()
					fh.close()
			f.close()

		for softcamcheck in self.autostartcams:
			softcamcheck = softcamcheck.replace("/usr/softcams/", "")
			softcamcheck = softcamcheck.replace("\n", "")
			if softcamcheck.endswith(".sh"):
				if path.exists("/tmp/SoftcamsDisableCheck"):
					file = open("/tmp/SoftcamsDisableCheck")
					data = file.read()
					file.close()
				else:
					data = ""
				if data.find(softcamcheck) < 0:
					if path.exists("/tmp/SoftcamsScriptsRunning"):
						file = open("/tmp/SoftcamsScriptsRunning")
						data = file.read()
						file.close()
						if data.find(softcamcheck) < 0:
							fileout = open("/tmp/SoftcamsScriptsRunning", "a")
							line = softcamcheck + "\n"
							fileout.write(line)
							fileout.close()
							print("[SoftcamManager] Starting " + softcamcheck)
							self.Console.ePopen("/usr/softcams/" + softcamcheck + " start")
					else:
						fileout = open("/tmp/SoftcamsScriptsRunning", "w")
						line = softcamcheck + "\n"
						fileout.write(line)
						fileout.close()
						print("[SoftcamManager] Starting " + softcamcheck)
						self.Console.ePopen("/usr/softcams/" + softcamcheck + " start")
			else:
				if path.exists("/tmp/SoftcamsDisableCheck"):
					file = open("/tmp/SoftcamsDisableCheck")
					data = file.read()
					file.close()
				else:
					data = ""
				if data.find(softcamcheck) < 0:
					import process

					p = process.ProcessList()
					softcamcheck_process = str(p.named(softcamcheck)).strip("[]")
					if softcamcheck_process != "":
						if path.exists("/tmp/frozen"):
							remove("/tmp/frozen")
						if path.exists("/tmp/status.html"):
							remove("/tmp/status.html")
						if path.exists("/tmp/index.html"):
							remove("/tmp/index.html")
						print("[SoftcamManager] " + softcamcheck + " already running")
						output = open("/tmp/cam.check.log", "a")
						now = datetime.now()
						output.write(now.strftime("%Y-%m-%d %H:%M") + ": " + softcamcheck + " running OK\n")
						output.close()
						if softcamcheck.lower().startswith("oscam"):
							if path.exists("/tmp/status.html"):
								remove("/tmp/status.html")
							port = ""
							if path.exists('/etc/tuxbox/config/oscam/oscam.conf'):
								oscamconf = '/etc/tuxbox/config/oscam/oscam.conf'
							elif path.exists('/etc/tuxbox/config/ncam/ncam.conf'):
								oscamconf = '/etc/tuxbox/config/ncam/ncam.conf'
							elif path.exists('/etc/tuxbox/config/oscam-emu/oscam.conf'):
								oscamconf = '/etc/tuxbox/config/oscam-emu/oscam.conf'
							elif path.exists('/etc/tuxbox/config/oscam-smod/oscam.conf'):
								oscamconf = '/etc/tuxbox/config/oscam-smod/oscam.conf'
							f = open(oscamconf, 'r')
							for line in f.readlines():
								if line.find("httpport") != -1:
									port = re.sub("\D", "", line)
							f.close()
							print("[SoftcamManager] Checking if " + softcamcheck + " is frozen")
							if port == "":
								port = "16000"
							self.Console.ePopen("wget -T 1 http://127.0.0.1:" + port + "/status.html -O /tmp/status.html &> /tmp/frozen")
							sleep(2)
							f = open("/tmp/frozen")
							frozen = f.read()
							f.close()
							if frozen.find("Unauthorized") != -1 or frozen.find("Authorization Required") != -1 or frozen.find("Forbidden") != -1 or frozen.find("Connection refused") != -1 or frozen.find("100%") != -1 or path.exists("/tmp/status.html"):
								print("[SoftcamManager] " + softcamcheck + " is responding like it should")
								output = open("/tmp/cam.check.log", "a")
								now = datetime.now()
								output.write(now.strftime("%Y-%m-%d %H:%M") + ": " + softcamcheck + " is responding like it should\n")
								output.close()
							else:
								print("[SoftcamManager] " + softcamcheck + " is frozen, Restarting...")
								output = open("/tmp/cam.check.log", "a")
								now = datetime.now()
								output.write(now.strftime("%Y-%m-%d %H:%M") + ": " + softcamcheck + " is frozen, Restarting...\n")
								output.close()
								print("[SoftcamManager] Stopping " + softcamcheck)
								output = open("/tmp/cam.check.log", "a")
								now = datetime.now()
								output.write(now.strftime("%Y-%m-%d %H:%M") + ": AutoStopping: " + softcamcheck + "\n")
								output.close()
								self.Console.ePopen("killall -9 " + softcamcheck)
								sleep(1)
								self.Console.ePopen("ps.procps | grep softcams | grep -v grep | awk 'NR==1' | awk '{print $5}'| awk  -F'[/]' '{print $4}' > /tmp/oscamRuningCheck.tmp")
								sleep(2)
								file = open("/tmp/oscamRuningCheck.tmp")
								cccamcheck_process = file.read()
								file.close()
								cccamcheck_process = cccamcheck_process.replace("\n", "")
								if cccamcheck_process.lower().find("cccam") != -1:
									try:
										print("[SoftcamManager] Stopping ", cccamcheck_process)
										output = open("/tmp/cam.check.log", "a")
										now = datetime.now()
										output.write(now.strftime("%Y-%m-%d %H:%M") + ": AutoStopping: " + cccamcheck_process + "\n")
										output.close()
										self.Console.ePopen("killall -9 /usr/softcams/" + str(cccamcheck_process))
									except:
										pass
								print("[SoftcamManager] Starting " + softcamcheck)
								output = open("/tmp/cam.check.log", "a")
								now = datetime.now()
								output.write(now.strftime("%Y-%m-%d %H:%M") + ": AutoStarting: " + softcamcheck + "\n")
								output.close()
								self.Console.ePopen("ulimit -s 1024;/usr/softcams/" + softcamcheck + " -b")
								sleep(10)

						elif softcamcheck.lower().startswith("cccam"):
							if path.exists("/tmp/index.html"):
								remove("/tmp/index.html")
							allow = "no"
							port = ""
							f = open("/etc/CCcam.cfg", "r")
							for line in f.readlines():
								if line.find("ALLOW WEBINFO") != -1:
									if not line.startswith("#"):
										parts = line.replace("ALLOW WEBINFO", "")
										parts = parts.replace(":", "")
										parts = parts.replace(" ", "")
										parts = parts.strip().split()
										if parts[0].startswith("yes"):
											allow = parts[0]
								if line.find("WEBINFO LISTEN PORT") != -1:
									port = re.sub("\D", "", line)
							f.close()
							if allow.lower().find("yes") != -1:
								print("[SoftcamManager] Checking if " + softcamcheck + " is frozen")
								if port == "":
									port = "16001"
								self.Console.ePopen("wget -T 1 http://127.0.0.1:" + port + " -O /tmp/index.html &> /tmp/frozen")
								sleep(2)
								f = open("/tmp/frozen")
								frozen = f.read()
								f.close()
								if frozen.find("Unauthorized") != -1 or frozen.find("Authorization Required") != -1 or frozen.find("Forbidden") != -1 or frozen.find("Connection refused") != -1 or frozen.find("100%") != -1 or path.exists("/tmp/index.html"):
									print("[SoftcamManager] " + softcamcheck + " is responding like it should")
									output = open("/tmp/cam.check.log", "a")
									now = datetime.now()
									output.write(now.strftime("%Y-%m-%d %H:%M") + ": ' + softcamcheck + ' is responding like it should\n")
									output.close()
								else:
									print("[SoftcamManager] " + softcamcheck + " is frozen, Restarting...")
									output = open("/tmp/cam.check.log", "a")
									now = datetime.now()
									output.write(now.strftime("%Y-%m-%d %H:%M") + ": " + softcamcheck + " is frozen, Restarting...\n")
									output.close()
									print("[SoftcamManager] Stopping " + softcamcheck)
									self.Console.ePopen("killall -9 " + softcamcheck)
									sleep(1)
									print("[SoftcamManager] Starting " + softcamcheck)
									self.Console.ePopen("ulimit -s 1024;/usr/softcams/" + softcamcheck)
							elif allow.lower().find("no") != -1:
								print("[SoftcamManager] Telnet info not allowed, can not check if frozen")
								output = open("/tmp/cam.check.log", "a")
								now = datetime.now()
								output.write(now.strftime("%Y-%m-%d %H:%M") + ":  Webinfo info not allowed, can not check if frozen,\n\tplease enable 'ALLOW WEBINFO: YES'\n")
								output.close()
							else:
								print("[SoftcamManager] Webinfo info not setup, please enable 'ALLOW WEBINFO= YES'")
								output = open("/tmp/cam.check.log", "a")
								now = datetime.now()
								output.write(now.strftime("%Y-%m-%d %H:%M") + ":  Telnet info not setup, can not check if frozen,\n\tplease enable 'ALLOW WEBINFO: YES'\n")
								output.close()

					elif softcamcheck_process == "":
						print("[SoftcamManager] Couldn't find " + softcamcheck + " running, Starting " + softcamcheck)
						output = open("/tmp/cam.check.log", "a")
						now = datetime.now()
						output.write(now.strftime("%Y-%m-%d %H:%M") + ": Couldn't find " + softcamcheck + " running, Starting " + softcamcheck + "\n")
						output.close()
						if softcamcheck.lower().startswith("oscam"):
							self.Console.ePopen("ps.procps | grep softcams | grep -v grep | awk 'NR==1' | awk '{print $5}'| awk  -F'[/]' '{print $4}' > /tmp/softcamRuningCheck.tmp")
							sleep(2)
							file = open("/tmp/softcamRuningCheck.tmp")
							cccamcheck_process = file.read()
							cccamcheck_process = cccamcheck_process.replace("\n", "")
							file.close()
							if cccamcheck_process.find("cccam") >= 0 or cccamcheck_process.find("CCcam") >= 0:
								try:
									print("[SoftcamManager] Stopping ", cccamcheck_process)
									output = open("/tmp/cam.check.log", "a")
									now = datetime.now()
									output.write(now.strftime("%Y-%m-%d %H:%M") + ": AutoStopping: " + cccamcheck_process + "\n")
									output.close()
									self.Console.ePopen("killall -9 /usr/softcams/" + str(cccamcheck_process))
								except:
									pass
							self.Console.ePopen("ulimit -s 1024;/usr/softcams/" + softcamcheck + " -b")
							sleep(10)
							remove("/tmp/softcamRuningCheck.tmp")
						elif softcamcheck.lower().startswith("sbox"):
							self.Console.ePopen("ulimit -s 1024;/usr/softcams/" + softcamcheck)
							sleep(7)
						elif softcamcheck.lower().startswith("gbox"):
							self.Console.ePopen("ulimit -s 1024;/usr/softcams/" + softcamcheck)
							sleep(3)
							self.Console.ePopen("start-stop-daemon --start --quiet --background --exec /usr/bin/gbox")
						elif softcamcheck.lower().startswith('wicardd'):
						    self.Console.ePopen('/usr/softcams/' + softcamcheck + " -c" + " /etc/tuxbox/config/wicardd/wicardd.conf")
						elif getImageArch() == "armv7vehf-neon-vfpv4" and softcamcheck.lower().startswith('mgcamd') or getImageArch() == "cortexa15hf-neon-vfpv4" and softcamcheck.lower().startswith('mgcamd') or getImageArch() == "armv7ahf-neon" and softcamcheck.lower().startswith('mgcamd'):
						    self.Console.ePopen('/usr/bin/env LD_PRELOAD=/usr/local/lib/libcrypto.so.1.0.0 /usr/softcams/' + softcamcheck)
						else:
							self.Console.ePopen("ulimit -s 1024;/usr/softcams/" + softcamcheck)
Example #18
0
    "e4hdhybrid", "valalinux", "lunix", "tmnanom3", "purehd", "force2nano",
    "purehdse") or brand in ("linkdroid", "wetek")
SystemInfo["SecondCheckModel"] = model in (
    "osninopro", "osnino", "osninoplus", "dm7020hd", "dm7020hdv2", "9910lx",
    "9911lx", "9920lx", "tmnanose", "tmnanoseplus", "tmnanosem2",
    "tmnanosem2plus", "tmnanosecombo", "force2plus", "force2", "force2se",
    "optimussos", "fusionhd", "fusionhdse", "force2plushv") or brand == "ixuss"
SystemInfo["ThirdCheckModel"] = model in ("gbtrio4k", "gbip4k", "sf8008",
                                          "sf8008m", "cc1", "ustym4kpro",
                                          "beyonwizv2", "viper4k")
SystemInfo["DifferentLCDSettings"] = model in ("spycat4kmini", "osmega")
SystemInfo["CanBTAudio"] = fileCheck("/proc/stb/audio/btaudio")
SystemInfo["CanBTAudioDelay"] = fileCheck("/proc/stb/audio/btaudio_delay")
SystemInfo["ArchIsARM64"] = brand in ("linkdroid", "mecool") or model in (
    "wetekplay2", "wetekhub", "osmio4k", "osmio4kplus", "osmini4k",
    "dreamone") or getImageArch() == "aarch64"
SystemInfo["ArchIsARM"] = SystemInfo["HiSilicon"] or brand in (
    "rpi", "maxytec", "octagon"
) or model in (
    "cube", "su980", "wetekplay", "x8hp", "odroidc2", "beyonwizu4", "bre2ze4k",
    "hd51", "hd60", "hd61", "h7", "h9", "h9combo", "h10", "i55plus",
    "e4hdultra", "protek4k", "vs1500", "et1x000", "et13000", "vusolo4k",
    "vuuno4k", "vuuno4kse", "vuzero4k", "vuultimo4k", "vuduo4k", "revo4k",
    "tmtwin4k", "galaxy4k", "tm4ksuper", "lunix34k", "force4",
    "lunix4k") or model.startswith("spycat4") or model.startswith(
        "dm9") or model.startswith("force3u") or SystemInfo["GigaBlueAudio"]
SystemInfo["SeekStatePlay"] = False
SystemInfo["StatePlayPause"] = False
SystemInfo["StandbyState"] = False
SystemInfo["LEDButtons"] = model == "vuultimo"
Example #19
0
import boxbranding
print "getMachineBuild=%s<" %boxbranding.getMachineBuild()
print "getMachineMake=%s<" %boxbranding.getMachineMake()
print "getMachineProcModel=%s<" %boxbranding.getMachineProcModel()
print "getMachineBrand=%s<" %boxbranding.getMachineBrand()
print "getMachineName=%s<" %boxbranding.getMachineName()
print "getMachineMtdKernel=%s<" %boxbranding.getMachineMtdKernel()
print "getMachineKernelFile=%s<" %boxbranding.getMachineKernelFile()
print "getMachineMtdRoot=%s<" %boxbranding.getMachineMtdRoot()
print "getMachineRootFile=%s<" %boxbranding.getMachineRootFile()
print "getMachineMKUBIFS=%s<" %boxbranding.getMachineMKUBIFS()
print "getMachineUBINIZE=%s<" %boxbranding.getMachineUBINIZE()
print "getBoxType=%s<" %boxbranding.getBoxType()
print "getBrandOEM=%s<" %boxbranding.getBrandOEM()
print "getOEVersion=%s<" %boxbranding.getOEVersion()
print "getDriverDate=%s<" %boxbranding.getDriverDate()
print "getImageVersion=%s<" %boxbranding.getImageVersion()
print "getImageBuild=%s<" %boxbranding.getImageBuild()
print "getImageDevBuild=%s<" %boxbranding.getImageDevBuild()
print "getImageType=%s<" %boxbranding.getImageType()
print "getImageDistro=%s<" %boxbranding.getImageDistro()
print "getImageFolder=%s<" %boxbranding.getImageFolder()
print "getImageFileSystem=%s<" %boxbranding.getImageFileSystem()
print "getImageArch=%s<" %boxbranding.getImageArch()

Example #20
0
    pass

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

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

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

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

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

from Screens.MessageBox import MessageBox
from Screens.Screen import Screen
from Components.config import config, configfile, ConfigSubsection, getConfigListEntry, ConfigSelectionNumber, ConfigSelection, ConfigSlider, ConfigYesNo, NoSave, ConfigNumber, ConfigText
Example #21
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
            })