def P_webtv(self, request): if config.OpenWebif.auth_for_streaming.value: session = GetSession() if session.GetAuth(request) is not None: auth = ':'.join(session.GetAuth(request)) + "@" else: auth = '-sid:' + str(session.GetSID(request)) + "@" else: auth = '' vxgenabled = False if fileExists(getPublicPath("/vxg/media_player.pexe")): vxgenabled = True transcoding = getHaveTranscoding() transcoder_port = 0 if transcoding: try: transcoder_port = int( config.plugins.transcodingsetup.port.value) if getBoxType() in ("sezammarvel", "xpeedlx3", "atemionemesis", "mbultra", "beyonwizt4", "hd2400", "et10000", "et13000", "beyonwizu4", "sf5008", "x2plus", "formuler1", "tiviaraplus", "e4hdultra", "protek4k"): transcoder_port = int(config.OpenWebif.streamport.value) except StandardError: transcoder_port = 0 return { "transcoder_port": transcoder_port, "vxgenabled": vxgenabled, "auth": auth }
def P_channels(self, request): stype = "tv" idbouquet = "ALL" if "stype" in request.args.keys(): stype = request.args["stype"][0] if "id" in request.args.keys(): idbouquet = request.args["id"][0] channels = getChannels(idbouquet, stype) channels['transcoding'] = getHaveTranscoding() return channels
def P_channels(self, request): stype = "tv" idbouquet = "ALL" if "stype" in request.args.keys(): stype = request.args["stype"][0] if "id" in request.args.keys(): idbouquet = request.args["id"][0] channels = getChannels(idbouquet, stype) channels['transcoding'] = getHaveTranscoding() channels['type'] = stype channels[ 'showchannelpicon'] = config.OpenWebif.webcache.showchannelpicon.value return channels
def P_event(self, request): event = getEvent(request.args["sref"][0], request.args["idev"][0]) event['event'][ 'recording_margin_before'] = config.recording.margin_before.value event['event'][ 'recording_margin_after'] = config.recording.margin_after.value at = False try: from Plugins.Extensions.AutoTimer.AutoTimer import AutoTimer # noqa: F401 at = True except ImportError: pass event['at'] = at event['transcoding'] = getHaveTranscoding() if config.OpenWebif.webcache.moviedb.value: event['moviedb'] = config.OpenWebif.webcache.moviedb.value else: event['moviedb'] = 'IMDb' return event
def P_moviesearch(self, request): movies = getMovieSearchList(request.args) movies['transcoding'] = getHaveTranscoding() sorttype = config.OpenWebif.webcache.moviesort.value unsort = movies['movies'] if sorttype == 'name': movies['movies'] = sorted(unsort, key=lambda k: k['eventname']) elif sorttype == 'named': movies['movies'] = sorted(unsort, key=lambda k: k['eventname'], reverse=True) elif sorttype == 'date': movies['movies'] = sorted(unsort, key=lambda k: k['recordingtime']) elif sorttype == 'dated': movies['movies'] = sorted(unsort, key=lambda k: k['recordingtime'], reverse=True) movies['sort'] = sorttype return movies
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("getOpenFIXVersion=%s<" %boxbranding.getOpenFIXVersion()) print("getOpenFIXRevision=%s<" %boxbranding.getOpenFIXRevision()) 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()) print("getKernelVersion=%s<" %boxbranding.getKernelVersion()) print("getRCType=%s<" %boxbranding.getRCType()) print("getRCName=%s<" %boxbranding.getRCName()) print("getRCIDNum=%s<" %boxbranding.getRCIDNum())
SystemInfo["VFD_final_scroll_delay"] = model != "et8500" and fileCheck("/proc/stb/lcd/final_scroll_delay") SystemInfo["LcdLiveTV"] = fileCheck("/proc/stb/fb/sd_detach") or fileCheck("/proc/stb/lcd/live_enable") SystemInfo["LcdLiveTVMode"] = fileCheck("/proc/stb/lcd/mode") SystemInfo["LcdLiveDecoder"] = fileCheck("/proc/stb/lcd/live_decoder") SystemInfo["FastChannelChange"] = False SystemInfo["3DMode"] = fileCheck("/proc/stb/fb/3dmode") or fileCheck("/proc/stb/fb/primary/3d") SystemInfo["3DZNorm"] = fileCheck("/proc/stb/fb/znorm") or fileCheck("/proc/stb/fb/primary/zoffset") SystemInfo["Blindscan_t2_available"] = fileCheck("/proc/stb/info/vumodel") and model.startswith("vu") SystemInfo["RcTypeChangable"] = not(model.startswith("et8500") or model.startswith("et7")) and pathExists("/proc/stb/ir/rc/type") SystemInfo["HasFullHDSkinSupport"] = model not in ("et4000", "et5000", "sh1", "hd500c", "hd1100", "xp1000", "lc") SystemInfo["HasBypassEdidChecking"] = fileCheck("/proc/stb/hdmi/bypass_edid_checking") SystemInfo["HasColorspace"] = fileCheck("/proc/stb/video/hdmi_colorspace") SystemInfo["HasColorspaceSimple"] = SystemInfo["HasColorspace"] and model in ("vusolo4k","vuuno4k","vuuno4kse","vuultimo4k","vuduo4k","vuduo4kse") SystemInfo["HasMultichannelPCM"] = fileCheck("/proc/stb/audio/multichannel_pcm") SystemInfo["HasMMC"] = "root" in cmdline and cmdline["root"].startswith("/dev/mmcblk") SystemInfo["HasTranscoding"] = getHaveTranscoding() == "True" or getHaveMultiTranscoding() == "True" or pathExists("/proc/stb/encoder/0") or fileCheck("/dev/bcm_enc0") SystemInfo["HasH265Encoder"] = fileHas("/proc/stb/encoder/0/vcodec_choices","h265") SystemInfo["CanNotDoSimultaneousTranscodeAndPIP"] = model in ("vusolo4k","gbquad4k") SystemInfo["HasColordepth"] = fileCheck("/proc/stb/video/hdmi_colordepth") SystemInfo["HasFrontDisplayPicon"] = model in ("et8500", "vusolo4k", "vuuno4kse", "vuduo4k", "vuduo4kse", "vuultimo4k") SystemInfo["Has24hz"] = fileCheck("/proc/stb/video/videomode_24hz") SystemInfo["HasHDMIpreemphasis"] = fileCheck("/proc/stb/hdmi/preemphasis") SystemInfo["HasColorimetry"] = fileCheck("/proc/stb/video/hdmi_colorimetry") SystemInfo["HasHdrType"] = fileCheck("/proc/stb/video/hdmi_hdrtype") SystemInfo["HasHDMI-CEC"] = getHaveHDMI() == "True" and fileExists(resolveFilename(SCOPE_PLUGINS, "SystemPlugins/HdmiCEC/plugin.pyo")) and (fileExists("/dev/cec0") or fileExists("/dev/hdmi_cec") or fileExists("/dev/misc/hdmi_cec0")) SystemInfo["Has2160p"] = fileHas("/proc/stb/video/videomode_preferred","2160p50") SystemInfo["HasHDMI-CEC"] = getHaveHDMI() == "True" and fileExists(resolveFilename(SCOPE_PLUGINS, "SystemPlugins/HdmiCEC/plugin.pyo")) and (fileExists("/dev/cec0") or fileExists("/dev/hdmi_cec") or fileExists("/dev/misc/hdmi_cec0")) SystemInfo["HasHDMIHDin"] = getHaveHDMIinHD() == "True" SystemInfo["HasHDMIFHDin"] = getHaveHDMIinFHD() == "True" SystemInfo["HasHDMIin"] = SystemInfo["HasHDMIHDin"] or SystemInfo["HasHDMIFHDin"] SystemInfo["HasYPbPr"] = model in ("dm8000", "et5000", "et6000", "et6500", "et9000", "et9200", "et9500", "et10000", "formuler1", "mbtwinplus", "spycat", "vusolo", "vuduo", "vuduo2", "vuultimo")
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
def __init__(self, session): Screen.__init__(self, session) self.setTitle(_("DVB information")) DVBInformationText = _("DVB information") + "\n" DVBInformationText += "\n" DVBInformationText += _("DVB API: ") + about.getDVBAPI() + "\n" if fileExists("/usr/bin/dvb-fe-tool"): import time try: cmd = 'dvb-fe-tool > /tmp/dvbfetool.txt' Console().ePopen(cmd) cmdv = "dvb-fe-tool | grep -o 'DVB API Version [0-9].[0-9]*' | sed 's|[^0-9]*||' > /tmp/dvbapiversion.txt" Console().ePopen(cmdv) time.sleep(0.1) except: pass if fileExists("/tmp/dvbapiversion.txt"): dvbapiversion = open("/tmp/dvbapiversion.txt", "r").read().strip() DVBInformationText += _("DVB API version: ") + dvbapiversion + "\n" DVBInformationText += "\n" if boxbranding.getHaveTranscoding() == "True": DVBInformationText += _("Transcoding: ") + _("Yes") + "\n" else: DVBInformationText += _("Transcoding: ") + _("No") + "\n" if boxbranding.getHaveMultiTranscoding() == "True": DVBInformationText += _("MultiTranscoding: ") + _("Yes") + "\n" else: DVBInformationText += _("MultiTranscoding: ") + _("No") + "\n" DVBInformationText += "\n" if fileExists("/tmp/dvbfetool.txt"): if fileHas("/tmp/dvbfetool.txt","DVBC") or fileHas("/tmp/dvbfetool.txt","DVB-C"): DVBInformationText += _("DVB-C: ") + _("Yes") + "\n" else: DVBInformationText += _("DVB-C: ") + _("No") + "\n" if fileHas("/tmp/dvbfetool.txt","DVBS") or fileHas("/tmp/dvbfetool.txt","DVB-S"): DVBInformationText += _("DVB-S: ") + _("Yes") + "\n" else: DVBInformationText += _("DVB-S: ") + _("No") + "\n" if fileHas("/tmp/dvbfetool.txt","DVBT") or fileHas("/tmp/dvbfetool.txt","DVB-T"): DVBInformationText += _("DVB-T: ") + _("Yes") + "\n" else: DVBInformationText += _("DVB-T: ") + _("No") + "\n" DVBInformationText += "\n" if fileHas("/tmp/dvbfetool.txt","MULTISTREAM"): DVBInformationText += _("Multistream: ") + _("Yes") + "\n" else: DVBInformationText += _("Multistream: ") + _("No") + "\n" DVBInformationText += "\n" if fileHas("/tmp/dvbfetool.txt","ANNEX_A") or fileHas("/tmp/dvbfetool.txt","ANNEX-A"): DVBInformationText += _("ANNEX-A: ") + _("Yes") + "\n" else: DVBInformationText += _("ANNEX-A: ") + _("No") + "\n" if fileHas("/tmp/dvbfetool.txt","ANNEX_B") or fileHas("/tmp/dvbfetool.txt","ANNEX-B"): DVBInformationText += _("ANNEX-B: ") + _("Yes") + "\n" else: DVBInformationText += _("ANNEX-B: ") + _("No") + "\n" if fileHas("/tmp/dvbfetool.txt","ANNEX_C") or fileHas("/tmp/dvbfetool.txt","ANNEX-C"): DVBInformationText += _("ANNEX-C: ") + _("Yes") + "\n" else: DVBInformationText += _("ANNEX-C: ") + _("No") + "\n" self["AboutScrollLabel"] = ScrollLabel(DVBInformationText) 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 })
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 })
def getStatusInfo(self): # Get Current Volume and Mute Status vcontrol = eDVBVolumecontrol.getInstance() statusinfo = { 'volume': vcontrol.getVolume(), 'muted': vcontrol.isMuted(), 'transcoding': boxbranding.getHaveTranscoding(), 'currservice_filename': "", 'currservice_id': -1, } # Get currently running Service event = None serviceref = self.session.nav.getCurrentlyPlayingServiceReference() serviceref_string = None currservice_station = None if serviceref is not None: serviceHandler = eServiceCenter.getInstance() serviceHandlerInfo = serviceHandler.info(serviceref) service = self.session.nav.getCurrentService() serviceinfo = service and service.info() event = serviceinfo and serviceinfo.getEvent(0) serviceref_string = serviceref.toString() currservice_station = serviceHandlerInfo.getName( serviceref).replace('\xc2\x86', '').replace('\xc2\x87', '') else: event = None serviceHandlerInfo = None if event is not None: # (begin, end, name, description, eit) curEvent = parseEvent(event) begin_timestamp = int(curEvent[0]) + (config.recording.margin_before.value * 60) end_timestamp = int(curEvent[1]) - (config.recording.margin_after.value * 60) statusinfo['currservice_name'] = curEvent[2].replace('\xc2\x86', '').replace('\xc2\x87', '') statusinfo['currservice_serviceref'] = serviceref_string statusinfo['currservice_begin'] = time.strftime("%H:%M", (time.localtime(begin_timestamp))) statusinfo['currservice_begin_timestamp'] = begin_timestamp statusinfo['currservice_end'] = time.strftime("%H:%M", (time.localtime(end_timestamp))) statusinfo['currservice_end_timestamp'] = end_timestamp statusinfo['currservice_description'] = curEvent[3] if len(curEvent[3].decode('utf-8')) > 220: statusinfo['currservice_description'] = curEvent[3].decode('utf-8')[0:220].encode('utf-8') + "..." statusinfo['currservice_station'] = currservice_station if statusinfo['currservice_serviceref'].startswith('1:0:0'): statusinfo['currservice_filename'] = '/' + '/'.join(serviceref_string.split("/")[1:]) full_desc = statusinfo['currservice_name'] + '\n' full_desc += statusinfo['currservice_begin'] + " - " + statusinfo['currservice_end'] + '\n\n' full_desc += event.getExtendedDescription().replace('\xc2\x86', '').replace('\xc2\x87', '').replace('\xc2\x8a', '\n') statusinfo['currservice_fulldescription'] = full_desc statusinfo['currservice_id'] = curEvent[4] else: statusinfo['currservice_name'] = "N/A" statusinfo['currservice_begin'] = "" statusinfo['currservice_end'] = "" statusinfo['currservice_description'] = "" statusinfo['currservice_fulldescription'] = "N/A" if serviceref: statusinfo['currservice_serviceref'] = serviceref_string if statusinfo['currservice_serviceref'].startswith('1:0:0') or statusinfo['currservice_serviceref'].startswith('4097:0:0'): this_path = '/' + '/'.join(serviceref_string.split("/")[1:]) if os.path.exists(this_path): statusinfo['currservice_filename'] = this_path if serviceHandlerInfo: statusinfo['currservice_station'] = currservice_station elif serviceref_string.find("http") != -1: statusinfo['currservice_station'] = serviceref_string.replace('%3a', ':')[serviceref_string.find("http"):] else: statusinfo['currservice_station'] = "N/A" # Get Standby State from Screens.Standby import inStandby if inStandby is None: statusinfo['inStandby'] = "false" else: statusinfo['inStandby'] = "true" # Get recording state recs = NavigationInstance.instance.getRecordings() if recs: statusinfo['isRecording'] = "true" statusinfo['Recording_list'] = "\n" for timer in NavigationInstance.instance.RecordTimer.timer_list: if timer.state == TimerEntry.StateRunning: if not timer.justplay: statusinfo['Recording_list'] += timer.service_ref.getServiceName().replace('\xc2\x86', '').replace('\xc2\x87', '') + ": " + timer.name + "\n" if statusinfo['Recording_list'] == "\n": statusinfo['isRecording'] = "false" else: statusinfo['isRecording'] = "false" return statusinfo
SystemInfo["3DMode"] = fileCheck("/proc/stb/fb/3dmode") or fileCheck( "/proc/stb/fb/primary/3d") SystemInfo["3DZNorm"] = fileCheck("/proc/stb/fb/znorm") or fileCheck( "/proc/stb/fb/primary/zoffset") SystemInfo["Blindscan_t2_available"] = brand == "vuplus" SystemInfo["HasFullHDSkinSupport"] = getFHDSkin() == "True" SystemInfo["HasBypassEdidChecking"] = fileCheck( "/proc/stb/hdmi/bypass_edid_checking") SystemInfo["HasColorspace"] = fileCheck("/proc/stb/video/hdmi_colorspace") SystemInfo["HasColorspaceSimple"] = SystemInfo["HasColorspace"] and model in ( "vusolo4k", "vuuno4k", "vuuno4kse", "vuultimo4k", "vuduo4k", "vuduo4kse") SystemInfo["HasMultichannelPCM"] = fileCheck( "/proc/stb/audio/multichannel_pcm") SystemInfo["HasMMC"] = "root" in cmdline and cmdline["root"].startswith( "/dev/mmcblk") SystemInfo["HasTranscoding"] = getHaveTranscoding( ) == "True" or getHaveMultiTranscoding() == "True" or pathExists( "/proc/stb/encoder/0") or fileCheck("/dev/bcm_enc0") SystemInfo["HasH265Encoder"] = fileHas("/proc/stb/encoder/0/vcodec_choices", "h265") SystemInfo["CanNotDoSimultaneousTranscodeAndPIP"] = model in ("vusolo4k", "gbquad4k") SystemInfo["HasColordepth"] = fileCheck("/proc/stb/video/hdmi_colordepth") SystemInfo["HasFrontDisplayPicon"] = model in ("et8500", "vusolo4k", "vuuno4kse", "vuduo4k", "vuduo4kse", "vuultimo4k") SystemInfo["Has24hz"] = fileCheck("/proc/stb/video/videomode_24hz") SystemInfo["HasHDMIpreemphasis"] = fileCheck("/proc/stb/hdmi/preemphasis") SystemInfo["HasColorimetry"] = fileCheck("/proc/stb/video/hdmi_colorimetry") SystemInfo["HasHdrType"] = fileCheck("/proc/stb/video/hdmi_hdrtype") SystemInfo["HasHDMI-CEC"] = getHaveHDMI() == "True" and fileExists( resolveFilename(
def P_channels(self, request): stype = getUrlArg(request, "stype", "tv") idbouquet = getUrlArg(request, "id", "ALL") channels = getChannels(idbouquet, stype) channels['transcoding'] = getHaveTranscoding() return channels
def P_movies(self, request): movies = getMovieList(request.args) movies['transcoding'] = getHaveTranscoding() return movies
def getTranscoding(): if getHaveTranscoding() == "True" or getHaveMultiTranscoding() == "True": return True return False