def updateInfo(self): #self.DynamicTimer.start(6000) rc = system("df -h > /tmp/syinfo.tmp") self.text = _("BOX\n") f = open("/proc/stb/info/model",'r') self.text += _("Model:\t%s") % str(getMachineBrand()) + " " + str(getMachineName()) + "\n" f.close() #f = open("/proc/stb/info/chipset",'r') #self.text += "Chipset:\t" + about.getChipSetString() + "\n" #f.close() cmd = 'cat /proc/cpuinfo | grep "cpu MHz" -m 1 | awk -F ": " ' + "'{print $2}'" cmd2 = 'cat /proc/cpuinfo | grep "BogoMIPS" -m 1 | awk -F ": " ' + "'{print $2}'" try: res = popen(cmd).read() res2 = popen(cmd2).read() except: res = "" res2 = "" cpuMHz = "" bogoMIPS = "" if getMachineBuild() in ('vusolo4k','vuultimo4k','vuzero4k'): cpuMHz = " \t(1,5 GHz)" elif getMachineBuild() in ('formuler1tc','formuler1','triplex','tiviaraplus'): cpuMHz = " \t(1,3 GHz)" elif getMachineBuild() in ('u51','u5','u53','u52','u5pvr','h9'): cpuMHz = " \t(1,6 GHz)" elif getMachineBuild() in ('vuuno4kse','vuuno4k','gbquad4k','dm900','dm920','gb7252','dags7252','xc7439','8100s'): cpuMHz = " \t(1,7 GHz)" elif getMachineBuild() in ('alien5'): cpuMHz = " \t(2,0 GHz)" elif getMachineBuild() in ('sf5008','et13000','et1x000','hd52','hd51','sf4008','vs1500','h7'): try: import binascii f = open('/sys/firmware/devicetree/base/cpus/cpu@0/clock-frequency', 'rb') clockfrequency = f.read() f.close() cpuMHz = " \t(%s MHz)" % str(round(int(binascii.hexlify(clockfrequency), 16)/1000000,1)) except: cpuMHz = " \t(1,7 GHz)" elif res: cpuMHz = " \t(" + res.replace("\n", "") + " MHz)" if res2: bogoMIPS = "" + res2.replace("\n", "") f = open('/proc/cpuinfo', 'r') self.text += "CPU: \t" + str(about.getCPUString()) + cpuMHz + " " + str(about.getCpuCoresString2()) + "\n" self.text += _("Cores:\t %s") % str(about.getCpuCoresString()) + "\n" self.text += _("Architecture:\t %s") % str(about.getCPUArch()) + "\n" #self.text += _("CPU Load:\t %s") % str(about.getLoadCPUString()) + "\n" self.text += "BogoMIPS: \t" + bogoMIPS + "\n" f.close() #self.text += _("\nMEMORY\n") #self.text += _("Total:\t%s") % str(about.getRAMTotalString()) + " MB\n" #self.text += _("Free:\t%s ") % str(about.getRAMFreeString()) + " MB (" + str(about.getRAMFreePorcString()) + ")\n" #self.text += _("Usage:\t%s") % str(about.getRAMUsedString()) + " MB (" + str(about.getRAMusageString()) + ")\n" #self.text += _("Shared:\t%s") % str(about.getRAMSharingString()) + " MB" + "\n" #self.text += _("Stored:\t%s") % str(about.getRAMStoredString()) + " MB" + "\n" #self.text += _("Cached:\t%s") % str(about.getRAMCachedString()) + " MB" + "\n" #out_lines = file("/proc/meminfo").readlines() #for lidx in range(len(out_lines) - 1): # tstLine = out_lines[lidx].split() # if "Buffers:" in tstLine: # Buffers = out_lines[lidx].split() # self.text += _("Buffers:") + "\t" + Buffers[1] + ' kB'"\n" # if "Cached:" in tstLine: # Cached = out_lines[lidx].split() # self.text += _("Cached:") + "\t" + Cached[1] + ' kB'"\n" #self.text += _("Swap total:\t%s") % str(about.getRAMSwapTotalString()) + " MB\n" #self.text += _("Swap free:\t%s") % str(about.getRAMSwapFreeString()) + " MB\n" #self.text += _("\nSTORAGE\n") #if os.path.exists('/tmp/syinfo.tmp'): # try: # f = open("/tmp/syinfo.tmp",'r') # line = f.readline() # parts = line.split() # self.text += parts[0] + "\t" + parts[1].strip() + " " + parts[2].strip() + " " + parts[3].strip() + " " + parts[4] + "\n" # line = f.readline() # parts = line.split() # self.text += "Flash" + "\t" + parts[1].strip() + " " + parts[2].strip() + " " + parts[3].strip() + " " + parts[4] + "\n" # for line in f.readlines(): # if line.find('/media/') != -1: # line = line.replace('/media/', ' ') # parts = line.split() # if len(parts) == 6: # self.text += parts[5] + "\t" + parts[1].strip() + " " + parts[2].strip() + " " + parts[3].strip() + " " + parts[4] + "\n" # f.close() # os_remove("/tmp/syinfo.tmp") # except: # return self.text += "\nSOFTWARE\n" openLD = "OpenLD " self.text += "Firmware:\t %s" % openLD + str(about.getImageVersion()) + "\n" self.text += _("CodeName:\t %s") % str(getImageCodeName()) + "\n" self.text += "Kernel: \t " + about.getKernelVersionString() + "\n" self.text += _("DVB drivers:\t %s") % MyDateConverter(str(about.getDriverInstalledDate())) + "\n" self.text += _("Last update:\t %s") % MyDateConverter(str(getEnigmaVersionString())) + "\n" self.text += _("Restarts:\t %d ") % config.misc.startCounter.value + "\n" self.text += _("Uptime:\t %s") % str(about.getUptimeString()) + "\n" self.text += _("GStreamer:\t %s") % str(about.getGStreamerVersionString().replace('GStreamer','')) + "\n" if path.exists('/usr/bin/ffmpeg'): try: self.text += _("FFmpeg:\t %s") % str(about.getFFmpegVersionString()) + "\n" except: pass self.text += _("Python:\t %s") % about.getPythonVersionString() + "\n\n" self["lab1"].setText(self.text)
def updateInfo(self): self.DynamicTimer.start(1000) rc = system("df -h > /tmp/syinfo.tmp") if config.osd.language.value == 'es_ES': self.text = "RECEPTOR\n" else: self.text = "BOX\n" f = open("/proc/stb/info/model",'r') if config.osd.language.value == 'es_ES': self.text += "Modelo:\t" + about.getBoxType() + "\n" else: self.text += "Model:\t" + about.getBoxType() + "\n" f.close() #f = open("/proc/stb/info/chipset",'r') #self.text += "Chipset:\t" + about.getChipSetString() + "\n" #f.close() cmd = 'cat /proc/cpuinfo | grep "cpu MHz" -m 1 | awk -F ": " ' + "'{print $2}'" cmd2 = 'cat /proc/cpuinfo | grep "BogoMIPS" -m 1 | awk -F ": " ' + "'{print $2}'" try: res = popen(cmd).read() res2 = popen(cmd2).read() except: res = "" res2 = "" cpuMHz = "" bogoMIPS = "" if res: cpuMHz = " \t(" + res.replace("\n", "") + " MHz)" if res2: bogoMIPS = "" + res2.replace("\n", "") f = open('/proc/cpuinfo', 'r') self.text += "CPU: \t" + about.getCPUString() + cpuMHz + "\n" self.text += _("Cores:\t %s") % str(about.getCpuCoresString()) + "\n" self.text += "BogoMIPS \t" + bogoMIPS + "\n" f.close() if config.osd.language.value == 'es_ES': self.text += "\nMEMORIA\n" else: self.text += "\nMEMORY\n" memTotal = memFree = swapTotal = swapFree = 0 for line in open("/proc/meminfo",'r'): parts = line.split(':') key = parts[0].strip() if key == "MemTotal": memTotal = parts[1].strip() elif key in ("MemFree"): memFree = parts[1].strip() elif key == "SwapTotal": swapTotal = parts[1].strip() elif key == "SwapFree": swapFree = parts[1].strip() if config.osd.language.value == 'es_ES': self.text += "Memoria Total:\t%s\n" % memTotal else: self.text += "Total memory:\t%s\n" % memTotal if config.osd.language.value == 'es_ES': self.text += "Memoria Libre:\t%s \n" % memFree else: self.text += "Free memory:\t%s \n" % memFree if config.osd.language.value == 'es_ES': self.text += "Memoria Usada:\t%s" % str(about.getRAMusageString()) + "\n" else: self.text += "Memory Usage:\t%s" % str(about.getRAMusageString()) + "\n" out_lines = file("/proc/meminfo").readlines() for lidx in range(len(out_lines) - 1): tstLine = out_lines[lidx].split() if "Buffers:" in tstLine: Buffers = out_lines[lidx].split() self.text += _("Buffers:") + "\t" + Buffers[1] + ' kB'"\n" if "Cached:" in tstLine: Cached = out_lines[lidx].split() self.text += _("Cached:") + "\t" + Cached[1] + ' kB'"\n" if config.osd.language.value == 'es_ES': self.text += "Swap total:\t%s \n" % swapTotal else: self.text += "Swap total:\t%s \n" % swapTotal if config.osd.language.value == 'es_ES': self.text += "Swap libre:\t%s \n" % swapFree else: self.text += "Swap free:\t%s \n" % swapFree if config.osd.language.value == 'es_ES': self.text += "\nALMACENAMIENTO\n" else: self.text += "\nSTORAGE\n" f = open("/tmp/syinfo.tmp",'r') line = f.readline() parts = line.split() self.text += parts[0] + "\t" + parts[1].strip() + " " + parts[2].strip() + " " + parts[3].strip() + " " + parts[4] + "\n" line = f.readline() parts = line.split() self.text += "Flash" + "\t" + parts[1].strip() + " " + parts[2].strip() + " " + parts[3].strip() + " " + parts[4] + "\n" for line in f.readlines(): if line.find('/media/') != -1: line = line.replace('/media/', ' ') parts = line.split() if len(parts) == 6: self.text += parts[5] + "\t" + parts[1].strip() + " " + parts[2].strip() + " " + parts[3].strip() + " " + parts[4] + "\n" f.close() os_remove("/tmp/syinfo.tmp") self.text += "\nSOFTWARE\n" openLD = "OpenLD " self.text += "Firmware:\t %s" % openLD + str(about.getImageVersion()) + "\n" self.text += "Kernel: \t " + about.getKernelVersionString() + "\n" self.text += _("DVB drivers:\t %s") % str(about.getDriverInstalledDate()) + "\n" self.text += _("Last update:\t %s") % str(getEnigmaVersionString()) + "\n" self.text += _("GStreamer:\t%s") % str(about.getGStreamerVersionString().replace('GStreamer','')) + "\n" #self.text += _("FFmpeg:\t%s") % str((' 3.1.4')) + "\n" self.text += _("Python:\t %s") % about.getPythonVersionString() + "\n\n" self["lab1"].setText(self.text)
def getAboutText(): AboutText = "" AboutText += _("Model:\t %s %s\n") % (getMachineBrand(), getMachineName()) if path.exists('/proc/stb/info/chipset'): AboutText += _("Chipset:\t %s") % str(about.getChipSetString()) + "\n" bogoMIPS = "" if path.exists('/proc/cpuinfo'): f = open('/proc/cpuinfo', 'r') temp = f.readlines() f.close() try: for lines in temp: lisp = lines.split(': ') if lisp[0].startswith('BogoMIPS'): bogoMIPS = "" + str(int(float(lisp[1].replace('\n','')))) + "" #bogoMIPS = "" + lisp[1].replace('\n','') + "" break except: pass cpuMHz = " - AMLogic AML-8726 MX (1,5 GHz)" gpuMHZ = "Mali MP400 (Dual Core)" openLD = "OpenLD " AboutText += _("CPU:\t %s") % str(about.getCPUString()) + cpuMHz + "\n" AboutText += _("Cores:\t %s") % str(about.getCpuCoresString()) + "\n" AboutText += _("BogoMIPS:\t %s") % bogoMIPS + "\n" AboutText += _("GPU:\t %s") % gpuMHZ + "\n" AboutText += _("Firmware:\t %s") % openLD + str(about.getImageVersion()) + "\n" #AboutText += _("Build:\t %s") % getImageBuild() + "\n" AboutText += _("Kernel:\t %s") % str(about.getKernelVersionString()) + "\n" AboutText += _("DVB drivers:\t %s") % str(about.getDriverInstalledDate()) + "\n" AboutText += _("Last update:\t %s") % str(getEnigmaVersionString()) + "\n" AboutText += _("GStreamer:\t%s") % str(about.getGStreamerVersionString().replace('GStreamer','')) + "\n" AboutText += _("Python:\t %s") % about.getPythonVersionString() + "\n\n" #AboutText += _("CPU Load:\t %s") % str(about.getLoadCPUString()) + "\n" #AboutText += _("Installed:\t ") + about.getFlashDateString() + "\n" #AboutText += _("Restarts:\t %d ") % config.misc.startCounter.value + "\n\n" fp_version = getFPVersion() if fp_version is None: fp_version = "" elif fp_version != 0: fp_version = _("Frontprocessor version: %s") % fp_version AboutText += fp_version + "\n" tempinfo = "" if path.exists('/proc/stb/sensors/temp0/value'): f = open('/proc/stb/sensors/temp0/value', 'r') tempinfo = f.read() f.close() elif path.exists('/proc/stb/fp/temp_sensor'): f = open('/proc/stb/fp/temp_sensor', 'r') tempinfo = f.read() f.close() if tempinfo and int(tempinfo.replace('\n', '')) > 0: mark = str('\xc2\xb0') AboutText += _("System temperature:\t%s") % tempinfo.replace('\n', '').replace(' ','') + mark + "C\n" tempinfo = "" if path.exists('/proc/stb/fp/temp_sensor_avs'): f = open('/proc/stb/fp/temp_sensor_avs', 'r') tempinfo = f.read() f.close() if tempinfo and int(tempinfo.replace('\n', '')) > 0: mark = str('\xc2\xb0') AboutText += _("Processor temperature:\t%s") % tempinfo.replace('\n', '').replace(' ','') + mark + "C\n" AboutLcdText = AboutText.replace('\t', ' ') return AboutText, AboutLcdText
def getAllInfo(): info = {} brand = "unknown" model = "unknown" procmodel = "unknown" orgdream = 0 if tpmloaded: orgdream = tpm_check() # [IQON : brand type read :by babel if fileExists("/etc/.brandtype"): ret_brand = open("/etc/.brandtype").read().strip().lower() brand = ret_brand if fileExists("/proc/stb/info/hwmodel"): f = open("/proc/stb/info/hwmodel",'r') procmodel = f.readline().strip() f.close() if (procmodel.startswith("optimuss") or procmodel.startswith("pingulux")): brand = "Edision" model = procmodel.replace("optimmuss", "Optimuss ").replace("plus", " Plus").replace(" os", " OS") elif (procmodel.startswith("fusion")): brand = "Xsarius" if procmodel == "fusionhd": model = procmodel.replace("fusionhd", "Fusion HD") elif procmodel == "fusionhdse": model = procmodel.replace("fusionhdse", "Fusion HD SE") elif procmodel == "purehd": model = procmodel.replace("purehd", "Pure HD") else: model = procmodel.lower() elif fileExists("/proc/stb/info/azmodel"): brand = "AZBox" f = open("/proc/stb/info/model",'r') # To-Do: Check if "model" is really correct ... procmodel = f.readline().strip() f.close() model = procmodel.lower() elif fileExists("/proc/stb/info/gbmodel"): brand = "GigaBlue" f = open("/proc/stb/info/gbmodel",'r') procmodel = f.readline().strip() f.close() model = procmodel.upper().replace("GBQUAD", "Quad").replace("PLUS", " Plus") elif fileExists("/proc/stb/info/vumodel"): brand = "Vu+" f = open("/proc/stb/info/vumodel",'r') procmodel = f.readline().strip() f.close() model = procmodel.title().replace("olose", "olo SE").replace("olo2se", "olo2 SE").replace("2", "²") elif fileExists("/proc/boxtype"): f = open("/proc/boxtype",'r') procmodel = f.readline().strip().lower() f.close() if procmodel in ("adb2850", "adb2849", "bska", "bsla", "bxzb", "bzzb"): brand = "Advanced Digital Broadcast" if procmodel in ("bska", "bxzb"): model = "ADB 5800S" elif procmodel in ("bsla", "bzzb"): model = "ADB 5800SX" elif procmodel == "adb2849": model = "ADB 2849ST" else: model = "ADB 2850ST" elif procmodel in ("esi88", "uhd88"): brand = "Sagemcom" if procmodel == "uhd88": model = "UHD 88" else: model = "ESI 88" elif fileExists("/proc/stb/info/boxtype"): f = open("/proc/stb/info/boxtype",'r') procmodel = f.readline().strip().lower() f.close() if procmodel.startswith("et"): brand = "Xtrend" model = procmodel.upper() elif procmodel.startswith("xp"): brand = "MaxDigital" model = procmodel elif procmodel.startswith("ixuss"): brand = "Medialink" model = procmodel.replace(" ", "") elif procmodel.startswith("formuler"): brand = "Formuler" model = procmodel.replace("formuler","") elif procmodel.startswith("ini"): if procmodel.endswith("9000ru"): brand = "Sezam" model = "Marvel" elif procmodel.endswith("5000ru"): brand = "Sezam" model = "hdx" elif procmodel.endswith("1000ru"): brand = "Sezam" model = "hde" elif procmodel.endswith("5000sv"): brand = "Miraclebox" model = "mbtwin" elif procmodel.endswith("1000sv"): brand = "Miraclebox" model = "mbmini" elif procmodel.endswith("1000de"): brand = "Golden Interstar" model = "Xpeed LX" elif procmodel.endswith("9000de"): brand = "Golden Interstar" model = "Xpeed LX3" elif procmodel.endswith("1000lx"): brand = "Golden Interstar" model = "Xpeed LX" elif procmodel.endswith("de"): brand = "Golden Interstar" elif procmodel.endswith("1000am"): brand = "Atemio" model = "5x00" else: brand = "Venton" model = "HDx" elif procmodel.startswith("unibox-"): brand = "Venton" model = "HDe" elif procmodel == "hd1100": brand = "Mut@nt" model = "hd1100" elif procmodel == "hd1200": brand = "Mut@nt" model = "hd1200" elif procmodel == "hd2400": brand = "Mut@nt" model = "hd2400" elif procmodel == "arivalink200": brand = "Ferguson" model = "Ariva @Link 200" elif procmodel.startswith("spark"): brand = "Fulan" if procmodel == "spark7162": model = "Spark 7162" else: model = "Spark" elif fileExists("/proc/stb/info/model"): f = open("/proc/stb/info/model",'r') procmodel = f.readline().strip().lower() f.close() if procmodel == "tf7700hdpvr": brand = "Topfield" model = "TF7700 HDPVR" elif procmodel == "dsi87": brand = "Sagemcom" model = "DSI 87" elif procmodel.startswith("spark"): brand = "Fulan" if procmodel == "spark7162": model = "Spark 7162" else: model = "Spark" elif (procmodel.startswith("dm") and not procmodel == "dm8000"): brand = "Dream Multimedia" model = procmodel.replace("dm", "DM", 1) # A "dm8000" is only a Dreambox if it passes the tpm verification: elif procmodel == "dm8000" and orgdream: brand = "Dream Multimedia" model = "DM8000" else: model = procmodel if fileExists("/etc/.box"): distro = "HDMU" f = open("/etc/.box",'r') tempmodel = f.readline().strip().lower() if tempmodel.startswith("ufs") or model.startswith("ufc"): brand = "Kathrein" model = tempmodel.upcase() procmodel = tempmodel elif tempmodel.startswith("spark"): brand = "Fulan" model = tempmodel.title() procmodel = tempmodel elif tempmodel.startswith("xcombo"): brand = "EVO" model = "enfinityX combo plus" procmodel = "vg2000" type = procmodel if type in ("et9000", "et9100", "et9200", "et9500"): type = "et9x00" elif type in ("et5000", "et6000", "et6x00"): type = "et5x00" elif type == "et4000": type = "et4x00" elif type == "xp1000": type = "xp1000" elif type in ("bska", "bxzb"): type = "nbox_white" elif type in ("bsla", "bzzb"): type = "nbox" elif type == "sagemcom88": type = "esi88" elif type in ("tf7700hdpvr", "topf"): type = "topf" info['brand'] = brand info['model'] = model info['procmodel'] = procmodel info['type'] = type remote = "dmm" if procmodel in ("solo", "duo", "uno", "solo2", "solose", "zero", "solo4k"): remote = "vu_normal" elif procmodel == "duo2": remote = "vu_duo2" elif procmodel == "ultimo": remote = "vu_ultimo" elif procmodel == "e3hd": remote = "e3hd" elif procmodel in ("et9x00", "et9000", "et9100", "et9200", "et9500"): remote = "et9x00" elif procmodel in ("et5x00", "et5000", "et6x00", "et6000"): remote = "et5x00" elif procmodel in ("et4x00", "et4000"): remote = "et4x00" elif procmodel == "et6500": remote = "et6500" elif procmodel in ("et8x00", "et8000", "et8500", "et8500s","et1x000", "et10000"): remote = "et8000" elif procmodel in ("et7x00", "et7000", "et7500"): remote = "et7x00" elif procmodel == "gbquad": remote = "gigablue" elif procmodel == "gbquadplus": remote = "gbquadplus" elif procmodel in ("formuler1", "formuler3"): remote = "formuler1" elif procmodel in ("azboxme", "azboxminime", "me", "minime"): remote = "me" elif procmodel in ("optimussos1", "optimussos1plus", "optimussos2", "optimussos2plus"): remote = "optimuss" elif procmodel in ("premium", "premium+"): remote = "premium" elif procmodel in ("elite", "ultra"): remote = "elite" elif procmodel in ("ini-1000", "ini-1000ru"): remote = "ini-1000" elif procmodel in ("ini-1000sv", "ini-5000sv", "ini-9000de"): remote = "miraclebox" elif procmodel == "ini-3000": remote = "ini-3000" elif procmodel in ("ini-7012", "ini-7000", "ini-5000", "ini-5000ru"): remote = "ini-7000" elif procmodel.startswith("spark"): remote = "spark" elif procmodel == "xp1000": remote = "xp1000" elif procmodel.startswith("xpeedlx"): remote = "xpeedlx" elif procmodel in ("adb2850", "adb2849", "bska", "bsla", "bxzb", "bzzb", "esi88", "uhd88", "dsi87", "arivalink200"): remote = "nbox" elif procmodel in ("hd1100", "hd1200"): remote = "hd1x00" elif procmodel == "hd2400": remote = "hd2400" elif procmodel.startswith("ixuss"): remote = procmodel.replace(" ", "") elif procmodel == "vg2000": remote = "xcombo" elif procmodel == "dm8000" and orgdream: remote = "dmm1" elif procmodel in ("dm7080", "dm7020hd", "dm7020hdv2", "dm800sev2", "dm500hdv2", "dm820"): remote = "dmm2" elif ret_brand == "technomate": if procmodel in ("tmnanooe", "tmsingle"): remote = "te_type1" else: if procmodel in ("force1plus", "force2plus", "tmnanose", "tmnanosecombo"): remote = "te_type3" elif procmodel in ("force1", "tmnano2super"): remote = "te_type2" elif procmodel in ("tmnanosem2", "tmnanoseplus", "tmminise"): remote = "te_type4" else: remote = "te_type0" elif ret_brand == "swiss": if procmodel in ("force1plus", "force1"): remote = "sw_type0" elif ret_brand == "edision": if procmodel in ("force1plus"): remote = "ed_type0" elif procmodel in ("optimussos1plus", "optimussos2plus", "optimussos"): remote = "ed_type1" elif ret_brand == "worldvision": if procmodel in ("force1plus", "force1", "force2", "force2solid", "force2se"): remote = "wo_type0" elif ret_brand == "xsarius": if procmodel in ("fusionhd"): remote = "fusionhd" elif procmodel in ("fusionhdse"): remote = "fusionhdse" elif procmodel in ("purehd"): remote = "purehd" else: remote = "iqon" elif ret_brand == "iqon": if procmodel in ("force1plus", "force1"): remote = "wo_type0" else: remote = "iqon" print "[DEBUGGING] : BRAND", ret_brand print "[DEBUGGING] : MODEL", procmodel # print "[DEBUGGING] : ret.remote", ret["remote"] info['remote'] = remote kernel = about.getKernelVersionString()[0] distro = "unknown" imagever = "unknown" imagebuild = "" driverdate = "unknown" # Assume OE 1.6 oever = "OE 1.6" if kernel>2: oever = "OE 2.0" if fileExists("/etc/.box"): distro = "HDMU" oever = "private" elif fileExists("/etc/bhversion"): distro = "Black Hole" f = open("/etc/bhversion",'r') imagever = f.readline().strip() f.close() if kernel>2: oever = "OpenVuplus 2.1" elif fileExists("/etc/vtiversion.info"): distro = "VTi-Team Image" f = open("/etc/vtiversion.info",'r') imagever = f.readline().strip().replace("VTi-Team Image ", "").replace("Release ", "").replace("v.", "") f.close() oever = "OE 1.6" imagelist = imagever.split('.') imagebuild = imagelist.pop() imagever = ".".join(imagelist) if kernel>2: oever = "OpenVuplus 2.1" if ((imagever == "5.1") or (imagever[0] > 5)): oever = "OpenVuplus 2.1" elif fileExists("/var/grun/grcstype"): distro = "Graterlia OS" try: imagever = about.getImageVersionString() except: pass # ToDo: If your distro gets detected as OpenPLi, feel free to add a detection for your distro here ... else: # OE 2.2 uses apt, not opkg if not fileExists("/etc/opkg/all-feed.conf"): oever = "OE 2.2" else: try: f = open("/etc/opkg/all-feed.conf",'r') oeline = f.readline().strip().lower() f.close() distro = oeline.split( )[1].replace("-all","") except: pass if distro == "openpli": imagever = "2.1" # Todo: Detect OpenPLi 3.0 if has_ipv6: # IPv6 support for Python was added in 4.0 imagever = about.getImageVersion() oever = "PLi-OE" imagelist = imagever.split('.') imagebuild = imagelist.pop() imagever = ".".join(imagelist) elif distro == "openrsi": oever = "PLi-OE" else: try: imagever = about.getImageVersionString() except: pass if (distro == "unknown" and brand == "Vu+" and fileExists("/etc/version")): # Since OE-A uses boxbranding and bh or vti can be detected, there isn't much else left for Vu+ boxes distro = "Vu+ original" f = open("/etc/version",'r') imagever = f.readline().strip() f.close() if kernel.major>2: oever = "OpenVuplus 2.1" # reporting the installed dvb-module version is as close as we get without too much hassle driverdate = 'unknown' try: driverdate = os.popen('/usr/bin/opkg -V0 list_installed *dvb-modules*').readline().split( )[2] except: try: driverdate = os.popen('/usr/bin/opkg -V0 list_installed *dvb-proxy*').readline().split( )[2] except: try: driverdate = os.popen('/usr/bin/opkg -V0 list_installed *kernel-core-default-gos*').readline().split( )[2] except: pass info['oever'] = oever info['distro'] = distro info['imagever'] = imagever info['imagebuild'] = imagebuild info['driverdate'] = driverdate return info
def updateInfo(self): self.DynamicTimer.start(1000) rc = system("df -h > /tmp/syinfo.tmp") if config.osd.language.value == 'es_ES': self.text = "RECEPTOR\n" else: self.text = "BOX\n" f = open("/proc/stb/info/model", 'r') if config.osd.language.value == 'es_ES': self.text += "Modelo:\t" + about.getBoxType() + "\n" else: self.text += "Model:\t" + about.getBoxType() + "\n" f.close() #f = open("/proc/stb/info/chipset",'r') #self.text += "Chipset:\t" + about.getChipSetString() + "\n" #f.close() cmd = 'cat /proc/cpuinfo | grep "cpu MHz" -m 1 | awk -F ": " ' + "'{print $2}'" cmd2 = 'cat /proc/cpuinfo | grep "BogoMIPS" -m 1 | awk -F ": " ' + "'{print $2}'" try: res = popen(cmd).read() res2 = popen(cmd2).read() except: res = "" res2 = "" cpuMHz = "" bogoMIPS = "" if res: cpuMHz = " \t(" + res.replace("\n", "") + " MHz)" if res2: bogoMIPS = "" + res2.replace("\n", "") f = open('/proc/cpuinfo', 'r') self.text += "CPU: \t" + about.getCPUString() + cpuMHz + "\n" self.text += _("Cores:\t %s") % str(about.getCpuCoresString()) + "\n" self.text += "BogoMIPS \t" + bogoMIPS + "\n" f.close() if config.osd.language.value == 'es_ES': self.text += "\nMEMORIA\n" else: self.text += "\nMEMORY\n" memTotal = memFree = swapTotal = swapFree = 0 for line in open("/proc/meminfo", 'r'): parts = line.split(':') key = parts[0].strip() if key == "MemTotal": memTotal = parts[1].strip() elif key in ("MemFree"): memFree = parts[1].strip() elif key == "SwapTotal": swapTotal = parts[1].strip() elif key == "SwapFree": swapFree = parts[1].strip() if config.osd.language.value == 'es_ES': self.text += "Memoria Total:\t%s\n" % memTotal else: self.text += "Total memory:\t%s\n" % memTotal if config.osd.language.value == 'es_ES': self.text += "Memoria Libre:\t%s \n" % memFree else: self.text += "Free memory:\t%s \n" % memFree if config.osd.language.value == 'es_ES': self.text += "Memoria Usada:\t%s" % str( about.getRAMusageString()) + "\n" else: self.text += "Memory Usage:\t%s" % str( about.getRAMusageString()) + "\n" out_lines = file("/proc/meminfo").readlines() for lidx in range(len(out_lines) - 1): tstLine = out_lines[lidx].split() if "Buffers:" in tstLine: Buffers = out_lines[lidx].split() self.text += _("Buffers:") + "\t" + Buffers[1] + ' kB' "\n" if "Cached:" in tstLine: Cached = out_lines[lidx].split() self.text += _("Cached:") + "\t" + Cached[1] + ' kB' "\n" if config.osd.language.value == 'es_ES': self.text += "Swap total:\t%s \n" % swapTotal else: self.text += "Swap total:\t%s \n" % swapTotal if config.osd.language.value == 'es_ES': self.text += "Swap libre:\t%s \n" % swapFree else: self.text += "Swap free:\t%s \n" % swapFree if config.osd.language.value == 'es_ES': self.text += "\nALMACENAMIENTO\n" else: self.text += "\nSTORAGE\n" f = open("/tmp/syinfo.tmp", 'r') line = f.readline() parts = line.split() self.text += parts[0] + "\t" + parts[1].strip() + " " + parts[ 2].strip() + " " + parts[3].strip() + " " + parts[4] + "\n" line = f.readline() parts = line.split() self.text += "Flash" + "\t" + parts[1].strip() + " " + parts[2].strip( ) + " " + parts[3].strip() + " " + parts[4] + "\n" for line in f.readlines(): if line.find('/media/') != -1: line = line.replace('/media/', ' ') parts = line.split() if len(parts) == 6: self.text += parts[5] + "\t" + parts[1].strip( ) + " " + parts[2].strip() + " " + parts[3].strip( ) + " " + parts[4] + "\n" f.close() os_remove("/tmp/syinfo.tmp") self.text += "\nSOFTWARE\n" openLD = "OpenLD " self.text += "Firmware:\t %s" % openLD + str( about.getImageVersion()) + "\n" self.text += "Kernel: \t " + about.getKernelVersionString() + "\n" self.text += _("DVB drivers:\t %s") % str( about.getDriverInstalledDate()) + "\n" self.text += _("Last update:\t %s") % str( getEnigmaVersionString()) + "\n" self.text += _("GStreamer:\t%s") % str( about.getGStreamerVersionString().replace('GStreamer', '')) + "\n" #self.text += _("FFmpeg:\t%s") % str((' 3.1.4')) + "\n" self.text += _( "Python:\t %s") % about.getPythonVersionString() + "\n\n" self["lab1"].setText(self.text)
def getAboutText(): AboutText = "" AboutText += _("Model:\t %s %s\n") % (getMachineBrand(), getMachineName()) if path.exists('/proc/stb/info/chipset'): AboutText += _("Chipset:\t %s") % str(about.getChipSetString()) + "\n" bogoMIPS = "" if path.exists('/proc/cpuinfo'): f = open('/proc/cpuinfo', 'r') temp = f.readlines() f.close() try: for lines in temp: lisp = lines.split(': ') if lisp[0].startswith('BogoMIPS'): bogoMIPS = "" + str(int(float(lisp[1].replace('\n', '')))) + "" #bogoMIPS = "" + lisp[1].replace('\n','') + "" break except: pass cpuMHz = " - AMLogic AML-8726 MX (1,5 GHz)" gpuMHZ = "Mali MP400 (Dual Core)" openLD = "OpenLD " AboutText += _("CPU:\t %s") % str(about.getCPUString()) + cpuMHz + "\n" AboutText += _("Cores:\t %s") % str(about.getCpuCoresString()) + "\n" AboutText += _("BogoMIPS:\t %s") % bogoMIPS + "\n" AboutText += _("GPU:\t %s") % gpuMHZ + "\n" AboutText += _("Firmware:\t %s") % openLD + str( about.getImageVersion()) + "\n" #AboutText += _("Build:\t %s") % getImageBuild() + "\n" AboutText += _("Kernel:\t %s") % str(about.getKernelVersionString()) + "\n" AboutText += _("DVB drivers:\t %s") % str( about.getDriverInstalledDate()) + "\n" AboutText += _("Last update:\t %s") % str(getEnigmaVersionString()) + "\n" AboutText += _("GStreamer:\t%s") % str( about.getGStreamerVersionString().replace('GStreamer', '')) + "\n" AboutText += _("Python:\t %s") % about.getPythonVersionString() + "\n\n" #AboutText += _("CPU Load:\t %s") % str(about.getLoadCPUString()) + "\n" #AboutText += _("Installed:\t ") + about.getFlashDateString() + "\n" #AboutText += _("Restarts:\t %d ") % config.misc.startCounter.value + "\n\n" fp_version = getFPVersion() if fp_version is None: fp_version = "" elif fp_version != 0: fp_version = _("Frontprocessor version: %s") % fp_version AboutText += fp_version + "\n" tempinfo = "" if path.exists('/proc/stb/sensors/temp0/value'): f = open('/proc/stb/sensors/temp0/value', 'r') tempinfo = f.read() f.close() elif path.exists('/proc/stb/fp/temp_sensor'): f = open('/proc/stb/fp/temp_sensor', 'r') tempinfo = f.read() f.close() if tempinfo and int(tempinfo.replace('\n', '')) > 0: mark = str('\xc2\xb0') AboutText += _("System temperature:\t%s") % tempinfo.replace( '\n', '').replace(' ', '') + mark + "C\n" tempinfo = "" if path.exists('/proc/stb/fp/temp_sensor_avs'): f = open('/proc/stb/fp/temp_sensor_avs', 'r') tempinfo = f.read() f.close() if tempinfo and int(tempinfo.replace('\n', '')) > 0: mark = str('\xc2\xb0') AboutText += _("Processor temperature:\t%s") % tempinfo.replace( '\n', '').replace(' ', '') + mark + "C\n" AboutLcdText = AboutText.replace('\t', ' ') return AboutText, AboutLcdText