def doRestorePlugins1(self): print '[RestoreWizard] Stage 3: Check Kernel' if fileExists('/tmp/backupkernelversion') and fileExists('/tmp/backupimageversion'): imageversion = file('/tmp/backupimageversion').read() kernelversion = file('/tmp/backupkernelversion').read() print 'Backup Image:', imageversion print 'Current Image:', about.getVersionString() print 'Backup Kernel:', kernelversion print 'Current Kernel:', about.getKernelVersionString() if kernelversion == about.getKernelVersionString() and imageversion in (about.getVersionString()): print '[RestoreWizard] Stage 3: Kernel and image ver OK' self.doRestorePluginsTest() else: print '[RestoreWizard] Stage 3: Kernel or image ver Differant' if self.didSettingsRestore: self.NextStep = 'reboot' else: self.NextStep = 'noplugins' self.buildListRef.close(True) else: print '[RestoreWizard] Stage 3: No Kernel to check' if self.didSettingsRestore: self.NextStep = 'reboot' else: self.NextStep = 'noplugins' self.buildListRef.close(True)
def Stage3(self): print '[BackupManager] Finding kernel version:' + about.getKernelVersionString() output = open('/tmp/backupkernelversion', 'w') output.write(about.getKernelVersionString()) output.close() print '[BackupManager] Finding image version:' + about.about.getVersionString() output = open('/tmp/backupimageversion', 'w') output.write(about.about.getVersionString()) output.close() self.Stage3Completed = True
def checkkernel(): mycheck = 0 if not fileExists('/media/usb'): os.system('mkdir /media/usb') if os.path.isfile('/proc/stb/info/vumodel') and os.path.isfile('/proc/stb/info/version'): if open('/proc/stb/info/vumodel').read().startswith('uno') or open('/proc/stb/info/vumodel').read().strip() == 'duo' or open('/proc/stb/info/vumodel').read().startswith('solo') or open('/proc/stb/info/vumodel').read().startswith('ultimo') or open('/proc/stb/info/vumodel').read().startswith('solo2') or open('/proc/stb/info/vumodel').read().startswith('duo2'): if about.getKernelVersionString() == '3.13.5' or about.getKernelVersionString() == '3.9.6': mycheck = 1 else: mycheck = 0 return mycheck
def checkkernel(): mycheck = 0 if not fileExists('/media/usb'): os.system('mkdir /media/usb') if os.path.isfile('/proc/stb/info/boxtype') and os.path.isfile('/proc/stb/info/version'): if open('/proc/stb/info/boxtype').read().startswith('et9000') or open('/proc/stb/info/boxtype').read().strip() == 'et9200' or open('/proc/stb/info/boxtype').read().startswith('et9500') or open('/proc/stb/info/boxtype').read().startswith('et6000') or open('/proc/stb/info/boxtype').read().startswith('et6500') or open('/proc/stb/info/boxtype').read().startswith('et5000') or open('/proc/stb/info/boxtype').read().startswith('et5500') or open('/proc/stb/info/boxtype').read().startswith('et4000') or open('/proc/stb/info/boxtype').read().startswith('et4500') or open('/proc/stb/info/vumodel').read().startswith('duo') or open('/proc/stb/info/vumodel').read().startswith('uno') or open('/proc/stb/info/vumodel').read().startswith('solo') or open('/proc/stb/info/vumodel').read().startswith('ultimo') or open('/proc/stb/info/vumodel').read().startswith('duo2') or open('/proc/stb/info/vumodel').read().startswith('solo2'): if (about.getKernelVersionString()=="3.8.7") or (about.getKernelVersionString()=="3.1.1"): mycheck = 1 else: mycheck = 0 return mycheck
def checkkernel(): mycheck = 0 if not fileExists("/media/usb"): os.system("mkdir /media/usb") if (os.path.isfile("/proc/stb/info/boxtype") and os.path.isfile("/proc/stb/info/version")): f = open("/proc/stb/info/boxtype", "r") model = f.read().strip() f.close() if model.startswith("ini-10") or model.startswith("ini-30") or model.startswith("ini-50") or model.startswith("ini-70") or model.startswith("ini-90"): if (about.getKernelVersionString()=="3.6.0") or (about.getKernelVersionString()=="3.3.8"): mycheck = 1 else: mycheck = 0 return mycheck
def __init__(self, session): Screen.__init__(self, session) AboutText = _("Hardware: ") + about.getHardwareTypeString() + "\n" AboutText += _("Image: ") + about.getImageTypeString() + "\n" AboutText += _("Kernel Version: ") + about.getKernelVersionString() + "\n" EnigmaVersion = "Enigma: " + about.getEnigmaVersionString() self["EnigmaVersion"] = StaticText(EnigmaVersion) AboutText += EnigmaVersion + "\n" ImageVersion = _("Last Upgrade: ") + about.getImageVersionString() self["ImageVersion"] = StaticText(ImageVersion) AboutText += ImageVersion + "\n" # [iq AboutText += _("Powered by 4D") + "\n" # iq] self["TunerHeader"] = StaticText(_("Detected NIMs:")) AboutText += "\n" + _("Detected NIMs:") + "\n" nims = nimmanager.nimList() 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: for count in range(len(hddlist)): if hddinfo: hddinfo += "\n" hdd = hddlist[count][1] if int(hdd.free()) > 1024: hddinfo += "%s\n(%s, %d GB %s)" % (hdd.model(), hdd.capacity(), hdd.free()/1024, _("free")) else: hddinfo += "%s\n(%s, %d MB %s)" % (hdd.model(), hdd.capacity(), hdd.free(), _("free")) else: hddinfo = _("none") self["hddA"] = StaticText(hddinfo) AboutText += hddinfo self["AboutScrollLabel"] = ScrollLabel(AboutText) self["actions"] = ActionMap(["SetupActions", "ColorActions", "DirectionActions"], { "cancel": self.close, "ok": self.close, "green": self.showTranslationInfo, "up": self["AboutScrollLabel"].pageUp, "down": self["AboutScrollLabel"].pageDown })
def imageInfo(self): AboutText = _("OpenHDF Full-Image Backupscript\n") AboutText += _("Support at") + " www.hdfreaks.cc\n\n" AboutText += _("[Image Info's]\n") AboutText += _("Model: %s %s\n") % (getMachineBrand(), getMachineName()) AboutText += _("Backup Date: %s\n") % strftime("%Y-%m-%d", localtime(self.START)) if path.exists('/proc/stb/info/chipset'): AboutText += _("Chipset: BCM%s") % about.getChipSetString().lower().replace('\n','').replace('bcm','') + "\n" #AboutText += _("CPU: %s") % about.getCPUString() + "\n" AboutText += _("Cores: %s") % about.getCpuCoresString() + "\n" AboutText += _("Version: %s") % getImageVersion() + "\n" AboutText += _("Build: %s") % getImageBuild() + "\n" AboutText += _("Kernel: %s") % about.getKernelVersionString() + "\n" string = getDriverDate() year = string[0:4] month = string[4:6] day = string[6:8] driversdate = '-'.join((year, month, day)) AboutText += _("Drivers:\t%s") % driversdate + "\n" AboutText += _("Last update:\t%s") % getEnigmaVersionString() + "\n\n" AboutText += _("[Enigma2 Settings]\n") AboutText += commands.getoutput("cat /etc/enigma2/settings") AboutText += _("\n[Installed Plugins]\n") AboutText += commands.getoutput("opkg list_installed | grep enigma2-plugin-") return AboutText
def __init__(self, session, parent): Screen.__init__(self, session, parent=parent) self['selected'] = StaticText('MediaSat:' + getImageVersion()) AboutText = _('Model: %s %s\n') % (getMachineBrand(), getMachineName()) if path.exists('/proc/stb/info/chipset'): chipset = open('/proc/stb/info/chipset', 'r').read() AboutText += _('Chipset: BCM%s') % chipset.replace('\n', '') + '\n' AboutText += _('Version: %s') % getImageVersion() + '\n' AboutText += _('Build: %s') % getImageBuild() + '\n' AboutText += _('Kernel: %s') % about.getKernelVersionString() + '\n' string = getDriverDate() year = string[0:4] month = string[4:6] day = string[6:8] driversdate = '-'.join((year, month, day)) AboutText += _('Drivers: %s') % driversdate + '\n' AboutText += _('Last update: %s') % getEnigmaVersionString() + '\n\n' tempinfo = '' if path.exists('/proc/stb/sensors/temp0/value'): tempinfo = open('/proc/stb/sensors/temp0/value', 'r').read() elif path.exists('/proc/stb/fp/temp_sensor'): tempinfo = open('/proc/stb/fp/temp_sensor', 'r').read() if tempinfo and int(tempinfo.replace('\n', '')) > 0: mark = str('\xc2\xb0') AboutText += _('System temperature: %s') % tempinfo.replace('\n', '') + mark + 'C\n\n' self['AboutText'] = StaticText(AboutText)
def __init__(self, session, parent): Screen.__init__(self, session, parent = parent) if about.getImageTypeString() == 'Release': self["selected"] = StaticText("ViX:" + about.getImageVersionString() + ' (R)') elif about.getImageTypeString() == 'Experimental': self["selected"] = StaticText("ViX:" + about.getImageVersionString() + ' (B)') if getBoxType() == 'vuuno': self["BoxType"] = StaticText(_("Hardware:") + " Vu+ Uno") elif getBoxType() == 'vuultimo': self["BoxType"] = StaticText(_("Hardware:") + " Vu+ Ultimo") elif getBoxType() == 'vusolo': self["BoxType"] = StaticText(_("Hardware:") + " Vu+ Solo") elif getBoxType() == 'vuduo': self["BoxType"] = StaticText(_("Hardware:") + " Vu+ Duo") elif getBoxType() == 'et5x00': self["BoxType"] = StaticText(_("Hardware:") + " Xtrend ET5x00 Series") elif getBoxType() == 'et6x00': self["BoxType"] = StaticText(_("Hardware:") + " Xtrend ET6x00 Series") elif getBoxType() == 'et9x00': self["BoxType"] = StaticText(_("Hardware:") + " Xtrend ET9x00 Series") elif getBoxType() == 'odin': self["BoxType"] = StaticText(_("Hardware:") + " Odin") else: self["BoxType"] = StaticText(_("Hardware:") + " " + getBoxType()) self["KernelVersion"] = StaticText(_("Kernel:") + " " + about.getKernelVersionString()) self["ImageType"] = StaticText(_("Image:") + " " + about.getImageTypeString()) self["ImageVersion"] = StaticText(_("Version:") + " " + about.getImageVersionString() + " " + _("Build:") + " " + about.getBuildVersionString()) self["EnigmaVersion"] = StaticText(_("Last Update:") + " " + about.getLastUpdateString())
def kernelMismatch(): # returns True if a kernal mismatch is found. i.e. STB kernel does not match feeds kernel import zlib import re kernelversion = about.getKernelVersionString().strip() if kernelversion == "unknown": print '[OnlineVersionCheck][kernelMismatch] unable to retrieve kernel version from STB' return False uri = "%s/%s/Packages.gz" % (getFeedsUrl(), getMachineBuild()) try: req = urllib2.Request(uri) d = urllib2.urlopen(req) gz_data = d.read() except: print '[OnlineVersionCheck][kernelMismatch] error fetching %s' % uri return False try: packages = zlib.decompress(gz_data, 16+zlib.MAX_WBITS) except: print '[OnlineVersionCheck][kernelMismatch] failed to decompress gz_data' return False pattern = "kernel-([0-9]+[.][0-9]+[.][0-9]+)" matches = re.findall(pattern, packages) if matches: match = sorted(matches,key=lambda s: list(map(int, s.split('.'))))[-1] if match != kernelversion: print '[OnlineVersionCheck][kernelMismatch] kernel mismatch found. STB kernel=%s, feeds kernel=%s' % (kernelversion, match) return True print '[OnlineVersionCheck][kernelMismatch] no kernel mismatch found' return False
def __init__(self, session, parent): Screen.__init__(self, session, parent=parent) self["selected"] = StaticText("ViX:" + getImageVersion()) AboutText = _("Model: %s %s\n") % (getMachineBrand(), getMachineName()) if path.exists('/proc/stb/info/chipset'): chipset = open('/proc/stb/info/chipset', 'r').read() AboutText += _("Chipset: BCM%s") % chipset.replace('\n', '') + "\n" AboutText += _("Version: %s") % getImageVersion() + "\n" AboutText += _("Build: %s") % getImageBuild() + "\n" AboutText += _("Kernel: %s") % about.getKernelVersionString() + "\n" string = getDriverDate() year = string[0:4] month = string[4:6] day = string[6:8] driversdate = '-'.join((year, month, day)) AboutText += _("Drivers: %s") % driversdate + "\n" AboutText += _("Last update: %s") % getEnigmaVersionString() + "\n\n" tempinfo = "" if path.exists('/proc/stb/sensors/temp0/value'): tempinfo = open('/proc/stb/sensors/temp0/value', 'r').read() elif path.exists('/proc/stb/fp/temp_sensor'): tempinfo = open('/proc/stb/fp/temp_sensor', 'r').read() if tempinfo and int(tempinfo.replace('\n', '')) > 0: mark = str('\xc2\xb0') AboutText += _("System temperature: %s") % tempinfo.replace('\n', '') + mark + "C\n\n" self["AboutText"] = StaticText(AboutText)
def updateInfo(self): rc = system("df -h > /tmp/syinfo.tmp") text = _("BOX\n") + _("Brand:") + "\tGOLDEN MEDIA\n" f = open("/proc/stb/info/boxtype",'r') text += _("Model:\t") + f.readline() f.close() # f = open("/proc/stb/info/chipset",'r') # text += _("Chipset:\t") + f.readline() +"\n" # f.close() text += _("MEMORY\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", "Buffers", "Cached"): memFree += int(parts[1].strip().split(' ',1)[0]) elif key == "SwapTotal": swapTotal = parts[1].strip() elif key == "SwapFree": swapFree = parts[1].strip() text += _("Total memory:") + "\t%s\n" % memTotal text += _("Free memory:") + "\t%s kB\n" % memFree text += _("Swap total:") + "\t%s \n" % swapTotal text += _("Swap free:") + "\t%s \n" % swapFree text += "\n" + _("STORAGE") + "\n" f = open("/tmp/syinfo.tmp",'r') line = f.readline() parts = line.split() text += parts[0] + "\t" + parts[1].strip() + " " + parts[2].strip() + " " + parts[3].strip() + " " + parts[4] + "\n" line = f.readline() parts = line.split() 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: text += parts[5] + "\t" + parts[1].strip() + " " + parts[2].strip() + " " + parts[3].strip() + " " + parts[4] + "\n" f.close() os_remove("/tmp/syinfo.tmp") text += "\n" + _("SOFTWARE") + "\n" # f = open("/etc/bhversion",'r') # text += "Firmware v.:\t" + f.readline() # f.close() text += "Enigma2 v.: \t" + about.getEnigmaVersionString() + "\n" text += "Kernel v.: \t" + about.getKernelVersionString() + "\n" text += "\n" + _("FIRMWARE") + "\n" text += "Image v.: \t" + about.getImageTypeString() + "\n" # text += "OpenGl v.: \t" + _("GLS 2.0 ") + "\n" text += "OE CORE v.: \t" + _("OPENPLI 5.0 ") + "\n" text += "CODER N.: \t" + _("SODO ") + "\n" text += "BETA TESTER N.1: \t" + _("YOUSSEF EL-ARABI ") + "\n" text += "BETA TESTER N.2: \t" + _("POP-AZERTY ") + "\n" self["lab1"].setText(text)
def populate(self): self["lab1"] = StaticText(_("openATV")) self["lab2"] = StaticText(_("By openATV Image Team")) model = None AboutText = "" self["lab3"] = StaticText(_("Support at") + " www.opena.tv") AboutText += _("Model:\t%s %s\n") % (getMachineBrand(), getMachineName()) if path.exists("/proc/stb/info/chipset"): AboutText += _("Chipset:\t%s") % about.getChipSetString() + "\n" AboutText += _("CPU:\t%s") % about.getCPUString() + "\n" AboutText += _("Cores:\t%s") % about.getCpuCoresString() + "\n" AboutText += _("Version:\t%s") % getImageVersion() + "\n" AboutText += _("Build:\t%s") % getImageBuild() + "\n" AboutText += _("Kernel:\t%s") % about.getKernelVersionString() + "\n" string = getDriverDate() year = string[0:4] month = string[4:6] day = string[6:8] driversdate = "-".join((year, month, day)) AboutText += _("Drivers:\t%s") % driversdate + "\n" AboutText += _("Last update:\t%s") % getEnigmaVersionString() + "\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", "") + 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", "") + mark + "C\n" self["AboutScrollLabel"] = ScrollLabel(AboutText)
def __init__(self, session, parent): Screen.__init__(self, session, parent = parent) self["selected"] = StaticText("About") self["BoxType"] = StaticText(_("Hardware: ")) self["KernelVersion"] = StaticText(_("Kernel:") + " " + about.getKernelVersionString()) self["ImageType"] = StaticText(_("Image:") + " " + about.getImageTypeString()) self["ImageVersion"] = StaticText(_("Version:") + " " + about.getImageVersionString()) self["EnigmaVersion"] = StaticText(_("Last Update:"))
def populate(self): self["lab1"] = StaticText(_("Virtuosso Image Xtreme")) self["lab2"] = StaticText(_("By Team ViX")) model = None AboutText = "" self["lab3"] = StaticText(_("Support at") + " www.world-of-satellite.com") AboutText += _("Model:\t%s %s\n") % (getMachineBrand(), getMachineName()) if path.exists('/proc/stb/info/chipset'): AboutText += _("Chipset:\tBCM%s\n") % about.getChipSetString() AboutText += _("CPU:\t%s\n") % about.getCPUString() AboutText += _("CPU speed:\t%s\n") % about.getCPUSpeedString() AboutText += _("Cores:\t%s\n") % about.getCpuCoresString() imageSubBuild = "" if getImageType() != 'release': imageSubBuild = ".%s" % getImageDevBuild() AboutText += _("Build:\t%s.%s%s (%s)\n") % (getImageVersion(), getImageBuild(), imageSubBuild, getImageType().title()) AboutText += _("Skin name:\t%s\n") % config.skin.primary_skin.value[0:-9] string = getDriverDate() year = string[0:4] month = string[4:6] day = string[6:8] driversdate = '-'.join((year, month, day)) AboutText += _("Drivers:\t%s\n") % driversdate AboutText += _("Kernel:\t%s\n") % about.getKernelVersionString() AboutText += _("GStreamer:\t%s\n") % about.getGStreamerVersionString().replace("GStreamer ","") AboutText += _("Python:\t%s\n") % about.getPythonVersionString() AboutText += _("Installed:\t%s\n") % about.getFlashDateString() AboutText += _("Last update:\t%s\n\n") % getEnigmaVersionString() fp_version = getFPVersion() if fp_version is None: fp_version = "" elif fp_version != 0: fp_version = _("Frontprocessor version: %d") % fp_version AboutText += fp_version + "\n" tempinfo = "" if path.exists('/proc/stb/sensors/temp0/value') and getBoxType() not in ('gbquad'): f = open('/proc/stb/sensors/temp0/value', 'r') tempinfo = f.read() f.close() elif path.exists('/proc/stb/fp/temp_sensor') and getBoxType() not in ('gbquad'): 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: %s%sC\n\n") % (tempinfo.replace('\n', ''), mark) self["AboutScrollLabel"] = ScrollLabel(AboutText)
def checkkernel(): mycheck = 0 if not fileExists("/media/usb"): os.system("mkdir /media/usb") if os.path.isfile("/proc/stb/info/vumodel") and os.path.isfile("/proc/stb/info/version"): if ( open("/proc/stb/info/vumodel").read().startswith("uno") or open("/proc/stb/info/vumodel").read().strip() == "duo" or open("/proc/stb/info/vumodel").read().startswith("solo") or open("/proc/stb/info/vumodel").read().startswith("ultimo") or open("/proc/stb/info/vumodel").read().startswith("solo2") or open("/proc/stb/info/vumodel").read().startswith("duo2") ): if about.getKernelVersionString() == "3.13.5" or about.getKernelVersionString() == "3.9.6": mycheck = 1 else: mycheck = 0 return mycheck
def populate(self): self["lab1"] = StaticText(_("Virtuosso Image Xtreme")) self["lab2"] = StaticText(_("By Team ViX")) model = None AboutText = "" self["lab3"] = StaticText(_("Support at") + " www.world-of-satellite.com") if getMachineBrand() == 'Vu+': self["lab3"] = StaticText(_("Support at") + " www.vuplus-support.com") elif getMachineBrand() == 'Xtrend': self["lab3"] = StaticText(_("Support at") + " www.xtrend-support.com") elif getMachineBrand() == 'Odin': self["lab3"] = StaticText(_("Support at") + " www.odin-support.com") AboutText += _("Model:\t%s %s\n") % (getMachineBrand(), getMachineName()) if path.exists('/proc/stb/info/chipset'): AboutText += _("Chipset:\tBCM%s") % about.getChipSetString() + "\n" AboutText += _("CPU:\t%s") % about.getCPUString() + "\n" AboutText += _("Cores:\t%s") % about.getCpuCoresString() + "\n" AboutText += _("Version:\t%s") % getImageVersion() + "\n" AboutText += _("Build:\t%s") % getImageBuild() + "\n" AboutText += _("Kernel:\t%s") % about.getKernelVersionString() + "\n" string = getDriverDate() year = string[0:4] month = string[4:6] day = string[6:8] driversdate = '-'.join((year, month, day)) AboutText += _("Drivers:\t%s") % driversdate + "\n" AboutText += _("Last update:\t%s") % getEnigmaVersionString() + "\n\n" fp_version = getFPVersion() if fp_version is None: fp_version = "" elif fp_version != 0: fp_version = _("Frontprocessor version: %d") % fp_version AboutText += fp_version + "\n" tempinfo = "" if path.exists('/proc/stb/sensors/temp0/value') and getBoxType() not in ('gbquad'): f = open('/proc/stb/sensors/temp0/value', 'r') tempinfo = f.read() f.close() elif path.exists('/proc/stb/fp/temp_sensor') and getBoxType() not in ('gbquad'): 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: %s") % tempinfo.replace('\n', '') + mark + "C\n\n" self["AboutScrollLabel"] = ScrollLabel(AboutText)
def checkkernel(): mycheck = 0 if not fileExists("/media/usb"): os.system("mkdir /media/usb") if (os.path.isfile("/proc/stb/info/boxtype") and os.path.isfile("/proc/stb/info/version")): if open("/proc/stb/info/boxtype").read().strip() == "ini-1000" or open("/proc/stb/info/boxtype").read().strip() == "ini-3000" or open("/proc/stb/info/boxtype").read().startswith("ini-50") or open("/proc/stb/info/boxtype").read().startswith("ini-70"): if (about.getKernelVersionString()=="3.6.0"): mycheck = 1 else: mycheck = 0 return mycheck
def populate(self): self["lab1"] = StaticText(_("ViX4E2PROJECT")) self["lab2"] = StaticText(_("By ViX4 Antony")) model = None AboutText = "" self["lab3"] = StaticText(_("www.ViX4.com")) AboutText += _("Model:\t%s %s\n") % (getMachineBrand(), getMachineName()) if path.exists('/proc/stb/info/chipset'): AboutText += _("Chipset:\t%s\n") % about.getChipSetString() AboutText += _("CPU:\t%s\n") % about.getCPUString() AboutText += _("CPU Speed:\t%s\n") % about.getCPUSpeedString() AboutText += _("Cores/Threads:\t%s\n") % about.getCpuCoresString() AboutText += _("Version:\t%s\n") % getImageVersion() AboutText += _("Build:\t%s\n") % getImageBuild() string = getDriverDate() year = string[0:4] month = string[4:6] day = string[6:8] driversdate = '-'.join((year, month, day)) AboutText += _("Drivers:\t%s\n") % driversdate AboutText += _("Kernel:\t%s\n") % about.getKernelVersionString() AboutText += _("GStreamer:\t%s\n") % about.getGStreamerVersionString().replace("GStreamer ","") AboutText += _("Python:\t%s\n") % about.getPythonVersionString() AboutText += _("Last update:\t%s\n\n") % getEnigmaVersionString() fp_version = getFPVersion() if fp_version is None: fp_version = "" elif fp_version != 0: fp_version = _("Frontprocessor version: %d") % fp_version AboutText += fp_version + "\n" tempinfo = "" if path.exists('/proc/stb/sensors/temp0/value') and getBoxType() not in ('gbquad'): f = open('/proc/stb/sensors/temp0/value', 'r') tempinfo = f.read() f.close() elif path.exists('/proc/stb/fp/temp_sensor') and getBoxType() not in ('gbquad'): 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: %s%sC\n\n") % (tempinfo.replace('\n', ''), mark) self["AboutScrollLabel"] = ScrollLabel(AboutText)
def __init__(self, session): Screen.__init__(self, session) bhVer = "Black Hole" f = open("/etc/bhversion",'r') bhVer = f.readline().strip() f.close() bhRev = "" f = open("/etc/bhrev",'r') bhRev = f.readline().strip() f.close() self["EnigmaVersion"] = StaticText("Firmware: " + bhVer) # self["ImageVersion"] = StaticText("Image: " + about.getImageVersionString()) self["ImageVersion"] = StaticText("Build: " + bhRev) driverdate = self.getDriverInstalledDate() if driverdate == "unknown": driverdate = self.getDriverInstalledDate_proxy() self["DriverVersion"] = StaticText(_("DVB drivers: ") + driverdate) self["KernelVersion"] = StaticText(_("Kernel version: ") + self.getKernelVersionString()) AboutText = _("Kernel version: ") + about.getKernelVersionString() + "\n" self["FPVersion"] = StaticText("Team Homesite: vuplus-community.net") self["CpuInfo"] = StaticText(_("CPU: ") + self.getCPUInfoString()) self["TunerHeader"] = StaticText(_("Detected NIMs:")) nims = nimmanager.nimList() for count in (0, 1, 2, 3): if count < len(nims): self["Tuner" + str(count)] = StaticText(nims[count]) else: self["Tuner" + str(count)] = StaticText("") self["HDDHeader"] = StaticText(_("Detected HDD:")) hddlist = harddiskmanager.HDDList() hdd = hddlist and hddlist[0][1] or None if hdd is not None and hdd.model() != "": self["hddA"] = StaticText(_("%s\n(%s, %d MB free)") % (hdd.model(), hdd.capacity(),hdd.free())) else: self["hddA"] = StaticText(_("none")) self["actions"] = ActionMap(["SetupActions", "ColorActions"], { "cancel": self.close, "ok": self.close, })
def updateInfo(self): rc = system("df -h > /tmp/syinfo.tmp") text = "BOX\n" f = open("/proc/stb/info/model",'r') text += "Model:\t" + f.readline() f.close() # f = open("/proc/stb/info/chipset",'r') # text += "Chipset:\t" + about.getChipSetString() + "\n" # f.close() 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", "Buffers", "Cached"): memFree += int(parts[1].strip().split(' ',1)[0]) elif key == "SwapTotal": swapTotal = parts[1].strip() elif key == "SwapFree": swapFree = parts[1].strip() text += "Total memory:\t%s\n" % memTotal text += "Free memory:\t%s kB\n" % memFree text += "Swap total:\t%s \n" % swapTotal text += "Swap free:\t%s \n" % swapFree text += "\nSTORAGE\n" f = open("/tmp/syinfo.tmp",'r') line = f.readline() parts = line.split() text += parts[0] + "\t" + parts[1].strip() + " " + parts[2].strip() + " " + parts[3].strip() + " " + parts[4] + "\n" line = f.readline() parts = line.split() 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: text += parts[5] + "\t" + parts[1].strip() + " " + parts[2].strip() + " " + parts[3].strip() + " " + parts[4] + "\n" f.close() os_remove("/tmp/syinfo.tmp") text += "\nSOFTWARE\n" f = open("/etc/ldversion",'r') text += "Firmware: \t" + f.readline() + "\n" f.close() text += "Version: \t" + about.getEnigmaVersionString() + "\n" text += "Kernel: \t" + about.getKernelVersionString() + "\n" self["lab1"].setText(text)
def __init__(self, session, parent): Screen.__init__(self, session, parent = parent) self.skinName = "AboutSummaryAAF" if about.getImageTypeString() == 'Release': self["selected"] = StaticText("AAF:" + about.getImageVersionString() + ' (R)') elif about.getImageTypeString() == 'Experimental': self["selected"] = StaticText("AAF:" + about.getImageVersionString() + ' (B)') if getBoxType() == 'vuuno': self["BoxType"] = StaticText(_("Hardware:") + " Vu+ Uno") elif getBoxType() == 'vuultimo': self["BoxType"] = StaticText(_("Hardware:") + " Vu+ Ultimo") elif getBoxType() == 'vusolo': self["BoxType"] = StaticText(_("Hardware:") + " Vu+ Solo") elif getBoxType() == 'vuduo': self["BoxType"] = StaticText(_("Hardware:") + " Vu+ Duo") elif getBoxType() == 'vusolo2': self["BoxType"] = StaticText(_("Hardware:") + " Vu+ Solo 2") elif getBoxType() == 'vuduo2': self["BoxType"] = StaticText(_("Hardware:") + " Vu+ Duo 2") elif getBoxType() == 'et4x00': self["BoxType"] = StaticText(_("Hardware:") + " Xtrend ET4x00 Series") elif getBoxType() == 'et5x00': self["BoxType"] = StaticText(_("Hardware:") + " Xtrend ET5x00 Series") elif getBoxType() == 'et6x00': self["BoxType"] = StaticText(_("Hardware:") + " Xtrend ET6x00 Series") elif getBoxType() == 'et9x00': self["BoxType"] = StaticText(_("Hardware:") + " Xtrend ET9x00 Series") elif getBoxType() == 'odinm9': self["BoxType"] = StaticText(_("Hardware:") + " Odin M9") elif getBoxType() == 'odinm7': self["BoxType"] = StaticText(_("Hardware:") + " Odin M7") elif getBoxType() == 'gb800solo': self["BoxType"] = StaticText(_("Hardware:") + " GigaBlue HD 800SOLO") elif getBoxType() == 'gb800se': self["BoxType"] = StaticText(_("Hardware:") + " GigaBlue HD 800SE") elif getBoxType() == 'gb800ue': self["BoxType"] = StaticText(_("Hardware:") + " GigaBlue HD 800UE") elif getBoxType() == 'gbquad': self["BoxType"] = StaticText(_("Hardware:") + " GigaBlue HD QUAD") elif getBoxType() == 'ventonhdx': self["BoxType"] = StaticText(_("Hardware:") + " Venton Unibox HDx") elif getBoxType() == 'ixussone': self["BoxType"] = StaticText(_("Hardware:") + " Ixuss Onex") elif getBoxType() == 'xp1000': self["BoxType"] = StaticText(_("Hardware:") + " XP1000") else: self["BoxType"] = StaticText(_("Hardware:") + " " + getBoxType()) self["KernelVersion"] = StaticText(_("Kernel:") + " " + about.getKernelVersionString()) self["ImageType"] = StaticText(_("Image:") + " " + about.getImageTypeString()) self["ImageVersion"] = StaticText(_("Version:") + " " + about.getImageVersionString() + " " + _("Build:") + " " + about.getBuildVersionString()) self["EnigmaVersion"] = StaticText(_("Last Update:") + " " + about.getLastUpdateString())
def populate(self): self["lab1"] = StaticText(_("openSWF")) self["lab2"] = StaticText(_("Mod Sodo")) model = None AboutText = "" self["lab3"] = StaticText(_("Support at") + " www.star7arab.com") AboutText += _("Model:\t%s %s\n") % (getMachineBrand(), getMachineName()) if path.exists('/proc/stb/info/chipset'): AboutText += _("Chipset:\tBCM%s") % about.getChipSetString().lower().replace('\n','').replace('bcm','') + "\n" AboutText += _("CPU:\t%s") % about.getCPUString() + "\n" AboutText += _("Cores:\t%s") % about.getCpuCoresString() + "\n" AboutText += _("Version:\t%s") % getImageVersionString() + "\n" AboutText += _("Build:\t%s") % getBuildVersionString() + "\n" AboutText += _("Kernel:\t%s") % about.getKernelVersionString() + "\n" AboutText += _("OpenGL : BroadCom 2.0") + "\n" string = getDriverDateString() year = string[0:4] month = string[4:6] day = string[6:8] driversdate = '-'.join((year, month, day)) AboutText += _("Drivers:\t%s") % driversdate + "\n" AboutText += _("Last update:\t%s") % getEnigmaVersionString() + "\n\n" fp_version = getFPVersion() if fp_version is None: fp_version = "" elif fp_version != 0: fp_version = _("Frontprocessor version: %d") % 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: %s") % tempinfo.replace('\n','') + mark + "C\n\n" self["AboutScrollLabel"] = ScrollLabel(AboutText)
def kernelMismatch(): # returns True if a kernal mismatch is found. i.e. STB kernel does not match feeds kernel import zlib import re kernelversion = about.getKernelVersionString().strip() if kernelversion == "unknown": print '[OnlineVersionCheck][kernelMismatch] unable to retrieve kernel version from STB' return False filename = "/etc/opkg/%s-feed.conf" % getMachineBuild() try: with open(filename, "r") as f: content = f.read() f.close() except: print '[OnlineVersionCheck][kernelMismatch] failed to read %s' % filename return False pos = content.find('http') if pos == -1: print '[OnlineVersionCheck][kernelMismatch] no uri found in %s' % filename return False uri = content[pos:].split()[0].strip() + "/Packages.gz" try: req = urllib2.Request(uri) d = urllib2.urlopen(req) gz_data = d.read() except: print '[OnlineVersionCheck][kernelMismatch] error fetching %s' % uri return False try: packages = zlib.decompress(gz_data, 16+zlib.MAX_WBITS) except: print '[OnlineVersionCheck][kernelMismatch] failed to decompress gz_data' return False pattern = "kernel-([0-9]+[.][0-9]+[.][0-9]+)" matches = re.findall(pattern, packages) for match in matches: if match != kernelversion: print '[kernelMismatch] kernel mismatch found. STB kernel=%s, feeds kernel=%s' % (kernelversion, match) return True print '[OnlineVersionCheck][kernelMismatch] no kernel mismatch found' return False
def populate(self): EGAMIVersion = _('EGAMI %s') % about.getImageVersionString() self['lab1'] = Label(EGAMIVersion) model = None AboutText = '' AboutText += _('Model:\t%s %s\n') % (getMachineBrand(), getMachineName()) if path.exists('/proc/stb/info/chipset'): AboutText += _('Chipset:\tBCM%s\n') % about.getChipSetString() AboutText += _('CPU:\t%s\n') % about.getCPUString() AboutText += _('CPU speed:\t%s\n') % about.getCPUSpeedString() AboutText += _('Cores:\t%s\n') % about.getCpuCoresString() AboutText += _('Version:\t%s') % EGAMIVersion + '\n' AboutText += _('Kernel:\t%s') % about.getKernelVersionString() + '\n' AboutText += _('Oe-Core:\tOe-Alliance 3.4') + '\n' AboutText += _('Moderator:\tRedouane') + '\n' AboutText += _('Image Type:\t%s\n') % getImageType().title() AboutText += _('Skin name:\t%s\n') % config.skin.primary_skin.value[0:-9] string = getDriverDate() year = string[0:4] month = string[4:6] day = string[6:8] driversdate = '-'.join((year, month, day)) AboutText += _('Drivers:\t%s') % driversdate + '\n' fp_version = getFPVersion() if fp_version is None: fp_version = '' elif fp_version != 0: fp_version = _('Front panel:\t%s') % str(fp_version) AboutText += fp_version + '\n' AboutText += _('Python:\t%s\n') % about.getPythonVersionString() AboutText += _('GStreamer:\t%s') % about.getGStreamerVersionString().replace('GStreamer', '') + '\n\n' tempinfo = '' if path.exists('/proc/stb/sensors/temp0/value') and getBoxType() not in 'gbquad': f = open('/proc/stb/sensors/temp0/value', 'r') tempinfo = f.read() f.close() elif path.exists('/proc/stb/fp/temp_sensor') and getBoxType() not in 'gbquad': 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: %s') % tempinfo.replace('\n', '') + mark + 'C\n\n' AboutText += _('Installed:\t%s\n') % about.getFlashDateString() AboutText += _('Last update:\t%s') % getEnigmaVersionString() + '\n\n' AboutText += _('WWW:\t%s') % about.getImageUrlString() self['AboutScrollLabel'] = ScrollLabel(AboutText) return
def getUSBList(self): kernel_ver = about.getKernelVersionString() if kernel_ver >= "3.3.0": cmd = "/usr/bin/usb-devices" else: cmd = "cat /proc/bus/usb/devices" parsed_usb_list = [] usb_devices = os.popen(cmd).read() tmp_device = {} for x in usb_devices.splitlines(): if x is None or len(x) == 0: printDebugModemMgr("TMP DEVICE : [%s]" % (tmp_device)) if len(tmp_device): parsed_usb_list.append(tmp_device) tmp_device = {} continue try: if x[0] in ('P', 'S', 'I', 'T'): tmp = x[2:].strip() printDebugModemMgr("TMP : [%s]" % (tmp)) if tmp.startswith('Bus='): #printDebugModemMgr("TMP SPLIT for BUS : [%s]" % (str(tmp.split()))) for xx in tmp.split(): if xx.startswith('Bus='): tmp_device['Bus'] = xx[4:] break if tmp.startswith('Manufacturer='): tmp_device['Manufacturer'] = tmp[13:] if tmp.startswith('Product='): tmp_device['Product'] = tmp[8:] elif tmp.startswith('SerialNumber='): tmp_device['SerialNumber'] = tmp[13:] elif tmp.startswith('Vendor='): #printDebugModemMgr("TMP SPLIT for BUS : [%s]" % (str(tmp.split()))) for xx in tmp.split(): if xx.startswith('Vendor='): tmp_device['Vendor'] = xx[7:] elif xx.startswith('ProdID='): tmp_device['ProdID'] = xx[7:] #tmp_device['Vendor'] = tmp elif tmp.find('Driver=') > 0: d = tmp[tmp.find('Driver=')+7:] if d != '(none)': tmp_device['Interface'] = d except Exception, errmsg: print errmsg
def populate(self, bootLoaderInfo): self.list = [] self.list.append(self.makeHeadingInfoEntry(_("Model:"), "%s %s" % (getMachineBrand(), getMachineName()))) self.list.append(self.makeEmptyEntry()) if path.exists('/proc/stb/info/chipset'): self.list.append(self.makeInfoEntry(_("Chipset:"), "BCM%s" % about.getChipSetString())) self.list.append(self.makeInfoEntry(_("CPU:"), about.getCPUString())) self.list.append(self.makeInfoEntry(_("CPU Speed:"), about.getCPUSpeedString())) self.list.append(self.makeInfoEntry(_("Cores:"), str(about.getCpuCoresString()))) string = getDriverDate() year = string[0:4] month = string[4:6] day = string[6:8] driversdate = '-'.join((year, month, day)) self.list.append(self.makeInfoEntry(_("Drivers:"), driversdate)) self.list.append(self.makeInfoEntry(_("Image:"), about.getImageVersionString())) self.list.append(self.makeInfoEntry(_("Kernel:"), about.getKernelVersionString())) self.list.append(self.makeInfoEntry(_("Oe-Core:"), about.getEnigmaVersionString())) self.list.append(self.makeInfoEntry(_("Bootloader:"), bootLoaderInfo)) fp_version = getFPVersion() if fp_version is not None: self.list.append(self.makeInfoEntry(_("Front Panel:"), "%d" % fp_version)) self.list.append(self.makeEmptyEntry()) self.list.append(self.makeInfoEntry(_("Last Upgrade:"), about.getLastUpdateString())) self.list.append(self.makeEmptyEntry()) self.list.append(self.makeInfoEntry(_("WWW:"), about.getImageUrlString())) tempinfo = "" if path.exists('/proc/stb/sensors/temp0/value'): tempinfo = file('/proc/stb/sensors/temp0/value').read() elif path.exists('/proc/stb/fp/temp_sensor'): tempinfo = file('/proc/stb/fp/temp_sensor').read() if tempinfo and int(tempinfo.replace('\n', '')) > 0: mark = str('\xc2\xb0') self.list.append(self.makeInfoEntry(_("System temperature:"), tempinfo.replace('\n', '') + mark + "C")) self.list.append(self.makeInfoEntry(_("GStreamer:"), about.getGStreamerVersionString().replace("GStreamer", "").strip())) self.list.append(self.makeInfoEntry(_("Python:"), about.getPythonVersionString())) self["list"].updateList(self.list)
def populate(self): EGAMIVersion = _("EGAMI %s") % about.getImageVersionString() self["lab1"] = Label(EGAMIVersion) model = None AboutText = "" AboutText += _("Model:\t%s %s\n") % (getMachineBrand(), getMachineName()) if path.exists("/proc/stb/info/chipset"): AboutText += _("Chipset:\tBCM%s\n") % about.getChipSetString() AboutText += _("CPU:\t%s\n") % about.getCPUString() AboutText += _("CPU Speed:\t%s\n") % about.getCPUSpeedString() AboutText += _("Cores:\t%s\n") % about.getCpuCoresString() AboutText += _("Version:\t%s") % EGAMIVersion + "\n" AboutText += _("Kernel:\t%s") % about.getKernelVersionString() + "\n" AboutText += _("Oe-Core:\t%s") % about.getEnigmaVersionString() + "\n" AboutText += _("Image Type:\t%s\n") % getImageType().title() AboutText += _("Image Coder:\tSODO\n") string = getDriverDate() year = string[0:4] month = string[4:6] day = string[6:8] driversdate = "-".join((year, month, day)) AboutText += _("Drivers:\t%s") % driversdate + "\n" fp_version = getFPVersion() if fp_version is None: fp_version = "" elif fp_version != 0: fp_version = _("Front panel:\t%s") % str(fp_version) AboutText += fp_version + "\n" AboutText += _("Python:\t%s\n") % about.getPythonVersionString() AboutText += _("GStreamer:\t%s") % about.getGStreamerVersionString().replace("GStreamer", "") + "\n\n" tempinfo = "" if path.exists("/proc/stb/sensors/temp0/value") and getBoxType() not in "gbquad": f = open("/proc/stb/sensors/temp0/value", "r") tempinfo = f.read() f.close() elif path.exists("/proc/stb/fp/temp_sensor") and getBoxType() not in "gbquad": 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: %s") % tempinfo.replace("\n", "") + mark + "C\n\n" AboutText += _("Installed:\t%s\n") % about.getFlashDateString() AboutText += _("Last update:\t%s") % getEnigmaVersionString() + "\n\n" AboutText += _("WWW:\t%s") % about.getImageUrlString() self["AboutScrollLabel"] = ScrollLabel(AboutText)
def downloadBurn(self, val): if not val: config.progress.value = str(-1) self.drawMenu() # self.close() else: if os.path.exists("/tmp/update_files.tar"): from Components.About import about from Screens.Console import Console cmds = [] cmds.append("tar xf /tmp/update_files.tar -C /tmp/") cmds.append("if [ -e /tmp/oe_kernel.bin ]; then flash_eraseall -j /dev/mtd6; nandwrite -p /dev/mtd6 /tmp/oe_kernel.bin; fi") cmds.append("if [ -e /tmp/bcmlinuxdvb.ko ]; then mv /tmp/bcmlinuxdvb.ko %s; fi" % ("/lib/modules/" + about.getKernelVersionString() + "/extra/bcmlinuxdvb.ko")) cmds.append("if [ \"`find /tmp/ -name enigma2*ipk`\" != \"\" ]; then opkg install `ls /tmp/enigma2*ipk`; fi") cmds.append("sync") self.session.openWithCallback(self.reboot, Console, title = _("Update is running..."), cmdlist = cmds, closeOnSuccess = True)
def populate(self): self['lab1'] = StaticText(_('Version:\t%s') % getImageVersion() + _(' %s') % getImageBuild()) self['lab2'] = StaticText(_('By REDOUANE')) model = None AboutText = '' self['lab3'] = StaticText(_('Support at') + ' www.pkteam.pl') AboutText += _('Model:\t%s %s\n') % (getMachineBrand(), getMachineName()) if path.exists('/proc/stb/info/chipset'): AboutText += _('Chipset:\tBCM%s') % about.getChipSetString() + '\n' AboutText += _('CPU:\t%s') % about.getCPUString() + '\n' AboutText += _('Cores:\t%s') % about.getCpuCoresString() + '\n' AboutText += _('Version:\t%s') % getImageVersion() + '\n' AboutText += _('Build:\t%s') % getImageBuild() + '\n' AboutText += _('Kernel:\t%s') % about.getKernelVersionString() + '\n' AboutText += _('OPENGL:\tGLS BroadCom V2.0') + '\n' string = getDriverDate() year = string[0:4] month = string[4:6] day = string[6:8] driversdate = '-'.join((year, month, day)) AboutText += _('Drivers:\t%s') % driversdate + '\n' AboutText += _('Last update:\t%s') % getEnigmaVersionString() + '\n\n' fp_version = getFPVersion() if fp_version is None: fp_version = '' elif fp_version != 0: fp_version = _('Frontprocessor version: %d') % 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: %s') % tempinfo.replace('\n', '') + mark + 'C\n\n' self['AboutScrollLabel'] = ScrollLabel(AboutText)
def __init__(self, session): Screen.__init__(self, session) hddsplit = skin.parameters.get("AboutHddSplit", 0) #AboutHddSplit = 0 #try: # hddsplit = skin.parameters.get("AboutHddSplit",(0))[0] #except: # hddsplit = AboutHddSplit if boxtype == 'gb800solo': BoxName = "GigaBlue HD 800SOLO" elif boxtype == 'gb800se': BoxName = "GigaBlue HD 800SE" elif boxtype == 'gb800ue': BoxName = "GigaBlue HD 800UE" elif boxtype == 'gbquad': BoxName = "GigaBlue Quad" elif boxtype == 'gbquad4k': BoxName = "GigaBlue Quad 4k" elif boxtype == 'gbue4k': BoxName = "GigaBlue UE 4k" elif boxtype == 'gbtrio4k': BoxName = "GigaBlue TRIO 4k" elif boxtype == 'gbquadplus': BoxName = "GigaBlue HD Quadplus" elif boxtype == 'gb800seplus': BoxName = "GigaBlue HD 800SEplus" elif boxtype == 'gb800ueplus': BoxName = "GigaBlue HD 800UEplus" elif boxtype == 'gbipbox': BoxName = "GigaBlue IP Box" elif boxtype == 'gbultra': BoxName = "GigaBlue HD Ultra" elif boxtype == 'gbultraue': BoxName = "GigaBlue HD Ultra UE" elif boxtype == 'gbultraueh': BoxName = "GigaBlue HD Ultra UEh" elif boxtype == 'gbultrase': BoxName = "GigaBlue HD Ultra SE" elif boxtype == 'gbx1': BoxName = "GigaBlue X1" elif boxtype == 'gbx2': BoxName = "GigaBlue X2" elif boxtype == 'gbx3': BoxName = "GigaBlue X3" elif boxtype == 'gbx3h': BoxName = "GigaBlue X3h" elif boxtype == 'spycat': BoxName = "XCORE Spycat" elif boxtype == 'quadbox2400': BoxName = "AX Quadbox HD2400" else: BoxName = about.getHardwareTypeString() self.setTitle(_("About") + " " + BoxName) ImageType = about.getImageTypeString() self["ImageType"] = StaticText(ImageType) Boxserial = popen('cat /proc/stb/info/sn').read().strip() serial = "" if Boxserial != "": serial = ":Serial : " + Boxserial AboutHeader = _("About") + " " + BoxName self["AboutHeader"] = StaticText(AboutHeader) AboutText = BoxName + " - " + ImageType + serial + "\n" #AboutText += _("Hardware: ") + about.getHardwareTypeString() + "\n" #AboutText += _("CPU: ") + about.getCPUInfoString() + "\n" #AboutText += _("Installed: ") + about.getFlashDateString() + "\n" #AboutText += _("Image: ") + about.getImageTypeString() + "\n" CPUinfo = _("CPU: ") + about.getCPUInfoString() self["CPUinfo"] = StaticText(CPUinfo) AboutText += CPUinfo + "\n" CPUspeed = _("Speed: ") + about.getCPUSpeedString() self["CPUspeed"] = StaticText(CPUspeed) #AboutText += "(" + about.getCPUSpeedString() + ")\n" ChipsetInfo = _("Chipset: ") + about.getChipSetString() self["ChipsetInfo"] = StaticText(ChipsetInfo) AboutText += ChipsetInfo + "\n" if boxtype == 'gbquad4k' or boxtype == 'gbue4k': def strip_non_ascii(boltversion): ''' Returns the string without non ASCII characters''' stripped = (c for c in boltversion if 0 < ord(c) < 127) return ''.join(stripped) boltversion = str( popen('cat /sys/firmware/devicetree/base/bolt/tag').read(). strip()) boltversion = strip_non_ascii(boltversion) AboutText += _("Bolt") + ":" + boltversion + "\n" self["BoltVersion"] = StaticText(boltversion) AboutText += _( "Enigma (re)starts: %d\n") % config.misc.startCounter.value 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) AboutText += "\n" KernelVersion = _("Kernel version: ") + about.getKernelVersionString() self["KernelVersion"] = StaticText(KernelVersion) AboutText += KernelVersion + "\n" if getMachineBuild() == 'gb7252': b = popen('cat /proc/stb/info/version').read().strip() driverdate = str(b[0:4] + '-' + b[4:6] + '-' + b[6:8] + ' ' + b[8:10] + ':' + b[10:12] + ':' + b[12:14]) AboutText += _("DVB drivers: ") + driverdate + "\n" else: AboutText += _("DVB drivers: ") + self.realDriverDate() + "\n" #AboutText += _("DVB drivers: ") + about.getDriverInstalledDate() + "\n" ImageVersion = _("Last upgrade: ") + about.getImageVersionString() self["ImageVersion"] = StaticText(ImageVersion) AboutText += ImageVersion + "\n" EnigmaVersion = _( "GUI Build: ") + about.getEnigmaVersionString() + "\n" self["EnigmaVersion"] = StaticText(EnigmaVersion) #AboutText += EnigmaVersion #AboutText += _("Enigma (re)starts: %d\n") % config.misc.startCounter.value FlashDate = _("Flashed: ") + about.getFlashDateString() self["FlashDate"] = StaticText(FlashDate) AboutText += FlashDate + "\n" EnigmaSkin = _('Skin & Resolution: %s (%sx%s)') % ( config.skin.primary_skin.value[0:-9], getDesktop(0).size().width(), getDesktop(0).size().height()) self["EnigmaSkin"] = StaticText(EnigmaSkin) AboutText += EnigmaSkin + "\n" AboutText += _( "Python version: ") + about.getPythonVersionString() + "\n" GStreamerVersion = _("GStreamer: ") + about.getGStreamerVersionString( ).replace("GStreamer", "") self["GStreamerVersion"] = StaticText(GStreamerVersion) AboutText += GStreamerVersion + "\n" twisted = popen('opkg list-installed |grep -i python-twisted-core' ).read().strip().split(' - ')[1] AboutText += "Python-Twisted: " + str(twisted) + "\n" AboutText += "\n" self["TunerHeader"] = StaticText(_("Detected NIMs:")) #AboutText += _("Detected NIMs:") + "\n" nims = nimmanager.nimList() 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" #AboutText += _("Detected HDD:") + "\n" hddlist = harddiskmanager.HDDList() hddinfo = "" if hddlist: formatstring = hddsplit and "%s:%s, %.1f %sB %s" or "%s:(%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 #AboutText += "\n\n" + _("Network Info") #for x in about.GetIPsFromNetworkInterfaces(): # AboutText += "\n" + iNetwork.getFriendlyAdapterDescription(x[0]) + " :" + "/dev/" + 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["key_info"] = StaticText(_("Contact Info")) self["actions"] = ActionMap( ["ColorActions", "SetupActions", "DirectionActions"], { "cancel": self.close, "ok": self.close, "red": self.showCommits, "green": self.showTranslationInfo, "blue": self.showMemoryInfo, "info": self.showContactInfo, "yellow": self.showTroubleshoot, "up": self["AboutScrollLabel"].pageUp, "down": self["AboutScrollLabel"].pageDown })
def getInfo(): # TODO: get webif versione somewhere! info = {} brand = "Dream Multimedia" model = "unknown" chipset = "unknown" if fileExists("/proc/stb/info/boxtype"): brand = "Xtrend" f = open("/proc/stb/info/boxtype", 'r') model = f.readline().strip().lower() if model.startswith("et"): brand = "Xtrend" elif model.startswith("ini"): if model.endswith("sv"): brand = "MiracleBox" elif model.endswith("ru"): brand = "Sezam" else: brand = "Venton" elif model.startswith("xp"): brand = "MaxDigital" f.close() elif fileExists("/proc/stb/info/vumodel"): brand = "VuPlus" f = open("/proc/stb/info/vumodel", 'r') model = f.readline().strip().lower() f.close() elif fileExists("/proc/stb/info/azmodel"): brand = "AZBox" f = open("/proc/stb/info/model", 'r') model = f.readline().strip().lower() f.close() if model == "me": chipset = "SIGMA 8655" elif model == "minime": chipset = "SIGMA 8653" else: chipset = "SIGMA 8634" elif fileExists("/proc/stb/info/model"): brand = "Edision" model = "VIP" chipset = "STb7109" else: f = open("/proc/stb/info/model", 'r') model = f.readline().strip().lower() f.close() info['brand'] = brand info['model'] = model if fileExists("/proc/stb/info/chipset"): f = open("/proc/stb/info/chipset", 'r') chipset = f.readline().strip() f.close() info['chipset'] = chipset memFree = 0 for line in open("/proc/meminfo", 'r'): parts = line.split(':') key = parts[0].strip() if key == "MemTotal": info['mem1'] = parts[1].strip() elif key in ("MemFree", "Buffers", "Cached"): memFree += int(parts[1].strip().split(' ', 1)[0]) info['mem2'] = "%s kB" % memFree try: f = open("/proc/uptime", "rb") uptime = int(float(f.readline().split(' ', 2)[0].strip())) f.close() uptimetext = '' if uptime > 86400: d = uptime / 86400 uptime = uptime % 86400 uptimetext += '%dd ' % d uptimetext += "%d:%.2d" % (uptime / 3600, (uptime % 3600) / 60) except: uptimetext = "?" info['uptime'] = uptimetext if fileExists("/etc/bhversion"): f = open("/etc/bhversion", 'r') imagever = f.readline().strip() f.close() elif fileExists("/etc/vtiversion.info"): f = open("/etc/vtiversion.info", 'r') imagever = f.readline().strip() f.close() else: imagever = about.getImageVersionString() info["webifver"] = getOpenWebifVer() info['imagever'] = imagever info['enigmaver'] = about.getEnigmaVersionString() info['kernelver'] = about.getKernelVersionString() try: from Tools.StbHardware import getFPVersion except ImportError: from Tools.DreamboxHardware import getFPVersion info['fp_version'] = getFPVersion() info['tuners'] = [] for i in range(0, nimmanager.getSlotCount()): info['tuners'].append({ "name": nimmanager.getNim(i).getSlotName(), "type": nimmanager.getNimName(i) + " (" + nimmanager.getNim(i).getFriendlyType() + ")" }) info['ifaces'] = [] ifaces = iNetwork.getConfiguredAdapters() for iface in ifaces: info['ifaces'].append({ "name": iNetwork.getAdapterName(iface), "mac": iNetwork.getAdapterAttribute(iface, "mac"), "dhcp": iNetwork.getAdapterAttribute(iface, "dhcp"), "ip": formatIp(iNetwork.getAdapterAttribute(iface, "ip")), "mask": formatIp(iNetwork.getAdapterAttribute(iface, "netmask")), "gw": formatIp(iNetwork.getAdapterAttribute(iface, "gateway")) }) info['hdd'] = [] for hdd in harddiskmanager.hdd: if hdd.free() <= 1024: free = "%i MB" % (hdd.free()) else: free = float(hdd.free()) / float(1024) free = "%.3f GB" % free info['hdd'].append({ "model": hdd.model(), "capacity": hdd.capacity(), "free": free }) return info
def __init__(self, session): Screen.__init__(self, session) if about.getKernelVersionString() <= '3.8.0': self.modules = [('dvb_usb_as102', 'AS102', 'enigma2-plugin-drivers-dvb-usb-as102', True), ('dvb_usb_af9015', 'AF9015', 'enigma2-plugin-drivers-dvb-usb-af9015', True), ('dvb_usb_af9035', 'A867/AF9035', 'enigma2-plugin-drivers-dvb-usb-af9035', True), ('dvb_usb_dib0700 ', 'DIB0700', 'enigma2-plugin-drivers-dvb-usb-dib0700', True), ('em28xx_dvb', 'EM28xx', 'enigma2-plugin-drivers-dvb-usb-em28xx', True), ('pctv452e', 'PCTV452e', 'enigma2-plugin-drivers-dvb-usb-pctv452e', True), ('dvb_usb_rtl2832', 'RTL2832', 'enigma2-plugin-drivers-dvb-usb-rtl2832', True), ('dvb_usb_it913x', 'IT913x', 'enigma2-plugin-drivers-dvb-usb-it913x', True), ('smsdvb', 'Smsusb', 'enigma2-plugin-drivers-dvb-usb-siano', True), ('dvb_usb_dtt200u', 'Dtt200u', 'enigma2-plugin-drivers-dvb-usb-dtt200u', True), ('dvb_usb_dw2102', 'Dw2102', 'enigma2-plugin-drivers-dvb-usb-dw2102', True), ('dvb_usb_nova_t_usb2', 'Nova-T USB2', 'kernel-module-dvb-usb-nova-t-usb2', True), ('dvb_usb_cinergyT2', 'Cinergy T2', 'kernel-module-dvb-usb-cinergyt2', True), ('dvb_usb_technisat_usb2', 'Techinisat Usb2', 'kernel-module-dvb-usb-technisat-usb2', True), ('dvb_usb_a800', 'A800', 'kernel-module-dvb-usb-a800', True), ('dvb_usb_dibusb_mb', 'Dibusb Mb', 'kernel-module-dvb-usb-dibusb-mb', False), ('dvb_usb_dibusb_mc', 'Dibusb Mc', 'kernel-module-dvb-usb-dibusb-mc', False), ('dvb_usb_umt_010', 'Umt 010', 'kernel-module-dvb-usb-umt-010', True), ('dvb_usb_cxusb', 'Cxusb', 'kernel-module-dvb-usb-cxusb', True), ('dvb_usb_m920x', 'M920x', 'kernel-module-dvb-usb-m920x', True), ('dvb_usb_gl861', 'Gl861', 'kernel-module-dvb-usb-gl861', True), ('dvb_usb_au6610', 'Au6610', 'kernel-module-dvb-usb-au6610', True), ('dvb_usb_digitv', 'Digitv', 'kernel-module-dvb-usb-digitv', True), ('dvb_usb_vp7045', 'Vp7045', 'kernel-module-dvb-usb-vp7045', True), ('dvb_usb_vp702x', 'Vp702x', 'kernel-module-dvb-usb-vp702x', True), ('dvb_usb_gp8psk', 'Gp8psk', 'kernel-module-dvb-usb-gp8psk', True), ('dvb_usb_ttusb2', 'Ttusb2', 'kernel-module-dvb-usb-ttusb2', True), ('dvb_usb_opera', 'Opera', 'kernel-module-dvb-usb-opera', True), ('dvb_usb_af9005', 'AF9005', 'kernel-module-dvb-usb-af9005', True), ('dvb_usb_anysee', 'Anysee', 'kernel-module-dvb-usb-anysee', True), ('dvb_usb_dtv5100', 'Dtv5100', 'kernel-module-dvb-usb-dtv5100', True), ('dvb_usb_ce6230', 'Ce6230', 'kernel-module-dvb-usb-ce6230', True), ('dvb_usb_friio', 'Frioo', 'kernel-module-dvb-usb-friio', True), ('dvb_usb_ec168', 'Ec168', 'kernel-module-dvb-usb-ec168', True), ('dvb_usb_az6027', 'Az6027', 'kernel-module-dvb-usb-az6027', True), ('dvb_usb_mxl111sf', 'Mxl111sf', 'kernel-module-dvb-usb-mxl111sf', True)] else: self.modules = [('dvb_usb_a867', 'A867', 'enigma2-plugin-drivers-dvb-usb-a867', True), ('dvb_usb_as102', 'AS102', 'enigma2-plugin-drivers-dvb-usb-as102', True), ('dvb_usb_af9015', 'AF9015', 'enigma2-plugin-drivers-dvb-usb-af9015', True), ('dvb_usb_af9035', 'AF9035', 'enigma2-plugin-drivers-dvb-usb-af9035', True), ('dvb_usb_dib0700 ', 'Dib0700', 'enigma2-plugin-drivers-dvb-usb-dib0700', True), ('em28xx_dvb', 'Em28xx', 'enigma2-plugin-drivers-dvb-usb-em28xx', True), ('pctv452e', 'Pctv452e', 'enigma2-plugin-drivers-dvb-usb-pctv452e', True), ('dvb_usb_rtl2832', 'Rtl2832', 'kernel-module-dvb-usb-rtl2832', True), ('dvb_usb_it913x', 'It913x', 'enigma2-plugin-drivers-dvb-usb-it913x', True), ('smsdvb', 'Smsusb', 'enigma2-plugin-drivers-dvb-usb-siano', True), ('dvb_usb_dtt200u', 'Dtt200u', 'enigma2-plugin-drivers-dvb-usb-dtt200u', True), ('dvb_usb_dw2102', 'Dw2102', 'enigma2-plugin-drivers-dvb-usb-dw2102', True), ('dvb_usb_nova_t_usb2', 'Nova-T USB2', 'kernel-module-dvb-usb-nova-t-usb2', True), ('dvb_usb_cinergyT2', 'Cinergy T2', 'kernel-module-dvb-usb-cinergyt2', True), ('dvb_usb_technisat_usb2', 'Techinisat Usb2', 'kernel-module-dvb-usb-technisat-usb2', True), ('dvb_usb_a800', 'A800', 'kernel-module-dvb-usb-a800', True), ('dvb_usb_dibusb_mb', 'Dibusb Mb', 'kernel-module-dvb-usb-dibusb-mb', False), ('dvb_usb_dibusb_mc', 'Dibusb Mc', 'kernel-module-dvb-usb-dibusb-mc', False), ('dvb_usb_umt_010', 'Umt 010', 'kernel-module-dvb-usb-umt-010', True), ('dvb_usb_cxusb', 'Cxusb', 'kernel-module-dvb-usb-cxusb', True), ('dvb_usb_m920x', 'M920x', 'kernel-module-dvb-usb-m920x', True), ('dvb_usb_gl861', 'Gl861', 'kernel-module-dvb-usb-gl861', True), ('dvb_usb_au6610', 'Au6610', 'kernel-module-dvb-usb-au6610', True), ('dvb_usb_digitv', 'Digitv', 'kernel-module-dvb-usb-digitv', True), ('dvb_usb_vp7045', 'Vp7045', 'kernel-module-dvb-usb-vp7045', True), ('dvb_usb_vp702x', 'Vp702x', 'kernel-module-dvb-usb-vp702x', True), ('dvb_usb_gp8psk', 'Gp8psk', 'kernel-module-dvb-usb-gp8psk', True), ('dvb_usb_ttusb2', 'Ttusb2', 'kernel-module-dvb-usb-ttusb2', True), ('dvb_usb_opera', 'Opera', 'kernel-module-dvb-usb-opera', True), ('dvb_usb_af9005', 'AF9005', 'kernel-module-dvb-usb-af9005', True), ('dvb_usb_anysee', 'Anysee', 'kernel-module-dvb-usb-anysee', True), ('dvb_usb_dtv5100', 'Dtv5100', 'kernel-module-dvb-usb-dtv5100', True), ('dvb_usb_ce6230', 'Ce6230', 'kernel-module-dvb-usb-ce6230', True), ('dvb_usb_friio', 'Frioo', 'kernel-module-dvb-usb-friio', True), ('dvb_usb_ec168', 'Ec168', 'kernel-module-dvb-usb-ec168', True), ('dvb_usb_az6027', 'Az6027', 'kernel-module-dvb-usb-az6027', True), ('dvb_usb_mxl111sf', 'Mxl111sf', 'kernel-module-dvb-usb-mxl111sf', True)] self.modstatus = {} self.list = [] self['key_red'] = Label(_('Remove')) self['key_green'] = Label(_('Restart E2')) self['key_yellow'] = Label(_('Remove all driver')) self['key_blue'] = Label(_('Install all driver')) self['list'] = List(self.list) self['actions'] = ActionMap( ['WizardActions', 'ColorActions'], { 'ok': self.KeyOk, 'red': self.UninstallCheck, 'green': self.runFinishedRe2, 'yellow': self.removeAllQuestion, 'blue': self.installAllQuestion, 'back': self.close }) self.onShown.append(self.setWindowTitle) self.onLayoutFinish.append(self.updateList) self.Console = Console()
def __init__(self, session): Screen.__init__(self, session) AboutText = _("Model:%s %s\n") % (getMachineBrand(), getMachineName()) AboutText = _("Hardware: ") + about.getHardwareTypeString() + "\n" AboutText += _("CPU: ") + about.getCPUInfoString() + "\n" AboutText += _("Image: ") + about.getImageTypeString() + "\n" AboutText += _( "Kernel version: ") + about.getKernelVersionString() + "\n" EnigmaVersion = "Enigma: " + about.getEnigmaVersionString() self["EnigmaVersion"] = StaticText(EnigmaVersion) AboutText += EnigmaVersion + "\n" GStreamerVersion = "GStreamer: " + about.getGStreamerVersionString() self["GStreamerVersion"] = StaticText(GStreamerVersion) AboutText += GStreamerVersion + "\n" ImageVersion = _("Last upgrade: ") + about.getImageVersionString() self["ImageVersion"] = StaticText(ImageVersion) AboutText += ImageVersion + "\n" AboutText += _("DVB drivers: ") + about.getDriverInstalledDate() + "\n" AboutText += _("Moderator: Sodo ") + "\n" fp_version = getFPVersion() if fp_version is None: fp_version = "" else: fp_version = _("Frontprocessor version: %d") % fp_version AboutText += fp_version + "\n" self["FPVersion"] = StaticText(fp_version) self["TunerHeader"] = StaticText(_("Detected NIMs:")) AboutText += "\n" + _("Detected NIMs:") + "\n" nims = nimmanager.nimList() 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: for count in range(len(hddlist)): if hddinfo: hddinfo += "\n" hdd = hddlist[count][1] if int(hdd.free()) > 1024: hddinfo += "%s\n(%s, %.1f GB %s)" % ( hdd.model(), hdd.capacity(), hdd.free() / 1024., _("free")) else: hddinfo += "%s\n(%s, %d MB %s)" % ( hdd.model(), hdd.capacity(), hdd.free(), _("free")) else: hddinfo = _("none") self["hddA"] = StaticText(hddinfo) AboutText += hddinfo self["AboutScrollLabel"] = ScrollLabel(AboutText) self["key_green"] = Button(_("Translations")) self["key_red"] = Button(_("Latest Commits")) 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, "up": self["AboutScrollLabel"].pageUp, "down": self["AboutScrollLabel"].pageDown })
def getAllInfo(): info = {} brand = "unknown" model = "unknown" procmodel = "unknown" orgdream = 0 if tpmloaded: orgdream = tpm_check() if fileExists("/proc/stb/info/hwmodel"): brand = "DAGS" 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 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/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 == "hd2400": brand = "Mut@nt" model = "hd2400" elif fileExists("/proc/stb/info/model"): f = open("/proc/stb/info/model",'r') procmodel = f.readline().strip().lower() f.close() if procmodel in ("esi88", "sagemcom88", "nbox"): brand = "Sagemcom" if fileExists("/proc/boxtype"): f = open("/proc/boxtype",'r') procmodel = f.readline().strip().lower() f.close() if procmodel == "tf7700hdpvr": brand = "Topfield" model = "TF7700 HDPVR" elif procmodel in ("adb2850", "adb2849", "nbox", "bska", "bsla", "bxzb", "bzzb"): brand = "Advanced Digital Broadcast" elif model in ("sagemcom88", "esi88", "uhd88", "dsi87"): brand = "Sagemcom" # Other E2 boxes also use "dm8000", so we can only safely assume "Dream Multimedia" for all others starting with "dm": 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", "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"): 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", "et9200", "et9500"): remote = "et9x00" elif procmodel in ("et5x00", "et5000", "et6x00", "et6000"): remote = "et5x00" elif procmodel in ("et4x00", "et4000"): remote = "et4x00" elif procmodel == "gbquad": remote = "gigablue" elif procmodel == "gbquadplus": remote = "gbquadplus" elif procmodel == "et6500": remote = "et6500" elif procmodel in ("et8x00", "et8000", "et1x000", "et10000"): remote = "et8000" 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 ("nbox", "sagemcom88", "esi88", "adb2850", "adb2849", "dsi87"): remote = "nbox" elif procmodel == "hd2400": remote = "hd2400" elif procmodel.startswith("ixuss"): remote = procmodel.replace(" ", "") elif procmodel == "vg2000": remote = "xcombo" 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" # 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 = "4.0" 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: pass info['oever'] = oever info['distro'] = distro info['imagever'] = imagever info['imagebuild'] = imagebuild info['driverdate'] = driverdate return info
def getInfo(): # TODO: get webif versione somewhere! info = {} info['brand'] = getMachineBrand() info['model'] = getMachineName() info['boxtype'] = getBoxType() info['machinebuild'] = getMachineBuild() chipset = "unknown" if fileExists("/etc/.box"): f = open("/etc/.box", 'r') model = f.readline().strip().lower() f.close() if model.startswith("ufs") or model.startswith("ufc"): if model in ("ufs910", "ufs922", "ufc960"): chipset = "SH4 @266MHz" else: chipset = "SH4 @450MHz" elif model in ("topf", "tf7700hdpvr"): chipset = "SH4 @266MHz" elif model.startswith("azbox"): f = open("/proc/stb/info/model", 'r') model = f.readline().strip().lower() f.close() if model == "me": chipset = "SIGMA 8655" elif model == "minime": chipset = "SIGMA 8653" else: chipset = "SIGMA 8634" elif model.startswith("spark"): if model == "spark7162": chipset = "SH4 @540MHz" else: chipset = "SH4 @450MHz" elif fileExists("/proc/stb/info/azmodel"): f = open("/proc/stb/info/model", 'r') model = f.readline().strip().lower() f.close() if model == "me": chipset = "SIGMA 8655" elif model == "minime": chipset = "SIGMA 8653" else: chipset = "SIGMA 8634" else: f = open("/proc/stb/info/model", 'r') model = f.readline().strip().lower() f.close() if model in ("esi88", "sagemcom88", "nbox"): if fileExists("/proc/boxtype"): f = open("/proc/boxtype", 'r') model = f.readline().strip().lower() f.close() if model == "tf7700hdpvr": chipset = "SH4 @266MHz" elif model in ("nbox", "bska", "bsla", "bxzb", "bzzb"): chipset = "SH4 @266MHz" elif model in ("adb2850", "adb2849"): chipset = "SH4 @450MHz" elif model in ("sagemcom88", "esi88", "uhd88", "dsi87"): chipset = "SH4 @450MHz" if fileExists("/proc/stb/info/chipset"): f = open("/proc/stb/info/chipset", 'r') chipset = f.readline().strip() f.close() info['chipset'] = chipset memFree = 0 for line in open("/proc/meminfo", 'r'): parts = line.split(':') key = parts[0].strip() if key == "MemTotal": info['mem1'] = parts[1].strip() elif key in ("MemFree", "Buffers", "Cached"): memFree += int(parts[1].strip().split(' ', 1)[0]) info['mem2'] = "%s kB" % memFree try: f = open("/proc/uptime", "rb") uptime = int(float(f.readline().split(' ', 2)[0].strip())) f.close() uptimetext = '' if uptime > 86400: d = uptime / 86400 uptime = uptime % 86400 uptimetext += '%dd ' % d uptimetext += "%d:%.2d" % (uptime / 3600, (uptime % 3600) / 60) except: uptimetext = "?" info['uptime'] = uptimetext info["webifver"] = getOpenWebifVer() info['imagedistro'] = getImageDistro() info['oever'] = getOEVersion() info['imagever'] = getImageVersion() + '.' + getImageBuild() info['enigmaver'] = getEnigmaVersionString() info['driverdate'] = getDriverDate() info['kernelver'] = about.getKernelVersionString() try: from Tools.StbHardware import getFPVersion except ImportError: from Tools.DreamboxHardware import getFPVersion info['fp_version'] = getFPVersion() info['tuners'] = [] for i in range(0, nimmanager.getSlotCount()): info['tuners'].append({ "name": nimmanager.getNim(i).getSlotName(), "type": nimmanager.getNimName(i) + " (" + nimmanager.getNim(i).getFriendlyType() + ")" }) info['ifaces'] = [] ifaces = iNetwork.getConfiguredAdapters() for iface in ifaces: info['ifaces'].append({ "name": iNetwork.getAdapterName(iface), "mac": iNetwork.getAdapterAttribute(iface, "mac"), "dhcp": iNetwork.getAdapterAttribute(iface, "dhcp"), "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'], "firstpublic": getAdapterIPv6(iface)['firstpublic'] }) info['hdd'] = [] for hdd in harddiskmanager.hdd: dev = hdd.findMount() if dev: stat = os.statvfs(dev) free = int((stat.f_bfree / 1024) * (stat.f_bsize / 1024)) else: free = -1 if free <= 1024: free = "%i MB" % free else: free = free / 1024. free = "%.3f GB" % free size = hdd.diskSize() * 1000000 / 1048576. if size > 1048576: size = "%.2f TB" % (size / 1048576.) elif size > 1024: size = "%.1f GB" % (size / 1024.) else: size = "%d MB" % size 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 TB" % iecsize else: iecsize = "%d TB" % iecsize # Round harddisk sizes beyond ~300GB to full tens: 320, 500, 640, 750GB elif iecsize > 300000: iecsize = "%d GB" % ((iecsize + 5000) // 10000 * 10) # ... be more precise for media < ~300GB (Sticks, SSDs, CF, MMC, ...): 1, 2, 4, 8, 16 ... 256GB elif iecsize > 1000: iecsize = "%d GB" % ((iecsize + 500) // 1000) else: iecsize = "%d MB" % iecsize info['hdd'].append({ "model": hdd.model(), "capacity": size, "labelled_capacity": iecsize, "free": free }) info['transcoding'] = False if (info['model'] in ("Solo²", "Duo²", "Solo SE", "Quad", "Quad Plus") or info['machinebuild'] in ('inihdp', 'hd2400', 'et10000', 'xpeedlx3', 'ew7356', 'dags3', 'dags4')): if os.path.exists( eEnv.resolve( '${libdir}/enigma2/python/Plugins/SystemPlugins/TransCodingSetup/plugin.pyo' ) ) or os.path.exists( eEnv.resolve( '${libdir}/enigma2/python/Plugins/SystemPlugins/TranscodingSetup/plugin.pyo' ) ) or os.path.exists( eEnv.resolve( '${libdir}/enigma2/python/Plugins/SystemPlugins/MultiTransCodingSetup/plugin.pyo' )): info['transcoding'] = True global STATICBOXINFO STATICBOXINFO = info return info
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'] = getMachineBrand() info['model'] = getMachineName() info['boxtype'] = getBoxType() info['machinebuild'] = getMachineBuild() chipset = "unknown" if fileExists("/etc/.box"): f = open("/etc/.box", 'r') model = f.readline().strip().lower() f.close() if model.startswith("ufs") or model.startswith("ufc"): if model in ("ufs910", "ufs922", "ufc960"): chipset = "SH4 @266MHz" else: chipset = "SH4 @450MHz" elif model in ("topf", "tf7700hdpvr"): chipset = "SH4 @266MHz" elif model.startswith("azbox"): f = open("/proc/stb/info/model", 'r') model = f.readline().strip().lower() f.close() if model == "me": chipset = "SIGMA 8655" elif model == "minime": chipset = "SIGMA 8653" else: chipset = "SIGMA 8634" elif model.startswith("spark"): if model == "spark7162": chipset = "SH4 @540MHz" else: chipset = "SH4 @450MHz" elif fileExists("/proc/stb/info/azmodel"): f = open("/proc/stb/info/model", 'r') model = f.readline().strip().lower() f.close() if model == "me": chipset = "SIGMA 8655" elif model == "minime": chipset = "SIGMA 8653" else: chipset = "SIGMA 8634" elif fileExists("/proc/stb/info/model"): f = open("/proc/stb/info/model", 'r') model = f.readline().strip().lower() f.close() if model == "tf7700hdpvr": chipset = "SH4 @266MHz" elif model == "nbox": chipset = "STi7100 @266MHz" elif model == "arivalink200": chipset = "STi7109 @266MHz" elif model in ("adb2850", "adb2849", "dsi87"): chipset = "STi7111 @450MHz" elif model in ("sagemcom88", "esi88"): chipset = "STi7105 @450MHz" elif model.startswith("spark"): if model == "spark7162": chipset = "STi7162 @540MHz" else: chipset = "STi7111 @450MHz" if fileExists("/proc/stb/info/chipset"): f = open("/proc/stb/info/chipset", 'r') chipset = f.readline().strip() f.close() info['chipset'] = chipset 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']) try: f = open("/proc/uptime", "rb") uptime = int(float(f.readline().split(' ', 2)[0].strip())) f.close() uptimetext = '' if uptime > 86400: d = uptime / 86400 uptime = uptime % 86400 uptimetext += '%dd ' % d uptimetext += "%d:%.2d" % (uptime / 3600, (uptime % 3600) / 60) except: uptimetext = "?" info['uptime'] = uptimetext info["webifver"] = getOpenWebifVer() info['imagedistro'] = getImageDistro() info['friendlyimagedistro'] = getFriendlyImageDistro() info['oever'] = getOEVersion() info['imagever'] = getImageVersion() ib = getImageBuild() if ib: info['imagever'] = info['imagever'] + "." + ib info['enigmaver'] = getEnigmaVersionString() info['driverdate'] = getDriverDate() info['kernelver'] = about.getKernelVersionString() try: from Tools.StbHardware import getFPVersion except ImportError: from Tools.DreamboxHardware import getFPVersion try: info['fp_version'] = getFPVersion() except: info['fp_version'] = None friendlychipsetdescription = _("Chipset") friendlychipsettext = info['chipset'].replace("bcm", "Broadcom ") if friendlychipsettext in ("7335", "7356", "7362", "73625", "7424", "7425", "7429"): friendlychipsettext = "Broadcom " + friendlychipsettext if not (info['fp_version'] is None or info['fp_version'] == 0): friendlychipsetdescription = friendlychipsetdescription + " (" + _( "Frontprocessor Version") + ")" friendlychipsettext = friendlychipsettext + " (" + str( info['fp_version']) + ")" info['friendlychipsetdescription'] = friendlychipsetdescription info['friendlychipsettext'] = friendlychipsettext info['tuners'] = [] for i in 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 = int((stat.f_bfree / 1024) * (stat.f_bsize / 1024)) 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 file(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] is "": 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: 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['transcoding'] = False #: models transcoding feature TC_MODELS = ("Uno4K", "Uno4K SE", "Ultimo4K", "Solo4K", "Solo²", "Duo²", "Solo SE", "Quad", "Quad Plus") #: machinebuilds transcoding feature TC_MACHINEBUILD = ('inihdp', 'hd2400', 'et10000', 'et13000', 'sf5008', 'xpeedlx3', 'ew7356', 'dags7356', 'dags7252', 'formuler1tc', 'gb7356', 'gb7252', 'tiviaraplus', '8100s') if info['model'] in TC_MODELS or info['machinebuild'] in TC_MACHINEBUILD: if os.path.exists( eEnv.resolve( '${libdir}/enigma2/python/Plugins/SystemPlugins/TransCodingSetup/plugin.pyo' ) ) or os.path.exists( eEnv.resolve( '${libdir}/enigma2/python/Plugins/SystemPlugins/TranscodingSetup/plugin.pyo' ) ) or os.path.exists( eEnv.resolve( '${libdir}/enigma2/python/Plugins/SystemPlugins/MultiTransCodingSetup/plugin.pyo' )): info['transcoding'] = True info['kinopoisk'] = False lang = ['ru', 'uk', 'lv', 'lt', 'et'] current_language = language.getLanguage() for l in lang: if l in current_language: info['kinopoisk'] = True break info['EX'] = '' if session: try: 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 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( timer.service_ref.getServiceName().replace( '\xc2\x86', '').replace('\xc2\x87', '')) print "[OpenWebif] -D- timer '%s'" % timer.service_ref.getServiceName( ) # only 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, error: info['EX'] = error
def __init__(self, session): Screen.__init__(self, session) OpenNFRVersion = _("OpenNFR %s") % about.getImageVersionString() self["OpenNFRVersion"] = Label(OpenNFRVersion) AboutText = _("Model:\t\t%s %s\n") % (getMachineBrand(), getMachineName()) bootloader = "" if path.exists('/sys/firmware/devicetree/base/bolt/tag'): f = open('/sys/firmware/devicetree/base/bolt/tag', 'r') bootloader = f.readline().replace('\x00', '').replace('\n', '') f.close() AboutText += _("Bootloader:\t\t%s\n") % (bootloader) if path.exists('/proc/stb/info/chipset'): AboutText += _("Chipset:\t\tBCM%s") % about.getChipSetString() + "\n" cpuMHz = "" if getMachineBuild() in ('vusolo4k'): cpuMHz = " (1,5 GHz)" elif getMachineBuild() in ('formuler1', 'triplex'): cpuMHz = " (1,3 GHz)" elif getMachineBuild() in ('u5','u53','u52','u51','u5pvr','h9','cc1','sf8008'): cpuMHz = " (1,6 GHz)" elif getMachineBuild() in ('vuuno4k','vuultimo4k', 'gb7252', 'dags7252'): cpuMHz = " (1,7 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 = " (%s MHz)" % str(round(int(binascii.hexlify(clockfrequency), 16)/1000000,1)) except: cpuMHz = " (1,7 GHz)" else: 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('cpu MHz'): #cpuMHz = " (" + lisp[1].replace('\n', '') + " MHz)" cpuMHz = " (" + str(int(float(lisp[1].replace('\n', '')))) + " MHz)" break except: pass AboutText += _("CPU:\t\t%s") % about.getCPUString() + cpuMHz + "\n" AboutText += _("Cores:\t\t%s") % about.getCpuCoresString() + "\n" imagestarted = "" bootname = '' if path.exists('/boot/bootname'): f = open('/boot/bootname', 'r') bootname = f.readline().split('=')[1] f.close() if getMachineBuild() in ('cc1','sf8008'): if path.exists('/boot/STARTUP'): f = open('/boot/STARTUP', 'r') f.seek(5) image = f.read(4) if image == "emmc": image = "1" elif image == "usb0": f.seek(13) image = f.read(1) if image == "1": image = "2" elif image == "3": image = "3" elif image == "5": image = "4" elif image == "7": image = "5" f.close() if bootname: bootname = " (%s)" %bootname AboutText += _("Selected Image:\t\t%s") % "STARTUP_" + image + bootname + "\n" elif path.exists('/boot/STARTUP'): f = open('/boot/STARTUP', 'r') f.seek(22) image = f.read(1) f.close() if bootname: bootname = " (%s)" %bootname AboutText += _("Selected Image:\t\t%s") % "STARTUP_" + image + bootname + "\n" string = getDriverDate() year = string[0:4] month = string[4:6] day = string[6:8] driversdate = '-'.join((year, month, day)) AboutText += _("Drivers:\t\t%s") % driversdate + "\n" AboutText += _("Image:\t\t%s") % about.getImageVersionString() + "\n" AboutText += _("Build:\t\t%s") % getImageBuild() + "\n" AboutText += _("Kernel: \t\t%s") % about.getKernelVersionString() + "\n" AboutText += _("Oe-Core:\t\t%s") % getOEVersion() + "\n" AboutText += _("Enigma (re)starts:\t%d\n") % config.misc.startCounter.value AboutText += _("GStreamer:\t\t%s") % about.getGStreamerVersionString() + "\n" AboutText += _("Python:\t\t%s") % about.getPythonVersionString() + "\n" fp_version = getFPVersion() if fp_version is None: fp_version = "" elif fp_version != 0: fp_version = _("Front Panel:\t\t%s") % fp_version AboutText += fp_version + "\n\n" else: fp_version = _("Front Panel:\t\tVersion unknown") AboutText += fp_version + "\n\n" AboutText += _("Installed:\t\t%s") % about.getFlashDateString() + "\n" AboutText += _("Last Upgrade:\t\t%s") % about.getLastUpdateString() + "\n\n" AboutText += _("WWW:\t\t%s") % about.getImageUrlString() + "\n\n" AboutText += _("based on:\t\t%s") % "www.github.com/oe-alliance" + "\n\n" self["FPVersion"] = StaticText(fp_version) 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: %s") % tempinfo.replace('\n', '') + mark + "C\n\n" # don't remove the string out of the _(), or it can't be "translated" anymore. # TRANSLATORS: Add here whatever should be shown in the "translator" about screen, up to 6 lines (use \n for newline) info = _("TRANSLATOR_INFO") if info == _("TRANSLATOR_INFO"): info = "" infolines = _("").split("\n") infomap = {} for x in infolines: l = x.split(': ') if len(l) != 2: continue (type, value) = l infomap[type] = value translator_name = infomap.get("Language-Team", "none") if translator_name == "none": translator_name = infomap.get("Last-Translator", "") self["FPVersion"] = StaticText(fp_version) self["TunerHeader"] = StaticText(_("Detected NIMs:")) nims = nimmanager.nimList() for count in range(len(nims)): if count < 4: self["Tuner" + str(count)] = StaticText(nims[count]) else: self["Tuner" + str(count)] = StaticText("") self["HDDHeader"] = StaticText(_("Detected HDD:")) hddlist = harddiskmanager.HDDList() hddinfo = "" if hddlist: for count in range(len(hddlist)): if hddinfo: hddinfo += "\n" hdd = hddlist[count][1] if int(hdd.free()) > 1024: hddinfo += "%s\n(%s, %d GB %s)" % (hdd.model(), hdd.capacity(), hdd.free()/1024, _("free")) else: hddinfo += "%s\n(%s, %d MB %s)" % (hdd.model(), hdd.capacity(), hdd.free(), _("free")) else: hddinfo = _("none") self["hddA"] = StaticText(hddinfo) self["AboutScrollLabel"] = ScrollLabel(AboutText) self["actions"] = ActionMap(["SetupActions", "ColorActions", "DirectionActions"], { "cancel": self.close, "ok": self.close, "green": self.showTranslationInfo, "up": self["AboutScrollLabel"].pageUp, "down": self["AboutScrollLabel"].pageDown })
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'] = getMachineBrand() info['model'] = getMachineName() info['boxtype'] = getBoxType() info['machinebuild'] = getMachineBuild() try: # temporary due OE-A info['lcd'] = getLcd() except: # nosec # noqa: E722 info['lcd'] = 0 try: # temporary due OE-A info['grabpip'] = getGrabPip() except: # nosec # noqa: E722 info['grabpip'] = 0 chipset = "unknown" if fileExists("/etc/.box"): f = open("/etc/.box", 'r') model = f.readline().strip().lower() f.close() if model.startswith("ufs") or model.startswith("ufc"): if model in ("ufs910", "ufs922", "ufc960"): chipset = "SH4 @266MHz" else: chipset = "SH4 @450MHz" elif model in ("topf", "tf7700hdpvr"): chipset = "SH4 @266MHz" elif model.startswith("azbox"): f = open("/proc/stb/info/model", 'r') model = f.readline().strip().lower() f.close() if model == "me": chipset = "SIGMA 8655" elif model == "minime": chipset = "SIGMA 8653" else: chipset = "SIGMA 8634" elif model.startswith("spark"): if model == "spark7162": chipset = "SH4 @540MHz" else: chipset = "SH4 @450MHz" elif fileExists("/proc/stb/info/azmodel"): f = open("/proc/stb/info/model", 'r') model = f.readline().strip().lower() f.close() if model == "me": chipset = "SIGMA 8655" elif model == "minime": chipset = "SIGMA 8653" else: chipset = "SIGMA 8634" elif fileExists("/proc/stb/info/model"): f = open("/proc/stb/info/model", 'r') model = f.readline().strip().lower() f.close() if model == "tf7700hdpvr": chipset = "SH4 @266MHz" elif model == "nbox": chipset = "STi7100 @266MHz" elif model == "arivalink200": chipset = "STi7109 @266MHz" elif model in ("adb2850", "adb2849", "dsi87"): chipset = "STi7111 @450MHz" elif model in ("sagemcom88", "esi88"): chipset = "STi7105 @450MHz" elif model.startswith("spark"): if model == "spark7162": chipset = "STi7162 @540MHz" else: chipset = "STi7111 @450MHz" elif model == "dm800": chipset = "bcm7401" elif model in ("dm800se", "dm500hd", "dm7020hd", "dm800sev2", "dm500hdv2", "dm7020hdv2"): chipset = "bcm7405" elif model == "dm8000": chipset = "bcm7400" elif model in ("dm820", "dm7080"): chipset = "bcm7435" elif model in ("dm520", "dm525"): chipset = "bcm73625" elif model in ("dm900", "dm920"): chipset = "bcm7252S" if fileExists("/proc/stb/info/chipset"): f = open("/proc/stb/info/chipset", 'r') chipset = f.readline().strip() f.close() info['chipset'] = chipset 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']) try: f = open("/proc/uptime", "r") uptime = int(float(f.readline().split(' ', 2)[0].strip())) f.close() uptimetext = '' if uptime > 86400: d = uptime / 86400 uptime = uptime % 86400 uptimetext += '%dd ' % d uptimetext += "%d:%.2d" % (uptime / 3600, (uptime % 3600) / 60) except: # nosec # noqa: E722 uptimetext = "?" info['uptime'] = uptimetext info["webifver"] = OPENWEBIFVER info['imagedistro'] = getImageDistro() info['friendlyimagedistro'] = getFriendlyImageDistro() info['oever'] = getOEVersion() info['imagever'] = getImageVersion() ib = getImageBuild() if ib: info['imagever'] = info['imagever'] + "." + ib info['enigmaver'] = getEnigmaVersionString() info['driverdate'] = getDriverDate() info['kernelver'] = about.getKernelVersionString() try: from Tools.StbHardware import getFPVersion except ImportError: from Tools.DreamboxHardware import getFPVersion try: info['fp_version'] = getFPVersion() except: # nosec # noqa: E722 info['fp_version'] = None friendlychipsetdescription = _("Chipset") friendlychipsettext = info['chipset'].replace("bcm", "Broadcom ") if friendlychipsettext in ("7335", "7356", "7362", "73625", "7424", "7425", "7429"): friendlychipsettext = "Broadcom " + friendlychipsettext if not (info['fp_version'] is None or info['fp_version'] == 0): friendlychipsetdescription = friendlychipsetdescription + " (" + _("Front processor version") + ")" friendlychipsettext = friendlychipsettext + " (" + str(info['fp_version']) + ")" info['friendlychipsetdescription'] = friendlychipsetdescription info['friendlychipsettext'] = friendlychipsettext 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: # nosec # 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['transcoding'] = TRANSCODING info['EX'] = '' if session: try: # gets all current stream clients for images using eStreamServer # TODO: get tuner info for streams info['streams'] = GetStreamInfo() recs = NavigationInstance.instance.getRecordings() if recs: # only one stream s_name = '' if len(info['streams']) == 1: sinfo = info['streams'][0] s_name = sinfo["name"] + ' (' + sinfo["ip"] + ')' print("[OpenWebif] -D- s_name '%s'" % s_name) serviceNames = {} for timer in NavigationInstance.instance.RecordTimer.timer_list: if timer.isRunning() and not timer.justplay: timer_rs = timer.record_service feinfo = timer_rs and hasattr(timer_rs, "frontendInfo") and timer_rs.frontendInfo() fedata = feinfo and hasattr(feinfo, "getFrontendData") and feinfo.getFrontendData() tuner_num = fedata and "tuner_number" in fedata and fedata.get("tuner_number") if tuner_num is not None: if tuner_num in serviceNames: # this tuner is recording more than one timer serviceNames[tuner_num] += ", " + removeBad(timer.service_ref.getServiceName()) else: serviceNames[tuner_num] = removeBad(timer.service_ref.getServiceName()) print("[OpenWebif] -D- timer '%s'" % timer.service_ref.getServiceName()) 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'] if nr in serviceNames: info['tuners'][nr]['rec'] = getOrbitalText(cur_info) + ' / ' + serviceNames[nr] else: info['tuners'][nr]['rec'] = getOrbitalText(cur_info) + ' / ' + s_name 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(ServiceReference("1:0:1:0:0:0:0:0:0:0"), 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) info['textinputsupport'] = TEXTINPUTSUPPORT STATICBOXINFO = info return info
def getAboutText(): AboutText = "" AboutText += _("Model:\t%s %s\n") % (getMachineBrand(), getMachineName()) bootloader = "" if path.exists('/sys/firmware/devicetree/base/bolt/tag'): f = open('/sys/firmware/devicetree/base/bolt/tag', 'r') bootloader = f.readline().replace('\x00', '').replace('\n', '') f.close() AboutText += _("Bootloader:\t\t%s\n") % (bootloader) if path.exists('/proc/stb/info/chipset'): AboutText += _("Chipset:\t%s") % about.getChipSetString() + "\n" cpuMHz = "" if getMachineBuild() in ('vusolo4k','vuultimo4k','vuzero4k'): cpuMHz = " (1,5 GHz)" elif getMachineBuild() in ('formuler1tc','formuler1', 'triplex', 'tiviaraplus'): cpuMHz = " (1,3 GHz)" elif getMachineBuild() in ('u5','u5pvr'): cpuMHz = " (1,6 GHz)" elif getMachineBuild() in ('vuuno4kse','vuuno4k','dm900','dm920', 'gb7252', 'dags7252','xc7439','8100s'): cpuMHz = " (1,7 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 = " (%s MHz)" % str(round(int(binascii.hexlify(clockfrequency), 16)/1000000,1)) except: cpuMHz = " (1,7 GHz)" else: 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('cpu MHz'): #cpuMHz = " (" + lisp[1].replace('\n', '') + " MHz)" cpuMHz = " (" + str(int(float(lisp[1].replace('\n', '')))) + " MHz)" break except: pass AboutText += _("CPU:\t%s") % about.getCPUString() + cpuMHz + "\n" AboutText += _("Cores:\t%s") % about.getCpuCoresString() + "\n" imagestarted = "" bootname = '' if path.exists('/boot/bootname'): f = open('/boot/bootname', 'r') bootname = f.readline().split('=')[1] f.close() if path.exists('/boot/STARTUP'): f = open('/boot/STARTUP', 'r') f.seek(22) image = f.read(1) f.close() if bootname: bootname = " (%s)" %bootname AboutText += _("Selected Image:\t%s") % "STARTUP_" + image + bootname + "\n" elif path.exists('/boot/cmdline.txt'): f = open('/boot/cmdline.txt', 'r') f.seek(38) image = f.read(1) f.close() if bootname: bootname = " (%s)" %bootname AboutText += _("Selected Image:\t%s") % "STARTUP_" + image + bootname + "\n" AboutText += _("Version:\t%s") % getImageVersion() + "\n" AboutText += _("Build:\t%s") % getImageBuild() + "\n" AboutText += _("Kernel:\t%s") % about.getKernelVersionString() + "\n" string = getDriverDate() year = string[0:4] month = string[4:6] day = string[6:8] driversdate = '-'.join((year, month, day)) AboutText += _("Drivers:\t%s") % driversdate + "\n" AboutText += _("GStreamer:\t%s") % about.getGStreamerVersionString() + "\n" AboutText += _("Python:\t%s") % about.getPythonVersionString() + "\n" if getMachineBuild() not in ('vuzero4k','sf5008','et13000','et1x000','hd51','hd52','vusolo4k','vuuno4k','vuuno4kse','vuultimo4k','sf4008','dm820','dm7080','dm900','dm920', 'gb7252', 'dags7252', 'vs1500','h7','xc7439','8100s','u5','u5pvr'): AboutText += _("Installed:\t%s") % about.getFlashDateString() + "\n" AboutText += _("Last update:\t%s") % getEnigmaVersionString() + "\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() elif path.exists('/proc/stb/sensors/temp/value'): f = open('/proc/stb/sensors/temp/value', '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() elif path.exists('/sys/devices/virtual/thermal/thermal_zone0/temp'): try: f = open('/sys/devices/virtual/thermal/thermal_zone0/temp', 'r') tempinfo = f.read() tempinfo = tempinfo[:-4] f.close() except: tempinfo = "" 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 populate(self): self["lab1"] = StaticText(_("Virtuosso Image Xtreme")) self["lab2"] = StaticText(_("By Team ViX")) model = None AboutText = "" self["lab3"] = StaticText( _("Support at") + " www.world-of-satellite.com") AboutText += _("Model:\t%s %s\n") % (getMachineBrand(), getMachineName()) if about.getChipSetString() != _("unavailable"): if SystemInfo["HasHiSi"]: AboutText += _("Chipset:\tHiSilicon %s\n" ) % about.getChipSetString().upper() elif about.getIsBroadcom(): AboutText += _("Chipset:\tBroadcom %s\n" ) % about.getChipSetString().upper() else: AboutText += _( "Chipset:\t%s\n") % about.getChipSetString().upper() AboutText += _("CPU:\t%s %s %s\n") % (about.getCPUArch(), about.getCPUSpeedString(), about.getCpuCoresString()) imageSubBuild = "" if getImageType() != 'release': imageSubBuild = ".%s" % getImageDevBuild() AboutText += _("Image:\t%s.%s%s (%s)\n") % (getImageVersion( ), getImageBuild(), imageSubBuild, getImageType().title()) if SystemInfo["canMultiBoot"]: slot = image = GetCurrentImage() part = "eMMC slot %s" % slot bootmode = "" if SystemInfo["canMode12"]: bootmode = "bootmode = %s" % GetCurrentImageMode() if SystemInfo["HasSDmmc"]: slot += 1 if image != 0: part = "SDC slot %s (%s%s) " % ( image, SystemInfo["canMultiBoot"][2], image * 2) else: part = "eMMC slot %s" % slot AboutText += _("Image Slot:\t%s") % "STARTUP_" + str( slot) + " " + part + " " + bootmode + "\n" if getMachineName() in ('ET8500') and path.exists('/proc/mtd'): self.dualboot = self.dualBoot() if self.dualboot: AboutText += _("ET8500 Multiboot: Installed\n") skinWidth = getDesktop(0).size().width() skinHeight = getDesktop(0).size().height() string = getDriverDate() year = string[0:4] month = string[4:6] day = string[6:8] driversdate = '-'.join((year, month, day)) AboutText += _("Drivers:\t%s\n") % driversdate AboutText += _("Kernel:\t%s\n") % about.getKernelVersionString() AboutText += _("GStreamer:\t%s\n") % about.getGStreamerVersionString( ).replace("GStreamer ", "") AboutText += _("Python:\t%s\n") % about.getPythonVersionString() AboutText += _("Installed:\t%s\n") % about.getFlashDateString() AboutText += _("Last update:\t%s\n") % getEnigmaVersionString() AboutText += _("E2 (re)starts:\t%s\n") % config.misc.startCounter.value AboutText += _("Skin:\t%s") % config.skin.primary_skin.value[0:-9] + _( " (%s x %s)") % (skinWidth, skinHeight) + "\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() elif path.exists('/proc/stb/sensors/temp/value'): f = open('/proc/stb/sensors/temp/value', 'r') tempinfo = f.read() f.close() if tempinfo and int(tempinfo.replace('\n', '')) > 0: mark = str('\xc2\xb0') AboutText += _("System temp:\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() elif path.exists('/sys/devices/virtual/thermal/thermal_zone0/temp'): try: f = open('/sys/devices/virtual/thermal/thermal_zone0/temp', 'r') tempinfo = f.read() tempinfo = tempinfo[:-4] f.close() except: tempinfo = "" elif path.exists('/proc/hisi/msp/pm_cpu'): try: tempinfo = search( 'temperature = (\d+) degree', open("/proc/hisi/msp/pm_cpu").read()).group(1) except: tempinfo = "" if tempinfo and int(tempinfo) > 0: mark = str('\xc2\xb0') AboutText += _("Processor temp:\t%s") % tempinfo.replace( '\n', '').replace(' ', '') + mark + "C\n" AboutLcdText = AboutText.replace('\t', ' ') fp_version = getFPVersion() if fp_version is None: fp_version = "" elif fp_version != 0: fp_version = _("FP version:\t%s") % fp_version AboutText += fp_version + "\n" bootloader = "" if path.exists('/sys/firmware/devicetree/base/bolt/tag'): f = open('/sys/firmware/devicetree/base/bolt/tag', 'r') bootloader = f.readline().replace('\x00', '').replace('\n', '') f.close() AboutText += _("Bootloader:\t%s\n") % (bootloader) self["AboutScrollLabel"] = ScrollLabel(AboutText)
def __init__(self, session): Screen.__init__(self, session) self.setTitle(_("About")) hddsplit = skin.parameters.get("AboutHddSplit", 0) AboutText = _("Hardware: ") + about.getHardwareTypeString() + "\n" AboutText += _("CPU: ") + about.getCPUInfoString() + "\n" AboutText += _("Image: ") + about.getImageTypeString() + "\n" AboutText += _("Build date: ") + about.getBuildDateString() + "\n" AboutText += _("Last upgrade: ") + 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 += _("Kernel version: ") + about.getKernelVersionString() + "\n" AboutText += _("DVB driver version: ") + about.getDriverInstalledDate() + "\n" GStreamerVersion = _("GStreamer version: ") + about.getGStreamerVersionString().replace("GStreamer","") self["GStreamerVersion"] = StaticText(GStreamerVersion) AboutText += GStreamerVersion + "\n" AboutText += _("Python version: ") + about.getPythonVersionString() + "\n" AboutText += _("Enigma (re)starts: %d\n") % config.misc.startCounter.value 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) 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 populate(self): def netspeed(): netspeed = "" for line in popen('ethtool eth0 |grep Speed', 'r'): line = line.strip().split(":") line = line[1].replace(' ', '') netspeed += line return str(netspeed) def netspeed_eth1(): netspeed = "" for line in popen('ethtool eth1 |grep Speed', 'r'): line = line.strip().split(":") line = line[1].replace(' ', '') netspeed += line return str(netspeed) def netspeed_ra0(): netspeed = "" for line in popen('iwconfig ra0 | grep Bit | cut -c 75-85', 'r'): line = line.strip() netspeed += line return str(netspeed) def netspeed_wlan0(): netspeed = "" for line in popen('iwconfig wlan0 | grep Bit | cut -c 75-85', 'r'): line = line.strip() netspeed += line return str(netspeed) def netspeed_wlan1(): netspeed = "" for line in popen('iwconfig wlan1 | grep Bit | cut -c 75-85', 'r'): line = line.strip() netspeed += line return str(netspeed) def freeflash(): freeflash = "" for line in popen( "df -mh / | grep -v '^Filesystem' | awk '{print $4}'", 'r'): line = line.strip() freeflash += line return str(freeflash) self["lab1"] = StaticText(_("openHDF")) self["lab2"] = StaticText(_("Support at") + " www.HDFreaks.cc") model = None AboutText = "" self["lab2"] = StaticText(_("Support @") + " www.hdfreaks.cc") AboutText += _("Model:\t%s %s - OEM Model: %s\n") % ( getMachineBrand(), getMachineName(), getBrandOEM()) if path.exists('/proc/stb/info/chipset'): AboutText += _("Chipset:\t%s") % about.getChipSetString() + "\n" 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 = "" bootloader = "" if path.exists('/sys/firmware/devicetree/base/bolt/tag'): f = open('/sys/firmware/devicetree/base/bolt/tag', 'r') bootloader = f.readline().replace('\x00', '').replace('\n', '') f.close() BootLoaderVersion = 0 try: if bootloader: AboutText += _("Bootloader:\t%s\n") % (bootloader) BootLoaderVersion = int(bootloader[1:]) except: BootLoaderVersion = 0 if getMachineBuild() in ('vusolo4k'): cpuMHz = " (1,5 GHz)" elif getMachineBuild() in ('u41', 'u42'): cpuMHz = " (1,0 GHz)" elif getMachineBuild() in ('vuuno4k', 'dm900', 'gb7252', 'dags7252'): cpuMHz = " (1,7 GHz)" elif getMachineBuild() in ('formuler1tc', 'formuler1', 'triplex'): cpuMHz = " (1,3 GHz)" elif getMachineBuild() in ('u5', 'u51', 'u52', 'u53', 'u5pvr', 'h9', 'sf8008', 'sf8008s', 'sf8008t', 'hd60', "hd61", 'i55plus'): cpuMHz = " (1,6 GHz)" elif getMachineBuild() in ('sf5008', 'et13000', 'et1x000', 'hd52', 'hd51', 'sf4008', 'vs1500', 'h7', 'osmio4k'): try: import binascii f = open( '/sys/firmware/devicetree/base/cpus/cpu@0/clock-frequency', 'rb') clockfrequency = f.read() f.close() cpuMHz = "%s MHz" % str( round( int(binascii.hexlify(clockfrequency), 16) / 1000000, 1)) except: cpuMHz = "1,7 GHz" else: 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('cpu MHz'): #cpuMHz = " (" + lisp[1].replace('\n', '') + " MHz)" cpuMHz = " (" + str( int(float(lisp[1].replace('\n', '')))) + " MHz)" break except: pass bogoMIPS = "" if res: cpuMHz = "" + res.replace("\n", "") + " MHz" if res2: bogoMIPS = "" + res2.replace("\n", "") if getMachineBuild() in ('vusolo4k', 'hd51', 'hd52', 'sf4008', 'dm900', 'h7', 'gb7252', '8100s'): AboutText += _("CPU:\t%s") % about.getCPUString() + cpuMHz + "\n" else: AboutText += _( "CPU:\t%s") % about.getCPUString() + " " + cpuMHz + "\n" dMIPS = 0 if getMachineBuild() in ('vusolo4k'): dMIPS = "10.500" elif getMachineBuild() in ('hd52', 'hd51', 'sf4008', 'dm900', 'h7', 'gb7252', '8100s'): dMIPS = "12.000" if getMachineBuild() in ('vusolo4k', 'hd51', 'hd52', 'sf4008', 'dm900', 'h7', 'gb7252', '8100s'): AboutText += _("DMIPS:\t") + dMIPS + "\n" else: AboutText += _("BogoMIPS:\t%s") % bogoMIPS + "\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() elif path.exists('/proc/stb/sensors/temp/value'): f = open('/proc/stb/sensors/temp/value', 'r') tempinfo = f.read() f.close() elif path.exists('/sys/devices/virtual/thermal/thermal_zone0/temp'): if getBoxType() in ('mutant51', 'ax51', 'zgemmah7', 'e4hdultra'): tempinfo = "" else: f = open('/sys/devices/virtual/thermal/thermal_zone0/temp', 'r') tempinfo = f.read() tempinfo = tempinfo[:-4] f.close() if tempinfo and int(tempinfo.replace('\n', '')) > 0: mark = str('\xc2\xb0') AboutText += _("System Temp:\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() elif path.exists('/proc/stb/power/avs'): f = open('/proc/stb/power/avs', 'r') tempinfo = f.read() f.close() elif path.exists('/sys/devices/virtual/thermal/thermal_zone0/temp'): try: f = open('/sys/devices/virtual/thermal/thermal_zone0/temp', 'r') tempinfo = f.read() tempinfo = tempinfo[:-4] f.close() except: tempinfo = "" elif path.exists('/proc/hisi/msp/pm_cpu'): try: for line in open('/proc/hisi/msp/pm_cpu').readlines(): line = [x.strip() for x in line.strip().split(":")] if line[0] in ("Tsensor"): temp = line[1].split("=") temp = line[1].split(" ") tempinfo = temp[2] except: tempinfo = "" if tempinfo and int(tempinfo.replace('\n', '')) > 0: mark = str('\xc2\xb0') AboutText += _("CPU Temp:\t%s") % tempinfo.replace( '\n', '').replace(' ', '') + mark + "C\n" AboutText += _("Cores:\t%s") % about.getCpuCoresString() + "\n" AboutText += _("HDF Version:\tV%s") % getImageVersion( ) + " Build #" + getImageBuild() + " based on " + getOEVersion() + "\n" AboutText += _("Kernel (Box):\t%s") % about.getKernelVersionString( ) + " (" + getBoxType() + ")" + "\n" imagestarted = "" bootname = '' if path.exists('/boot/bootname'): f = open('/boot/bootname', 'r') bootname = f.readline().split('=')[1] f.close() if SystemInfo["HasRootSubdir"]: image = find_rootfssubdir("STARTUP") AboutText += _("Selected Image:\t%s" ) % "STARTUP_" + image[-1:] + bootname + "\n" elif getMachineBuild() in ('gbmv200', 'cc1', 'sf8008', 'ustym4kpro', 'beyonwizv2', "viper4k"): if path.exists('/boot/STARTUP'): f = open('/boot/STARTUP', 'r') f.seek(5) image = f.read(4) if image == "emmc": image = "1" elif image == "usb0": f.seek(13) image = f.read(1) if image == "1": image = "2" elif image == "3": image = "3" elif image == "5": image = "4" elif image == "7": image = "5" f.close() if bootname: bootname = " (%s)" % bootname AboutText += _( "Partition:\t%s") % "STARTUP_" + image + bootname + "\n" else: f = open('/boot/STARTUP', 'r') f.seek(22) image = f.read(1) f.close() if bootname: bootname = " (%s)" % bootname AboutText += _( "Partition:\t%s") % "STARTUP_" + image + bootname + "\n" if path.isfile("/etc/issue"): version = open("/etc/issue").readlines()[-2].upper().strip()[:-6] if path.isfile("/etc/image-version"): build = self.searchString("/etc/image-version", "^build=") version = "%s #%s" % (version, build) AboutText += _("Image:\t%s") % version + "\n" string = getDriverDate() year = string[0:4] month = string[4:6] day = string[6:8] driversdate = '-'.join((year, month, day)) gstcmd = 'opkg list-installed | grep "gstreamer1.0 -" | cut -c 16-32' gstcmd2 = os.system(gstcmd) #return (gstcmd2) AboutText += _("Drivers:\t%s") % driversdate + "\n" AboutText += _( "GStreamer:\t%s") % about.getGStreamerVersionString() + "\n" AboutText += _("Python:\t%s\n") % about.getPythonVersionString() if path.exists('/boot/STARTUP'): #if getMachineBuild() in ('cc1','sf8008','sf8008s','sf8008t'): # os.system("tune2fs -l /dev/sda2 | grep 'Filesystem created:' | cut -d ' ' -f 9-13 > /tmp/flashdate" ) #else: # os.system("tune2fs -l /dev/sda1 | grep 'Filesystem created:' | cut -d ' ' -f 9-13 > /tmp/flashdate" ) #flashdate = open('/tmp/flashdate', 'r').read() #AboutText += _("Flashed:\t%s") % flashdate AboutText += _("Flashed:\tMultiboot active\n") else: AboutText += _("Flashed:\t%s\n") % about.getFlashDateString() AboutText += _("Free Flash:\t%s\n") % freeflash() AboutText += _("Skin:\t%s (%s x %s)\n") % ( config.skin.primary_skin.value.split('/')[0], getDesktop(0).size().width(), getDesktop(0).size().height()) AboutText += _("Last update:\t%s") % getEnigmaVersionString( ) + " to Build #" + getImageBuild() + "\n" AboutText += _("E2 (re)starts:\t%s\n") % config.misc.startCounter.value AboutText += _("Network:") eth0 = about.getIfConfig('eth0') eth1 = about.getIfConfig('eth1') ra0 = about.getIfConfig('ra0') wlan0 = about.getIfConfig('wlan0') wlan1 = about.getIfConfig('wlan1') if eth0.has_key('addr'): for x in about.GetIPsFromNetworkInterfaces(): AboutText += "\t" + x[0] + ": " + x[1] + " (" + netspeed( ) + ")\n" elif eth1.has_key('addr'): for x in about.GetIPsFromNetworkInterfaces(): AboutText += "\t" + x[0] + ": " + x[1] + " (" + netspeed_eth1( ) + ")\n" elif ra0.has_key('addr'): for x in about.GetIPsFromNetworkInterfaces(): AboutText += "\t" + x[0] + ": " + x[1] + " (~" + netspeed_ra0( ) + ")\n" elif wlan0.has_key('addr'): for x in about.GetIPsFromNetworkInterfaces(): AboutText += "\t" + x[0] + ": " + x[ 1] + " (~" + netspeed_wlan0() + ")\n" elif wlan1.has_key('addr'): for x in about.GetIPsFromNetworkInterfaces(): AboutText += "\t" + x[0] + ": " + x[ 1] + " (~" + netspeed_wlan1() + ")\n" else: for x in about.GetIPsFromNetworkInterfaces(): AboutText += "\t" + x[0] + ": " + x[1] + "\n" fp_version = getFPVersion() if fp_version is None: fp_version = "" elif fp_version != 0: fp_version = _("Frontprocessor:\tVersion %s") % fp_version AboutText += fp_version + "\n" AboutLcdText = AboutText.replace('\t', ' ') self["AboutScrollLabel"] = ScrollLabel(AboutText)
def populate(self): self["lab1"] = StaticText(_("Open Black Hole")) self["lab2"] = StaticText(_("From the BH Team")) model = None AboutText = "" self["lab3"] = StaticText( _("Support at %s") % "www.vuplus-community.net") AboutText += _("Model:\t%s %s\n") % (getMachineBrand(), getMachineName()) if about.getChipSetString() != _("unavailable"): if SystemInfo["HasHiSi"]: AboutText += _("Chipset:\tHiSilicon %s\n" ) % about.getChipSetString().upper() elif about.getIsBroadcom(): AboutText += _("Chipset:\tBroadcom %s\n" ) % about.getChipSetString().upper() else: AboutText += _( "Chipset:\t%s\n") % about.getChipSetString().upper() AboutText += _("CPU:\t%s %s %s\n") % (about.getCPUArch(), about.getCPUSpeedString(), about.getCpuCoresString()) imageSubBuild = "" if getImageType() != 'release': imageSubBuild = ".%s" % getImageDevBuild() AboutText += _("Image:\t%s.%s%s (%s)\n") % (getImageVersion( ), getImageBuild(), imageSubBuild, getImageType().title()) if SystemInfo["HasH9SD"]: if "rootfstype=ext4" in open( '/sys/firmware/devicetree/base/chosen/bootargs', 'r').read(): part = " - SD card in use for Image root \n" else: part = " - eMMC slot in use for Image root \n" AboutText += _("%s") % part if SystemInfo["canMultiBoot"]: slot = image = GetCurrentImage() part = "eMMC slot %s" % slot bootmode = "" if SystemInfo["canMode12"]: bootmode = "bootmode = %s" % GetCurrentImageMode() print "[About] HasHiSi = %s, slot = %s" % (SystemInfo["HasHiSi"], slot) if SystemInfo["HasHiSi"] and "sda" in SystemInfo["canMultiBoot"][ slot]['root']: if slot > 4: image -= 4 else: image -= 1 part = "SDcard slot %s (%s) " % ( image, SystemInfo["canMultiBoot"][slot]['root']) AboutText += _("Image Slot:\t%s") % "STARTUP_" + str( slot) + " " + part + " " + bootmode + "\n" skinWidth = getDesktop(0).size().width() skinHeight = getDesktop(0).size().height() string = getDriverDate() year = string[0:4] month = string[4:6] day = string[6:8] driversdate = '-'.join((year, month, day)) AboutText += _("Drivers:\t%s\n") % driversdate AboutText += _("Kernel:\t%s\n") % about.getKernelVersionString() AboutText += _("GStreamer:\t%s\n") % about.getGStreamerVersionString( ).replace("GStreamer ", "") AboutText += _("Python:\t%s\n") % about.getPythonVersionString() AboutText += _("Installed:\t%s\n") % about.getFlashDateString() AboutText += _("Last update:\t%s\n") % getEnigmaVersionString() AboutText += _("E2 (re)starts:\t%s\n") % config.misc.startCounter.value uptime = about.getBoxUptime() if uptime: AboutText += _("Uptime:\t%s\n") % uptime e2uptime = about.getEnigmaUptime() if e2uptime: AboutText += _("Enigma2 uptime:\t%s\n") % e2uptime AboutText += _("Skin:\t%s") % config.skin.primary_skin.value[0:-9] + _( " (%s x %s)") % (skinWidth, skinHeight) + "\n" tempinfo = "" if path.exists('/proc/stb/sensors/temp0/value'): with open('/proc/stb/sensors/temp0/value', 'r') as f: tempinfo = f.read() elif path.exists('/proc/stb/fp/temp_sensor'): with open('/proc/stb/fp/temp_sensor', 'r') as f: tempinfo = f.read() elif path.exists('/proc/stb/sensors/temp/value'): with open('/proc/stb/sensors/temp/value', 'r') as f: tempinfo = f.read() if tempinfo and int(tempinfo.replace('\n', '')) > 0: mark = str('\xc2\xb0') AboutText += _("System temp:\t%s") % tempinfo.replace( '\n', '').replace(' ', '') + mark + "C\n" tempinfo = "" if path.exists('/proc/stb/fp/temp_sensor_avs'): with open('/proc/stb/fp/temp_sensor_avs', 'r') as f: tempinfo = f.read() elif path.exists('/sys/devices/virtual/thermal/thermal_zone0/temp'): try: with open('/sys/devices/virtual/thermal/thermal_zone0/temp', 'r') as f: tempinfo = f.read() tempinfo = tempinfo[:-4] except: tempinfo = "" elif path.exists('/proc/hisi/msp/pm_cpu'): try: tempinfo = search( 'temperature = (\d+) degree', open("/proc/hisi/msp/pm_cpu").read()).group(1) except: tempinfo = "" if tempinfo and int(tempinfo) > 0: mark = str('\xc2\xb0') AboutText += _("Processor temp:\t%s") % tempinfo.replace( '\n', '').replace(' ', '') + mark + "C\n" AboutLcdText = AboutText.replace('\t', ' ') fp_version = getFPVersion() if fp_version is None: fp_version = "" elif fp_version != 0: fp_version = _("FP version:\t%s") % fp_version AboutText += fp_version + "\n" bootloader = "" if path.exists('/sys/firmware/devicetree/base/bolt/tag'): f = open('/sys/firmware/devicetree/base/bolt/tag', 'r') bootloader = f.readline().replace('\x00', '').replace('\n', '') f.close() AboutText += _("Bootloader:\t%s\n") % (bootloader) self["AboutScrollLabel"] = ScrollLabel(AboutText)
def __init__(self, session): Screen.__init__(self, session) self.setTitle(_("About")) hddsplit, = skin.parameters.get("AboutHddSplit", (0, )) AboutText = _("Model: %s %s") % (getMachineBrand(), getMachineName()) + "\n" AboutText += _("Image: ") + about.getImageTypeString() + "\n" AboutText += _( "Kernel version: ") + about.getKernelVersionString() + "\n" if path.exists('/proc/stb/info/chipset'): AboutText += _("Chipset: %s") % about.getChipSetString() + "\n" AboutText += _("CPU: %s") % about.getCPUString() + "\n" AboutText += _("Version: %s") % getImageVersion() + "\n" AboutText += _("Build: %s") % getImageBuild() + "\n" if path.exists('/proc/stb/info/release') and getBoxType() in ( 'et7000', 'et7500', 'et8500'): realdriverdate = open("/proc/stb/info/release", 'r') for line in realdriverdate: tmp = line.strip() AboutText += _("Drivers: %s") % tmp + "\n" realdriverdate.close() else: string = getDriverDate() year = string[0:4] month = string[4:6] day = string[6:8] driversdate = '-'.join((year, month, day)) AboutText += _("Drivers: %s") % driversdate + "\n" EnigmaVersion = "Enigma: " + about.getEnigmaVersionString() self["EnigmaVersion"] = StaticText(EnigmaVersion) AboutText += EnigmaVersion + "\n" AboutText += _( "Enigma (re)starts: %d\n") % config.misc.startCounter.value GStreamerVersion = "GStreamer: " + about.getGStreamerVersionString( ).replace("GStreamer", "") self["GStreamerVersion"] = StaticText(GStreamerVersion) AboutText += GStreamerVersion + "\n" ImageVersion = _("Last upgrade: ") + about.getImageVersionString() self["ImageVersion"] = StaticText(ImageVersion) AboutText += ImageVersion + "\n" AboutText += _( "Python version: ") + about.getPythonVersionString() + "\n" + "\n" fp_version = getFPVersion() if fp_version is None: fp_version = "" else: fp_version = _("Frontprocessor version: %d") % fp_version AboutText += fp_version + "\n" self["FPVersion"] = StaticText(fp_version) skinWidth = getDesktop(0).size().width() skinHeight = getDesktop(0).size().height() AboutText += _("Skin Name: %s") % config.skin.primary_skin.value[ 0:-9] + _(" (%s x %s)") % (skinWidth, skinHeight) + "\n" if path.exists('/etc/enigma2/EtRcType'): rfp = open('/etc/enigma2/EtRcType', "r") Remote = rfp.read() rfp.close AboutText += _("Remote control type") + _(": ") + Remote + "\n" else: AboutText += _("Remote control type") + _( ": ") + iRcTypeControl.getBoxType() + "\n" if path.exists('/proc/stb/ir/rc/type'): fp = open('/proc/stb/ir/rc/type', "r") RcID = fp.read() fp.close AboutText += _("Remote control ID") + _(": ") + RcID self["TunerHeader"] = StaticText(_("Detected NIMs:")) AboutText += "\n" + _("Detected NIMs:") + "\n" nims = nimmanager.nimList(showFBCTuners=False) 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(_("Memory Info")) self["key_blue"] = Button(_("%s ") % getMachineName() + _("picture")) self["actions"] = ActionMap( ["ColorActions", "SetupActions", "DirectionActions"], { "cancel": self.close, "ok": self.close, "red": self.showCommits, "green": self.showTranslationInfo, "yellow": self.showMemoryInfo, "blue": self.showModelPic, "up": self["AboutScrollLabel"].pageUp, "down": self["AboutScrollLabel"].pageDown })
def getAllInfo(): info = {} brand = "unknown" model = "unknown" procmodel = "unknown" grabpip = 0 lcd = 0 orgdream = 0 if tpmloaded: orgdream = tpm_check() if fileExists("/proc/stb/info/hwmodel"): brand = "DAGS" 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") or procmodel.startswith("purehd") or procmodel.startswith("revo4k") or procmodel.startswith("galaxy4k")): 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") elif procmodel == "purehdse": model = procmodel.replace("purehdse", "Pure HD SE") elif procmodel == "revo4k": model = procmodel.replace("revo4k", "Revo4K") elif procmodel == "galaxy4k": model = procmodel.replace("galaxy4k", "Galaxy4K") elif (procmodel.startswith("lunix") or procmodel.startswith("dual")): brand = "Qviart" if procmodel == "lunix3-4k": model = procmodel.replace("lunix3-4k", "Lunix3-4K") elif procmodel == "lunix": model = procmodel.replace("lunix", "Lunix") elif procmodel == "lunix4k": model = procmodel.replace("lunix4k", "Lunix4K") elif procmodel == "dual": model = procmodel.replace("dual", "Dual") 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() if procmodel == "GBQUAD PLUS": model = procmodel.replace("GBQUAD", "Quad").replace("PLUS", " Plus") elif procmodel == "gbquad4k": model = procmodel.replace("gbquad4k", "UHD Quad 4k") elif procmodel == "quad4k": model = procmodel.replace("quad4k", "UHD Quad 4k") elif procmodel == "gbue4k": model = procmodel.replace("gbue4k", "UHD UE 4k") elif procmodel == "ue4k": model = procmodel.replace("ue4k", "UHD UE 4k") elif procmodel == "gbtrio4k": model = procmodel.replace("gbtrio4k", "UHD Trio 4k") elif fileExists("/proc/stb/info/vumodel" ) and not fileExists("/proc/stb/info/boxtype"): 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", "²").replace("4Kse", "4K SE") if not procmodel.startswith("vu"): procmodel = "vu%s" % procmodel 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"): if procmodel == "et7000mini": brand = "Galaxy Innovations" model = "ET-7000 Mini" elif procmodel == "et11000": brand = "Galaxy Innovations" model = "ET-11000" else: brand = "Xtrend" model = procmodel.upper() elif procmodel.startswith("xpeed"): brand = "Golden Interstar" model = procmodel elif procmodel.startswith("xp"): brand = "MaxDigital" model = procmodel.upper() elif procmodel.startswith("ixuss"): brand = "Medialink" model = procmodel.replace(" ", "") elif procmodel == "formuler4turbo": brand = "Formuler" model = "F4 Turbo" elif procmodel.startswith("formuler"): brand = "Formuler" model = procmodel.replace("formuler", "") if model.isdigit(): model = 'F' + model elif procmodel.startswith("mbtwinplus"): brand = "Miraclebox" model = "Premium Twin+" elif procmodel.startswith("alphatriplehd"): brand = "SAB" model = "Alpha Triple HD" elif procmodel in ("7000s", "mbmicro"): procmodel = "mbmicro" brand = "Miraclebox" model = "Premium Micro" elif procmodel in ("7005s", "mbmicrov2"): procmodel = "mbmicrov2" brand = "Miraclebox" model = "Premium Micro v2" 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 == "hd1265": brand = "Mut@nt" model = "HD1265" elif procmodel == "hd2400": brand = "Mut@nt" model = "HD2400" elif procmodel == "hd51": brand = "Mut@nt" model = "HD51" grabpip = 1 elif procmodel == "hd11": brand = "Mut@nt" model = "HD11" elif procmodel == "hd500c": brand = "Mut@nt" model = "HD500c" elif procmodel == "hd530c": brand = "Mut@nt" model = "HD530c" elif procmodel == "hd60": brand = "Mut@nt" model = "HD60" elif procmodel == "multibox": brand = "MaXytec" model = "Multibox" grabpip = 1 elif procmodel == "multiboxse": brand = "MaXitec" model = "MultiboxSE" grabpip = 1 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 procmodel == "spycat": brand = "Spycat" model = "Spycat" elif procmodel == "spycatmini": brand = "Spycat" model = "Spycat Mini" elif procmodel == "spycatminiplus": brand = "Spycat" model = "Spycat Mini+" elif procmodel == "spycat4kmini": brand = "Spycat" model = "spycat 4K Mini" elif procmodel == "vipercombo": brand = "Amiko" model = "ViperCombo" elif procmodel == "vipert2c": brand = "Amiko" model = "ViperT2C" elif procmodel == "vipercombohdd": brand = "Amiko" model = "ViperComboHDD" elif procmodel == "viperslim": brand = "Amiko" model = "Viper Slim" elif procmodel == "wetekplay": brand = "WeTeK" model = "Play" elif procmodel.startswith("os"): brand = "Edision" if procmodel == "osmini": model = "OS Mini" elif procmodel == "osminiplus": model = "OS Mini+" elif procmodel == "osmega": model = "OS Mega" elif procmodel == "osnino": model = "OS Nino" elif procmodel == "osninoplus": model = "OS Nino+" elif procmodel == "osninopro": model = "OS Nino Pro" elif procmodel == "osmio4k": model = "OS Mio 4K" grabpip = 1 elif procmodel == "osmio4kplus": model = "OS Mio 4K+" grabpip = 1 elif procmodel == "osmini4k": model = "OS Mini 4K" grabpip = 1 else: model = procmodel elif procmodel == "h3": brand = "Zgemma" model = "H3 series" elif procmodel == "h4": brand = "Zgemma" model = "H4 series" elif procmodel == "h5": brand = "Zgemma" model = "H5 series" elif procmodel == "h6": brand = "Zgemma" model = "H6 series" elif procmodel == "h7": brand = "Zgemma" model = "H7 series" grabpip = 1 elif procmodel == "h8": brand = "Zgemma" model = "H8 series" elif procmodel == "h9": brand = "Zgemma" model = "H9 series" grabpip = 1 elif procmodel == "lc": brand = "Zgemma" model = "LC" elif procmodel == "sh1": brand = "Zgemma" model = "Star series" elif procmodel == "i55": brand = "Zgemma" model = "i55" elif procmodel == "i55plus": brand = "Zgemma" model = "i55Plus" grabpip = 1 elif procmodel == "hzero": brand = "Zgemma" model = "Hzero" elif procmodel == "h8.2h": brand = "Zgemma" model = "H8.2H" elif procmodel == "h9.s": brand = "Zgemma" model = "H9.S" grabpip = 1 elif procmodel == "h9.t": brand = "Zgemma" model = "H9.T" grabpip = 1 elif procmodel == "h9.2h": brand = "Zgemma" model = "H9.2H" grabpip = 1 elif procmodel == "h9.2s": brand = "Zgemma" model = "H9.2S" grabpip = 1 elif procmodel == "h9 combo" or procmodel == "h9combo": procmodel = "h9combo" brand = "Zgemma" model = "H9 Combo" grabpip = 1 elif procmodel == "h9combose": procmodel = "h9combose" brand = "Zgemma" model = "H9 Combo SE" grabpip = 1 elif procmodel == "h9 twin" or procmodel == "h9twin": procmodel = "h9twin" brand = "Zgemma" model = "H9 Twin" grabpip = 1 elif procmodel == "h9twinse": procmodel = "h9twinse" brand = "Zgemma" model = "H9 Twin SE" grabpip = 1 elif procmodel == "h9se.s": brand = "Zgemma" model = "H9SE.S" grabpip = 1 elif procmodel == "h9se.2s": brand = "Zgemma" model = "H9SE.2S" grabpip = 1 elif procmodel == "h9se.2h": brand = "Zgemma" model = "H9.2H SE" grabpip = 1 elif procmodel == "h10.t": brand = "Zgemma" model = "H10 Combo" grabpip = 1 elif procmodel == "h10.2s": brand = "Zgemma" model = "H10.2S" grabpip = 1 elif procmodel == "h10.2h": brand = "Zgemma" model = "H10.2H" grabpip = 1 elif procmodel == "h11": brand = "Zgemma" model = "H11" grabpip = 1 elif procmodel == "vs1500": brand = "Vimastec" model = "vs1500" grabpip = 1 elif procmodel == "sf8008m": brand = "Octagon" model = "SF8008 4K Mini" elif procmodel.startswith("sf"): brand = "Octagon" if procmodel.startswith("sf8008"): sf8008type = open("/proc/stb/info/type").read() if sf8008type.startswith("11"): procmodel = "sf8008t" model = "SF8008 4K Twin" elif sf8008type.startswith("12"): procmodel = "sf8008c" model = "SF8008 4K Combo" else: # sf8008type.startswith("10") procmodel = "sf8008s" model = "SF8008 4K Single" else: model = procmodel.upper() elif procmodel == "e4hd": brand = "Axas" model = "E4HD" lcd = 1 grabpip = 1 elif procmodel == "ustym4kpro": brand = "uClan" model = "Ustym 4K Pro" elif procmodel == "pulse4k": brand = "AB-COM" model = "PULSe 4K" elif procmodel == "pulse4kmini": brand = "AB-COM" model = "PULSe 4K MINI" else: model = procmodel 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" if procmodel == "dm800": model = "DM800 HD PVR" elif procmodel == "dm800se": model = "DM800 HD se" elif procmodel == "dm500hd": model = "DM500 HD" elif procmodel == "dm7020hd": model = "DM7020 HD" elif procmodel == "dm820": model = "DM820 HD" elif procmodel == "dm7080": model = "DM7080 HD" elif procmodel == "dm520": model = "DM520 HD" elif procmodel == "dm525": model = "DM525 HD" elif procmodel == "dm900": model = "DM900 HD" grabpip = 1 elif procmodel == "dm920": model = "DM920 HD" grabpip = 1 else: 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 ("et9x00", "et9000", "et9100", "et9200", "et9500"): type = "et9x00" elif type in ("et6x00", "et6000"): type = "et6x00" elif type in ("et5x00", "et5000"): type = "et5x00" elif type in ("et4x00", "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 = "dmm1" if procmodel in ("vusolo", "vuduo", "vuuno", "vusolo2", "vusolose", "vuzero", "vusolo4k", "vuuno4k", "vuultimo4k"): remote = "vu_normal" elif procmodel == "vuduo2": remote = "vu_duo2" elif procmodel == "vuultimo": remote = "vu_ultimo" elif procmodel in ("vuuno4kse", "vuzero4k", "vuduo4k", "vuduo4kse"): remote = "vu_normal_02" 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", "et10000"): remote = "et8000" elif procmodel in ("et7x00", "et7000", "et7500"): remote = "et7x00" elif procmodel in ("et7000mini", "et11000"): remote = "et7000mini" elif procmodel == "gbquad": remote = "gigablue" elif procmodel == "gbquadplus": remote = "gbquadplus" elif procmodel in ("gbquad4k", "gbue4k", "quad4k", "ue4k", "gbtrio4k"): remote = "gb7252" elif procmodel in ("formuler1", "formuler3", "formuler4", "formuler4turbo"): 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 in ("mbtwinplus", "mbmicro", "mbmicrov2"): remote = "miraclebox2" elif procmodel == "alphatriplehd": remote = "alphatriplehd" 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", "hd1265", "hd1400", "hd51", "hd11", "hd500c", "hd530c"): remote = "hd1x00" elif procmodel == "hd2400": remote = "hd2400" elif procmodel == "hd60": remote = "hd60" elif procmodel in ("multibox", "multiboxse"): remote = "multibox" elif procmodel in ("spycat", "spycatmini", "spycatminiplus", "spycat4kmini"): remote = "spycat" 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", "dm520", "dm820", "dm900", "dm920"): remote = "dmm2" elif procmodel == "wetekplay": remote = procmodel elif procmodel.startswith("osm") and "4k" in procmodel: remote = "edision4" elif procmodel.startswith("osm"): remote = "osmini" elif procmodel.startswith("osninopr"): remote = "edision3" elif procmodel.startswith("osninopl"): remote = "edision2" elif procmodel.startswith("osn"): remote = "edision1" elif procmodel in ("fusionhd"): remote = procmodel elif procmodel in ("fusionhdse"): remote = procmodel elif procmodel in ("purehd", "purehdse"): remote = "purehd" elif procmodel in ("revo4k"): remote = procmodel elif procmodel in ("galaxy4k"): remote = procmodel elif procmodel in ("lunix3-4k", "lunix"): remote = "qviart" elif procmodel in ("lunix4k"): remote = "lunix4k" elif procmodel in ("dual"): remote = "dual" elif procmodel in ("sh1", "lc"): remote = "sh1" elif procmodel in ("hzero", "h3", "h4", "h5", "h6", "h7", "h8", "h9", "i55plus", "h8.2h", "h9.s", "h9.t", "h9.2h", "h9.2s", "h9combo", "h9combose", "h9twin", "h9twinse", "h9se.s", "h9se.2s", "h9se.2h", "h10.t", "h10.2s", "h10.2h", "h11"): remote = "h3" elif procmodel == "i55": remote = "i55" elif procmodel in ("vipercombo", "vipert2c"): remote = "amiko" elif procmodel in ("vipercombohdd"): remote = "amiko1" elif procmodel == "viperslim": remote = "viperslim" elif procmodel.startswith("sf"): remote = "octagon" elif procmodel in ("vs1100", "vs1500"): remote = "vs1x00" elif procmodel in ("e4hd"): remote = "e4hd" elif procmodel in ("ustym4kpro"): remote = "uclan" elif procmodel in ("pulse4k", "pulse4kmini"): remote = "pulse4k" info['remote'] = remote try: kernel = int(about.getKernelVersionString()[0]) except NameError: # when "about" is not available try: kernel = int( open("/proc/version", "r").read().split(' ', 4)[2].split('.', 2)[0]) except: # nosec # noqa: E722 # set a default kernel = 2 except ValueError: # getKernelVersionString is not a number kernel = 2 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/run/ggui"): distro = "Graterlia OS" imagever = "" # 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: # nosec # noqa: E722 pass if distro in ("openpli", "satdreamgr", "openvision", "openrsi"): oever = "PLi-OE" try: imagelist = open( "/etc/issue").readlines()[-2].split()[1].split('.') imagever = imagelist.pop(0) if imagelist: imagebuild = "".join(imagelist) else: # deal with major release versions only if imagever.isnumeric(): imagebuild = "0" except: # nosec # noqa: E722 # just in case pass else: try: imagever = about.getImageVersionString() except: # nosec # noqa: E722 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 > 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] # nosec except: # nosec # noqa: E722 try: driverdate = os.popen( '/usr/bin/opkg -V0 list_installed *dvb-proxy*').readline( ).split()[2] # nosec except: # nosec # noqa: E722 try: driverdate = os.popen( 'cat /var/lib/opkg/info/kernel-module-*.control | grep Version | cut -d "-" -f2' ).readline() # nosec except: # nosec # noqa: E722 pass re_search = re.search('([0-9]{8})', driverdate) if re_search is not None: driverdate = re_search.group(1) info['oever'] = oever info['distro'] = distro info['imagever'] = imagever info['imagebuild'] = imagebuild info['driverdate'] = driverdate info['lcd'] = distro in ("openpli", "satdreamgr", "openvision", "openrsi") and lcd or 0 info['grabpip'] = distro in ("openpli", "satdreamgr", "openvision", "openrsi") and grabpip or 0 return info
def __init__(self, session): Screen.__init__(self, session) self.setTitle(_("About")) hddsplit = skin.parameters.get("AboutHddSplit", 0) AboutText = _("Hardware: ") + about.getHardwareTypeString() + "\n" cpu = about.getCPUInfoString() AboutText += _("CPU: ") + cpu + "\n" AboutText += _("Image: ") + about.getImageTypeString() + "\n" AboutText += _("Build date: ") + about.getBuildDateString() + "\n" AboutText += _("Last update: ") + about.getUpdateDateString() + "\n" if SystemInfo["canMultiBoot"]: slot = image = getCurrentImage() bootmode = "" part = _("eMMC slot %s") %slot if "sda" in SystemInfo["canMultiBoot"][slot]['device']: if slot > 4: image -=4 else: image -=1 if getMachineBuild() in ("sf8008"): part = _("SD-card slot %s") % image else: part = _("USB-device slot %s") % image AboutText += _("Selected Image: %s") % _("STARTUP_") + str(slot) + " (" + part + ")\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 += _("Kernel version: ") + about.getKernelVersionString() + "\n" AboutText += _("DVB driver version: ") + about.getDriverInstalledDate() + "\n" GStreamerVersion = _("GStreamer version: ") + about.getGStreamerVersionString(cpu).replace("GStreamer","") self["GStreamerVersion"] = StaticText(GStreamerVersion) AboutText += GStreamerVersion + "\n" AboutText += _("Python version: ") + about.getPythonVersionString() + "\n" AboutText += _("Enigma (re)starts: %d\n") % config.misc.startCounter.value AboutText += _("Enigma debug level: %d\n") % eGetEnigmaDebugLvl() 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) skinWidth = getDesktop(0).size().width() skinHeight = getDesktop(0).size().height() AboutText += _("Skin Name: %s") % config.skin.primary_skin.value[0:-9] + _(" (%s x %s)") % (skinWidth, skinHeight) + "\n" if path.exists('/etc/enigma2/EtRcType'): rfp = open('/etc/enigma2/EtRcType', "r") Remote = rfp.read() rfp.close AboutText += _("Remote control type") + _(": ") + Remote + "\n" else: AboutText += _("Remote control type") + _(": ") + iRcTypeControl.getBoxType() + "\n" if path.exists('/proc/stb/ir/rc/type'): fp = open('/proc/stb/ir/rc/type', "r") RcID = fp.read() fp.close AboutText += _("Remote control ID") + _(": ") + RcID 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] AboutText += '\n\n' + _("Uptime") + ": " + about.getBoxUptime() self["AboutScrollLabel"] = ScrollLabel(AboutText) self["key_green"] = Button(_("Troubleshoot")) self["key_red"] = Button(_("Latest Commits")) self["key_yellow"] = Button(_("Memory Info")) self["key_blue"] = Button(_("%s ") % getMachineName() + _("picture")) self["actions"] = ActionMap(["ColorActions", "SetupActions", "DirectionActions", "ChannelSelectEPGActions"], { "cancel": self.close, "ok": self.close, "info": self.showTranslationInfo, "red": self.showCommits, "green": self.showTroubleshoot, "yellow": self.showMemoryInfo, "blue": self.showModelPic, "up": self["AboutScrollLabel"].pageUp, "down": self["AboutScrollLabel"].pageDown })
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() try: info['procmodel'] = getBoxProc() except: # noqa: E722 info['procmodel'] = None try: info['procmodeltype'] = getBoxProcType() except: # noqa: E722 info['procmodeltype'] = None try: info['lcd'] = getLcd() except: info['lcd'] = 0 try: info['grabpip'] = getGrabPip() except: info['grabpip'] = 0 cpu = about.getCPUInfoString() info['chipset'] = cpu info['cpubrand'] = about.getCPUBrand() info['cpuarch'] = about.getCPUArch() 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.getSTBUptime() info["webifver"] = OPENWEBIFVER info['imagedistro'] = boxbranding.getImageDistro() info['friendlyimagedistro'] = getFriendlyImageDistro() info['oever'] = boxbranding.getImageBuild() info['pliversion'] = boxbranding.getPliVersion() info['plirevision'] = boxbranding.getPliRevision() info['visionmodule'] = about.getVisionModule() info['enigmaver'] = getEnigmaVersionString() info['driverdate'] = about.getDriverInstalledDate() info['kernelver'] = about.getKernelVersionString() 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['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 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 file(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] is "": 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: streams = [] 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( timer.service_ref.getServiceName().replace( '\xc2\x86', '').replace('\xc2\x87', '')) 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) hddsplit, = skin.parameters.get("AboutHddSplit", (0, )) #AboutHddSplit = 0 #try: # hddsplit = skin.parameters.get("AboutHddSplit",(0))[0] #except: # hddsplit = AboutHddSplit if boxtype == 'gb800solo': BoxName = "GigaBlue HD 800SOLO" elif boxtype == 'gb800se': BoxName = "GigaBlue HD 800SE" elif boxtype == 'gb800ue': BoxName = "GigaBlue HD 800UE" elif boxtype == 'gbquad': BoxName = "GigaBlue HD Quad" elif boxtype == 'gbquadplus': BoxName = "GigaBlue HD Quadplus" elif boxtype == 'gb800seplus': BoxName = "GigaBlue HD 800SEplus" elif boxtype == 'gb800ueplus': BoxName = "GigaBlue HD 800UEplus" elif boxtype == 'gbipbox': BoxName = "GigaBlue IP Box" elif boxtype == 'gbultra': BoxName = "GigaBlue HD Ultra" elif boxtype == 'gbultraue': BoxName = "GigaBlue HD Ultra UE" elif boxtype == 'gbultrase': BoxName = "GigaBlue HD Ultra SE" elif boxtype == 'gbx1': BoxName = "GigaBlue X1" elif boxtype == 'tomcat': BoxName = "XCORE Tomcat" elif boxtype == 'quadbox2400': BoxName = "AX Quadbox HD2400" else: BoxName = about.getHardwareTypeString() ImageType = about.getImageTypeString() self["ImageType"] = StaticText(ImageType) AboutHeader = ImageType + " - " + BoxName self["AboutHeader"] = StaticText(AboutHeader) AboutText = AboutHeader + "\n" #AboutText += _("Hardware: ") + about.getHardwareTypeString() + "\n" #AboutText += _("CPU: ") + about.getCPUInfoString() + "\n" #AboutText += _("Installed: ") + about.getFlashDateString() + "\n" #AboutText += _("Image: ") + about.getImageTypeString() + "\n" KernelVersion = _( "Kernel version: ") + about.getKernelVersionString() + "\n" self["KernelVersion"] = StaticText(KernelVersion) AboutText += KernelVersion + "\n" EnigmaVersion = _("GUI Build: ") + about.getEnigmaVersionString() self["EnigmaVersion"] = StaticText(EnigmaVersion) AboutText += EnigmaVersion + "\n" AboutText += _( "Enigma (re)starts: %d\n") % config.misc.startCounter.value GStreamerVersion = _("GStreamer: ") + about.getGStreamerVersionString( ).replace("GStreamer", "") self["GStreamerVersion"] = StaticText(GStreamerVersion) AboutText += GStreamerVersion + "\n" FlashDate = _("Flashed: ") + about.getFlashDateString() self["FlashDate"] = StaticText(FlashDate) AboutText += FlashDate + "\n" ImageVersion = _("Last upgrade: ") + about.getImageVersionString() self["ImageVersion"] = StaticText(ImageVersion) AboutText += ImageVersion + "\n" AboutText += _("DVB drivers: ") + about.getDriverInstalledDate() + "\n" AboutText += _( "Python version: ") + about.getPythonVersionString() + "\n" fp_version = getFPVersion() if fp_version is None: fp_version = "" else: fp_version = _("Frontprocessor version: %d") % fp_version AboutText += fp_version + "\n" self["FPVersion"] = StaticText(fp_version) self["TunerHeader"] = StaticText(_("Detected NIMs:")) AboutText += "\n" + _("Detected NIMs:") + "\n" nims = nimmanager.nimList() 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, "G", _("free")) else: hddinfo += formatstring % (hdd.model(), hdd.capacity(), hdd.free() / 1024, "M", _("free")) else: hddinfo = _("none") self["hddA"] = StaticText(hddinfo) AboutText += hddinfo self["AboutScrollLabel"] = ScrollLabel(AboutText) self["key_green"] = Button(_("Translations")) self["key_red"] = Button(_("Latest Commits")) self["key_blue"] = Button(_("Memory Info")) self["actions"] = ActionMap( ["SetupActions", "ColorActions", "DirectionActions"], { "cancel": self.close, "ok": self.close, #"red": self.showCommits, #"green": self.showTranslationInfo, "blue": self.showMemoryInfo, "up": self["AboutScrollLabel"].pageUp, "down": self["AboutScrollLabel"].pageDown })
def getAboutText(): AboutText = "" AboutText += _("Model:\t%s %s\n") % (getMachineBrand(), getMachineName()) if path.exists('/proc/stb/info/chipset'): AboutText += _("Chipset:\t%s") % about.getChipSetString() + "\n" cpuMHz = "" if getBoxType() in ('vusolo4k'): cpuMHz = " (1,5 GHz)" else: 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('cpu MHz'): #cpuMHz = " (" + lisp[1].replace('\n', '') + " MHz)" cpuMHz = " (" + str(int(float(lisp[1].replace('\n', '')))) + " MHz)" break except: pass AboutText += _("CPU:\t%s") % about.getCPUString() + cpuMHz + "\n" AboutText += _("Cores:\t%s") % about.getCpuCoresString() + "\n" AboutText += _("Version:\t%s") % getImageVersion() + "\n" AboutText += _("Build:\t%s") % getImageBuild() + "\n" AboutText += _("Kernel:\t%s") % about.getKernelVersionString() + "\n" string = getDriverDate() year = string[0:4] month = string[4:6] day = string[6:8] driversdate = '-'.join((year, month, day)) AboutText += _("Drivers:\t%s") % driversdate + "\n" AboutText += _("GStreamer:\t%s") % about.getGStreamerVersionString() + "\n" AboutText += _("Python:\t%s") % about.getPythonVersionString() + "\n" AboutText += _("Installed:\t%s") % about.getFlashDateString() + "\n" AboutText += _("Last update:\t%s") % getEnigmaVersionString() + "\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 getAboutText(): AboutText = '' AboutText += _('Model:\t%s %s\n') % (getMachineBrand(), getMachineName()) if path.exists('/proc/stb/info/chipset'): AboutText += _('Chipset:\t%s') % about.getChipSetString() + '\n' cpuMHz = '' if getBoxType() in 'vusolo4k': cpuMHz = ' (1,5 GHz)' elif 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('cpu MHz'): cpuMHz = ' (' + str(int(float(lisp[1].replace( '\n', '')))) + ' MHz)' break except: pass AboutText += _('CPU:\t%s') % about.getCPUString() + cpuMHz + '\n' AboutText += _('Cores:\t%s') % about.getCpuCoresString() + '\n' AboutText += _('Version:\t%s') % getImageVersion() + '\n' AboutText += _('Build:\t%s') % getImageBuild() + '\n' AboutText += _('Kernel:\t%s') % about.getKernelVersionString() + '\n' string = getDriverDate() year = string[0:4] month = string[4:6] day = string[6:8] driversdate = '-'.join((year, month, day)) AboutText += _('Drivers:\t%s') % driversdate + '\n' AboutText += _('GStreamer:\t%s') % about.getGStreamerVersionString() + '\n' AboutText += _('Python:\t%s') % about.getPythonVersionString() + '\n' AboutText += _('Skin name:\t%s\n') % config.skin.primary_skin.value[0:-9] AboutText += _('Installed:\t%s') % about.getFlashDateString() + '\n' AboutText += _('Last update:\t%s') % getEnigmaVersionString() + '\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 imageInfo(self): AboutText = _("openHDF Full-Image Backupscript") AboutText += _("Support at") + " www.hdfreaks.cc\n\n" AboutText += _("[Image Info]\n") AboutText += _("Model: %s %s\n") % (getMachineBrand(), getMachineName()) AboutText += _("Backup Date: %s\n") % strftime("%Y-%m-%d", localtime(self.START)) if path.exists('/proc/stb/info/chipset'): AboutText += _("Chipset: BCM%s") % about.getChipSetString().lower( ).replace('\n', '').replace('bcm', '') + "\n" AboutText += _("CPU: %s") % about.getCPUString() + "\n" AboutText += _("Cores: %s") % about.getCpuCoresString() + "\n" AboutText += _("Version: %s") % getImageVersion() + "\n" AboutText += _("Build: %s") % getImageBuild() + "\n" AboutText += _("Kernel: %s") % about.getKernelVersionString() + "\n" string = getDriverDate() year = string[0:4] month = string[4:6] day = string[6:8] driversdate = '-'.join((year, month, day)) AboutText += _("Drivers:\t%s") % driversdate + "\n" AboutText += _("Last update:\t%s") % getEnigmaVersionString() + "\n\n" AboutText += _("[Enigma2 Settings]\n") AboutText += commands.getoutput("cat /etc/enigma2/settings") AboutText += _("\n\n[User - bouquets (TV)]\n") try: f = open("/etc/enigma2/bouquets.tv", "r") lines = f.readlines() f.close() for line in lines: if line.startswith("#SERVICE:"): bouqet = line.split() if len(bouqet) > 3: bouqet[3] = bouqet[3].replace('"', '') f = open("/etc/enigma2/" + bouqet[3], "r") userbouqet = f.readline() AboutText += userbouqet.replace('#NAME ', '') f.close() except: AboutText += "Error reading bouquets.tv" AboutText += _("\n[User - bouquets (RADIO)]\n") try: f = open("/etc/enigma2/bouquets.radio", "r") lines = f.readlines() f.close() for line in lines: if line.startswith("#SERVICE:"): bouqet = line.split() if len(bouqet) > 3: bouqet[3] = bouqet[3].replace('"', '') f = open("/etc/enigma2/" + bouqet[3], "r") userbouqet = f.readline() AboutText += userbouqet.replace('#NAME ', '') f.close() except: AboutText += "Error reading bouquets.radio" AboutText += _("\n[Installed Plugins]\n") AboutText += commands.getoutput( "opkg list_installed | grep enigma2-plugin-") return AboutText
def __init__(self, session): Screen.__init__(self, session) self.setTitle(_("About")) OpenNFRVersion = _("OpenNFR %s") % about.getImageVersionString() self["OpenNFRVersion"] = Label(OpenNFRVersion) AboutText = _("Model:\t\t%s %s\n") % (getMachineBrand(), getMachineName()) bootloader = "" if path.exists('/sys/firmware/devicetree/base/bolt/tag'): f = open('/sys/firmware/devicetree/base/bolt/tag', 'r') bootloader = f.readline().replace('\x00', '').replace('\n', '') f.close() AboutText += _("Bootloader:\t\t%s\n") % (bootloader) if path.exists('/proc/stb/info/chipset'): AboutText += _( "Chipset:\t\tBCM%s") % about.getChipSetString() + "\n" cpuMHz = "" if getMachineBuild() in ('u41', 'u42', 'u43'): cpuMHz = _(" (1.0 GHz)") elif getMachineBuild() in ('dags72604', 'vusolo4k', 'vuultimo4k', 'vuzero4k', 'gb72604'): cpuMHz = " (1,5 GHz)" elif getMachineBuild() in ('formuler1', 'triplex'): cpuMHz = " (1,3 GHz)" elif getMachineBuild() in ('gbmv200', 'u51', 'u5', 'u53', 'u52', 'u54', 'u55', 'u56', 'u5pvr', 'h9', 'h9combo', 'cc1', 'sf8008', 'hd60', 'hd61', 'i55plus', 'ustym4kpro', 'v8plus', 'multibox'): cpuMHz = " (1,6 GHz)" elif getMachineBuild() in ('vuuno4k', 'vuultimo4k', 'gb7252', 'dags7252', '8100s'): cpuMHz = " (1,7 GHz)" elif getMachineBuild() in ('alien5', 'u53'): cpuMHz = " (2,0 GHz)" elif getMachineBuild() in ('vuduo4k', ): cpuMHz = _(" (2.1 GHz)") elif getMachineBuild() in ('sf5008', 'et13000', 'et1x000', 'hd52', 'hd51', 'sf4008', 'vs1500', 'h7', 'osmio4k', 'osmio4kplus', 'osmini4k'): try: import binascii f = open( '/sys/firmware/devicetree/base/cpus/cpu@0/clock-frequency', 'rb') clockfrequency = f.read() f.close() cpuMHz = " (%s MHz)" % str( round( int(binascii.hexlify(clockfrequency), 16) / 1000000, 1)) except: cpuMHz = " (1,7 GHz)" else: 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('cpu MHz'): #cpuMHz = " (" + lisp[1].replace('\n', '') + " MHz)" cpuMHz = " (" + str( int(float(lisp[1].replace('\n', '')))) + " MHz)" break except: pass AboutText += _("CPU:\t\t%s") % about.getCPUString() + cpuMHz + "\n" AboutText += _("Cores:\t\t%s") % about.getCpuCoresString() + "\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() elif path.exists('/proc/stb/sensors/temp/value'): f = open('/proc/stb/sensors/temp/value', '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', '') + 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() elif path.exists('/proc/stb/power/avs'): f = open('/proc/stb/power/avs', 'r') tempinfo = f.read() f.close() elif path.exists('/sys/devices/virtual/thermal/thermal_zone0/temp'): try: f = open('/sys/devices/virtual/thermal/thermal_zone0/temp', 'r') tempinfo = f.read() tempinfo = tempinfo[:-4] f.close() except: tempinfo = "" elif path.exists('/proc/hisi/msp/pm_cpu'): try: for line in open('/proc/hisi/msp/pm_cpu').readlines(): line = [x.strip() for x in line.strip().split(":")] if line[0] in ("Tsensor"): temp = line[1].split("=") temp = line[1].split(" ") tempinfo = temp[2] except: tempinfo = "" if tempinfo and int(tempinfo.replace('\n', '')) > 0: mark = str('\xc2\xb0') AboutText += _("Processor temperature:\t%s") % tempinfo.replace( '\n', '').replace(' ', '') + mark + "C\n" imagestarted = "" bootname = '' if path.exists('/boot/bootname'): f = open('/boot/bootname', 'r') bootname = f.readline().split('=')[1] f.close() if SystemInfo["canMultiBoot"]: slot = image = GetCurrentImage() bootmode = "" part = "eMMC slot %s" % slot if SystemInfo["canMode12"]: bootmode = "bootmode = %s" % GetCurrentImageMode() if SystemInfo["HasHiSi"] and "sda" in SystemInfo["canMultiBoot"][ slot]['device']: if slot > 4: image -= 4 else: image -= 1 part = "SDcard slot %s (%s) " % ( image, SystemInfo["canMultiBoot"][slot]['device']) AboutText += _("Selected Image:\t\t%s") % _("STARTUP_") + str( slot) + " " + part + " " + bootmode + "\n" string = getDriverDate() year = string[0:4] month = string[4:6] day = string[6:8] driversdate = '-'.join((year, month, day)) AboutText += _("Drivers:\t\t%s") % driversdate + "\n" AboutText += _("Image:\t\t%s") % about.getImageVersionString() + "\n" AboutText += _("Build:\t\t%s") % getImageBuild() + "\n" AboutText += _( "Kernel: \t\t%s") % about.getKernelVersionString() + "\n" AboutText += _("Oe-Core:\t\t%s") % getOEVersion() + "\n" AboutText += _( "Enigma (re)starts:\t%d\n") % config.misc.startCounter.value AboutText += _( "GStreamer:\t\t%s") % about.getGStreamerVersionString() + "\n" AboutText += _("Python:\t\t%s") % about.getPythonVersionString() + "\n" fp_version = getFPVersion() if fp_version is None: fp_version = "" elif fp_version != 0: fp_version = _("Front Panel:\t\t%s") % fp_version AboutText += fp_version + "\n" else: fp_version = _("Front Panel:\t\tVersion unknown") AboutText += fp_version + "\n" if getMachineBuild() not in ('gbmv200', 'vuduo4k', 'v8plus', 'ustym4kpro', 'hd60', 'hd61', 'i55plus', 'osmio4k', 'osmio4kplus', 'h9', 'h9combo', 'vuzero4k', 'sf5008', 'et13000', 'et1x000', 'hd51', 'hd52', 'vusolo4k', 'vuuno4k', 'vuuno4kse', 'vuultimo4k', 'sf4008', 'dm820', 'dm7080', 'dm900', 'dm920', 'gb7252', 'dags7252', 'vs1500', 'h7', 'xc7439', '8100s', 'u41', 'u42', 'u43', 'u5', 'u5pvr', 'u52', 'u53', 'u54', 'u55', 'u56', 'u51', 'cc1', 'sf8008'): AboutText += _( "Installed:\t\t%s") % about.getFlashDateString() + "\n" AboutText += _( "Last Upgrade:\t\t%s") % about.getLastUpdateString() + "\n\n" self["FPVersion"] = StaticText(fp_version) AboutText += _("WWW:\t\t%s") % about.getImageUrlString() + "\n\n" AboutText += _( "based on:\t\t%s") % "www.github.com/oe-alliance" + "\n\n" # don't remove the string out of the _(), or it can't be "translated" anymore. # TRANSLATORS: Add here whatever should be shown in the "translator" about screen, up to 6 lines (use \n for newline) info = _("TRANSLATOR_INFO") if info == _("TRANSLATOR_INFO"): info = "" infolines = _("").split("\n") infomap = {} for x in infolines: l = x.split(': ') if len(l) != 2: continue (type, value) = l infomap[type] = value translator_name = infomap.get("Language-Team", "none") if translator_name == "none": translator_name = infomap.get("Last-Translator", "") self["FPVersion"] = StaticText(fp_version) self["TunerHeader"] = StaticText(_("Detected NIMs:")) nims = nimmanager.nimList() for count in range(len(nims)): if count < 4: self["Tuner" + str(count)] = StaticText(nims[count]) else: self["Tuner" + str(count)] = StaticText("") self["HDDHeader"] = StaticText(_("Detected HDD:")) hddlist = harddiskmanager.HDDList() hddinfo = "" if hddlist: for count in range(len(hddlist)): if hddinfo: hddinfo += "\n" hdd = hddlist[count][1] if int(hdd.free()) > 1024: hddinfo += "%s\n(%s, %d GB %s)" % ( hdd.model(), hdd.capacity(), hdd.free() / 1024, _("free")) else: hddinfo += "%s\n(%s, %d MB %s)" % ( hdd.model(), hdd.capacity(), hdd.free(), _("free")) else: hddinfo = _("none") self["hddA"] = StaticText(hddinfo) self["AboutScrollLabel"] = ScrollLabel(AboutText) self["actions"] = ActionMap( ["SetupActions", "ColorActions", "DirectionActions"], { "cancel": self.close, "ok": self.close, "green": self.showTranslationInfo, "up": self["AboutScrollLabel"].pageUp, "down": self["AboutScrollLabel"].pageDown })
def getAllInfo(): info = {} brand = "unknown" model = "unknown" procmodel = "unknown" orgdream = 0 if tpmloaded: orgdream = tpm_check() if fileExists("/proc/stb/info/hwmodel"): brand = "DAGS" 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") or procmodel.startswith("purehd") or procmodel.startswith("revo4k") or procmodel.startswith("galaxy4k")): 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", "PureHD") elif procmodel == "revo4k": model = procmodel.replace("revo4k", "Revo4K") elif procmodel == "galaxy4k": model = procmodel.replace("galaxy4k", "Galaxy4K") 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") and not fileExists("/proc/stb/info/boxtype"): 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"): if procmodel == "et7000mini": brand = "Galaxy Innovations" model = "ET-7000 Mini" elif procmodel == "et11000": brand = "Galaxy Innovations" model = "ET-11000" else: brand = "Xtrend" model = procmodel.upper() elif procmodel.startswith("xpeed"): brand = "Golden Interstar" model = procmodel elif procmodel.startswith("xp"): brand = "MaxDigital" model = procmodel.upper() elif procmodel.startswith("ixuss"): brand = "Medialink" model = procmodel.replace(" ", "") elif procmodel == "formuler4turbo": brand = "Formuler" model = "4 Turbo" elif procmodel.startswith("formuler"): brand = "Formuler" model = procmodel.replace("formuler","") elif procmodel.startswith("mbtwinplus"): brand = "Miraclebox" model = "Premium Twin+" elif procmodel.startswith("alphatriplehd"): brand = "SAB" model = "Alpha Triple HD" elif procmodel in ("7000s", "mbmicro"): procmodel = "mbmicro" brand = "Miraclebox" model = "Premium Micro" elif procmodel in ("7005s", "mbmicrov2"): procmodel = "mbmicrov2" brand = "Miraclebox" model = "Premium Micro v2" 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 == "hd1265": brand = "Mut@nt" model = "HD1265" elif procmodel == "hd2400": brand = "Mut@nt" model = "HD2400" elif procmodel == "hd51": brand = "Mut@nt" model = "HD51" elif procmodel == "hd11": brand = "Mut@nt" model = "HD11" elif procmodel == "hd500c": brand = "Mut@nt" model = "HD500c" elif procmodel == "hd530c": brand = "Mut@nt" model = "HD530c" 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 procmodel == "spycat": brand = "Spycat" model = "Spycat" elif procmodel == "spycatmini": brand = "Spycat" model = "Spycat Mini" elif procmodel == "spycatminiplus": brand = "Spycat" model = "Spycat Mini+" elif procmodel == "spycat4kmini": brand = "Spycat" model = "spycat 4K Mini" elif procmodel == "wetekplay": brand = "WeTeK" model = "Play" elif procmodel.startswith("osm"): brand = "Edision" if procmodel == "osmini": model = "OS Mini" elif procmodel == "osminiplus": model = "OS Mini+" elif procmodel == "osmega": model = "OS Mega" else: model = procmodel elif procmodel == "h3": brand = "Zgemma" model = "H3 series" elif procmodel == "h5": brand = "Zgemma" model = "H5 series" elif procmodel == "h7": brand = "Zgemma" model = "H7 series" elif procmodel == "lc": brand = "Zgemma" model = "LC" elif procmodel == "i55": brand = "Zgemma" model = "i55" elif procmodel == "vs1500": brand = "Vimastec" model = "vs1500" elif procmodel == "sf4008": brand = "Octagon" model = procmodel 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", "uno4k", "ultimo4k"): 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", "et10000"): remote = "et8000" elif procmodel in ("et7x00", "et7000", "et7500"): remote = "et7x00" elif procmodel in ("et7000mini", "et11000"): remote = "et7000mini" elif procmodel == "gbquad": remote = "gigablue" elif procmodel == "gbquadplus": remote = "gbquadplus" elif procmodel in ("formuler1", "formuler3", "formuler4", "formuler4turbo"): 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 in ("mbtwinplus", "mbmicro", "mbmicrov2"): remote = "miraclebox2" elif procmodel == "alphatriplehd": remote = "alphatriplehd" 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", "hd1265", "hd1400", "hd51", "hd11", "hd500c", "hd530c"): remote = "hd1x00" elif procmodel == "hd2400": remote = "hd2400" elif procmodel in ("spycat", "spycatmini", "spycatminiplus", "spycat4kmini"): remote = "spycat" 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 procmodel == "wetekplay": remote = procmodel elif procmodel.startswith("osm"): remote = "osmini" elif procmodel in ("fusionhd"): remote = procmodel elif procmodel in ("fusionhdse"): remote = procmodel elif procmodel in ("purehd"): remote = procmodel elif procmodel in ("revo4k"): remote = procmodel elif procmodel in ("galaxy4k"): remote = procmodel elif procmodel in ("sh1", "lc"): remote = "sh1" elif procmodel in ("h3", "h5", "h7"): remote = "h3" elif procmodel == "i55": remote = "i55" elif procmodel == "sf4008": remote = "octagon" elif procmodel in ("vs1100", "vs1500"): remote = "vs1x00" 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": oever = "PLi-OE" try: imagelist = open("/etc/issue").readlines()[-2].split()[1].split('.') imagever = imagelist.pop(0) if imagelist: imagebuild = "".join(imagelist) else: # deal with major release versions only if imagever.isnumeric(): imagebuild = "0" except: # just in case pass 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>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 __init__(self, session): Screen.__init__(self, session) self.setTitle(_("About")) hddsplit, = skin.parameters.get("AboutHddSplit", (0, )) AboutText = _("Hardware: ") + about.getHardwareTypeString() + "\n" AboutText += _("CPU: ") + about.getCPUInfoString() + "\n" AboutText += _("Image: ") + about.getImageTypeString() + "\n" AboutText += _("Installed: ") + about.getFlashDateString() + "\n" AboutText += _( "Kernel version: ") + about.getKernelVersionString() + "\n" EnigmaVersion = "Enigma: " + about.getEnigmaVersionString() self["EnigmaVersion"] = StaticText(EnigmaVersion) AboutText += EnigmaVersion + "\n" AboutText += _( "Enigma (re)starts: %d\n") % config.misc.startCounter.value GStreamerVersion = "GStreamer: " + about.getGStreamerVersionString( ).replace("GStreamer", "") self["GStreamerVersion"] = StaticText(GStreamerVersion) AboutText += GStreamerVersion + "\n" ImageVersion = _("Last upgrade: ") + about.getImageVersionString() self["ImageVersion"] = StaticText(ImageVersion) AboutText += ImageVersion + "\n" AboutText += _("DVB drivers: ") + about.getDriverInstalledDate() + "\n" AboutText += _( "Python version: ") + about.getPythonVersionString() + "\n" fp_version = getFPVersion() if fp_version is None: fp_version = "" else: fp_version = _("Frontprocessor version: %d") % fp_version AboutText += fp_version + "\n" self["FPVersion"] = StaticText(fp_version) self["TunerHeader"] = StaticText(_("Detected NIMs:")) AboutText += "\n" + _("Detected NIMs:") + "\n" nims = nimmanager.nimList() 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 self["AboutScrollLabel"] = ScrollLabel(AboutText) self["key_green"] = Button(_("Translations")) self["key_red"] = Button(_("Latest Commits")) 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, "up": self["AboutScrollLabel"].pageUp, "down": self["AboutScrollLabel"].pageDown })
def populate(self): self["lab1"] = StaticText(_("openHDF by HDF Image Team")) self["lab2"] = StaticText(_("Support at") + " www.HDFreaks.cc") model = None AboutText = "" self["lab2"] = StaticText(_("Support @") + " www.hdfreaks.cc") AboutText += _("Model:\t%s %s\n") % (getMachineBrand(), getMachineName()) if path.exists('/proc/stb/info/chipset'): AboutText += _("Chipset:\tBCM%s") % about.getChipSetString() + "\n" 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 = "" + res.replace("\n", "") + " MHz" if res2: bogoMIPS = "" + res2.replace("\n", "") AboutText += _("CPU:\t%s") % about.getCPUString() + "\n" AboutText += _("Clock Speed:\t%s") % cpuMHz + "\n" AboutText += _("BogoMIPS:\t%s") % bogoMIPS + "\n" AboutText += _("Cores:\t%s") % about.getCpuCoresString() + "\n" AboutText += _("HDF Version:\t%s") % getImageVersion() + "\n" AboutText += _("HDF Build:\t%s") % getImageBuild() + "\n" AboutText += _("Kernel:\t%s") % about.getKernelVersionString() + "\n" string = getDriverDate() year = string[0:4] month = string[4:6] day = string[6:8] driversdate = '-'.join((year, month, day)) AboutText += _("Drivers:\t%s") % driversdate + "\n" AboutText += _("Last update:\t%s") % getEnigmaVersionString() + "\n" AboutText += _( "GStreamer Ver:\t%s") % about.getGStreamerVersionString() + "\n" AboutText += _("Python Ver:\t%s\n") % about.getPythonVersionString() AboutText += _("Flashed:\t%s\n") % about.getFlashDateString() 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 Temp:\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 += _("CPU Temp:\t%s") % tempinfo.replace( '\n', '').replace(' ', '') + mark + "C\n" AboutLcdText = AboutText.replace('\t', ' ') self["AboutScrollLabel"] = ScrollLabel(AboutText)
def populate(self): self["lab1"] = StaticText(_("openHDF by HDF Image Team")) self["lab2"] = StaticText(_("Support at") + " www.HDFreaks.cc") model = None AboutText = "" self["lab2"] = StaticText(_("Support @") + " www.hdfreaks.cc") AboutText += _("Model:\t%s %s - OEM Model: %s\n") % (getMachineBrand(), getMachineName(), getBrandOEM()) if path.exists('/proc/stb/info/chipset'): AboutText += _("Chipset:\tBCM%s") % about.getChipSetString() + "\n" 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 = "" bootloader = "" if path.exists('/sys/firmware/devicetree/base/bolt/tag'): f = open('/sys/firmware/devicetree/base/bolt/tag', 'r') bootloader = f.readline().replace('\x00', '').replace('\n', '') f.close() BootLoaderVersion = 0 try: if bootloader: AboutText += _("Bootloader:\t%s\n") % (bootloader) BootLoaderVersion = int(bootloader[1:]) except: BootLoaderVersion = 0 if getMachineBuild() in ('vusolo4k'): cpuMHz = " (1,5 GHz)" elif getMachineBuild() in ('vuuno4k','dm900','gb7252','dags7252'): cpuMHz = " (1,7 GHz)" elif getMachineBuild() in ('formuler1tc','formuler1','triplex'): cpuMHz = " (1,3 GHz)" elif getMachineBuild() in ('u5','u51','u52','u53','u5pvr','h9'): cpuMHz = " (1,6 GHz)" elif getMachineBuild() in ('et1x000','hd52','hd51','sf4008','vs1500','h7','8100s'): try: import binascii f = open('/sys/firmware/devicetree/base/cpus/cpu@0/clock-frequency', 'rb') clockfrequency = f.read() f.close() cpuMHz = "%s MHz" % str(round(int(binascii.hexlify(clockfrequency), 16)/1000000,1)) except: cpuMHz = "1,7 GHz" else: 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('cpu MHz'): #cpuMHz = " (" + lisp[1].replace('\n', '') + " MHz)" cpuMHz = " (" + str(int(float(lisp[1].replace('\n', '')))) + " MHz)" break except: pass bogoMIPS = "" if res: cpuMHz = "" + res.replace("\n", "") + " MHz" if res2: bogoMIPS = "" + res2.replace("\n", "") if getMachineBuild() in ('vusolo4k','hd51','hd52','sf4008','dm900','h7','gb7252','8100s'): AboutText += _("CPU:\t%s") % about.getCPUString() + cpuMHz + "\n" else: AboutText += _("CPU:\t%s") % about.getCPUString() + " " + cpuMHz + "\n" dMIPS = 0 if getMachineBuild() in ('vusolo4k'): dMIPS = "10.500" elif getMachineBuild() in ('hd52','hd51','sf4008','dm900','h7','gb7252','8100s'): dMIPS = "12.000" if getMachineBuild() in ('vusolo4k','hd51','hd52','sf4008','dm900','h7','gb7252','8100s'): AboutText += _("DMIPS:\t") + dMIPS + "\n" else: AboutText += _("BogoMIPS:\t%s") % bogoMIPS + "\n" AboutText += _("Cores:\t%s") % about.getCpuCoresString() + "\n" AboutText += _("HDF Version:\tV%s") % getImageVersion() + " Build #" + getImageBuild() + " based on " + getOEVersion() + "\n" AboutText += _("Kernel (Box):\t%s") % about.getKernelVersionString() + " (" + getBoxType() + ")" + "\n" imagestarted = "" bootname = '' if path.exists('/boot/bootname'): f = open('/boot/bootname', 'r') bootname = f.readline().split('=')[1] f.close() if path.exists('/boot/STARTUP'): f = open('/boot/STARTUP', 'r') f.seek(22) image = f.read(1) f.close() if bootname: bootname = " (%s)" %bootname AboutText += _("Image started:\t%s") % "STARTUP_" + image + bootname + "\n" string = getDriverDate() year = string[0:4] month = string[4:6] day = string[6:8] driversdate = '-'.join((year, month, day)) gstcmd = 'opkg list-installed | grep "gstreamer1.0 -" | cut -c 16-32' gstcmd2 = os.system(gstcmd) #return (gstcmd2) AboutText += _("Drivers:\t%s") % driversdate + "\n" #AboutText += _("GStreamer:\t%s") % gstcmd2 + "\n" AboutText += _("GStreamer:\t%s") % about.getGStreamerVersionString() + "\n" AboutText += _("Last update:\t%s") % getEnigmaVersionString() + " to Build #" + getImageBuild() + "\n" AboutText += _("Flashed:\t%s\n") % about.getFlashDateString() AboutText += _("Python:\t%s\n") % about.getPythonVersionString() AboutText += _("E2 (re)starts:\t%s\n") % config.misc.startCounter.value AboutText += _("Network:") for x in about.GetIPsFromNetworkInterfaces(): AboutText += "\t" + x[0] + ": " + x[1] + "\n" fp_version = getFPVersion() if fp_version is None: fp_version = "" elif fp_version != 0: fp_version = _("Frontprocessor:\tVersion %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() elif path.exists('/proc/stb/sensors/temp/value'): f = open('/proc/stb/sensors/temp/value', 'r') tempinfo = f.read() f.close() elif path.exists('/sys/devices/virtual/thermal/thermal_zone0/temp'): if getBoxType() in ('mutant51', 'ax51', 'zgemmah7', 'e4hdultra'): tempinfo = "" else: f = open('/sys/devices/virtual/thermal/thermal_zone0/temp', 'r') tempinfo = f.read() tempinfo = tempinfo[:-4] f.close() if tempinfo and int(tempinfo.replace('\n', '')) > 0: mark = str('\xc2\xb0') AboutText += _("System Temp:\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() elif path.exists('/sys/devices/virtual/thermal/thermal_zone0/temp'): try: f = open('/sys/devices/virtual/thermal/thermal_zone0/temp', 'r') tempinfo = f.read() tempinfo = tempinfo[:-4] f.close() except: tempinfo = "" if tempinfo and int(tempinfo.replace('\n', '')) > 0: mark = str('\xc2\xb0') AboutText += _("Processor Temp:\t%s") % tempinfo.replace('\n', '').replace(' ','') + mark + "C\n" AboutLcdText = AboutText.replace('\t', ' ') self["AboutScrollLabel"] = ScrollLabel(AboutText)
def populate(self): self["lab1"] = StaticText(_("Open Black Hole Image")) self["lab2"] = StaticText(_("By Bh Team")) model = None AboutText = "" self["lab3"] = StaticText(_("Support at") + " www.vuplus-community.net") AboutText += _("Model:\t%s %s\n") % (getMachineBrand(), getMachineName()) if about.getChipSetString() != _("unavailable"): if about.getIsBroadcom(): AboutText += _("Chipset:\tBCM%s\n") % about.getChipSetString().upper() else: AboutText += _("Chipset:\t%s\n") % about.getChipSetString().upper() AboutText += _("CPU:\t%s %s %s\n") % (about.getCPUArch(), about.getCPUSpeedString(), about.getCpuCoresString()) imageSubBuild = "" if getImageType() != 'release': imageSubBuild = ".%s" % getImageDevBuild() AboutText += _("Image:\t%s.%s%s (%s)\n") % (getImageVersion(), getImageBuild(), imageSubBuild, getImageType().title()) if SystemInfo["canMultiBoot"]: image = GetCurrentImage() bootmode = "" if SystemInfo["canMode12"]: bootmode = "bootmode = %s" %GetCurrentImageMode() AboutText += _("Image Slot:\t%s") % "STARTUP_" + str(image) + " " + bootmode + "\n" skinWidth = getDesktop(0).size().width() skinHeight = getDesktop(0).size().height() string = getDriverDate() year = string[0:4] month = string[4:6] day = string[6:8] driversdate = '-'.join((year, month, day)) AboutText += _("Drivers:\t%s\n") % driversdate AboutText += _("Kernel:\t%s\n") % about.getKernelVersionString() AboutText += _("GStreamer:\t%s\n") % about.getGStreamerVersionString().replace("GStreamer ","") AboutText += _("Python:\t%s\n") % about.getPythonVersionString() AboutText += _("Installed:\t%s\n") % about.getFlashDateString() AboutText += _("Last update:\t%s\n") % getEnigmaVersionString() AboutText += _("E2 (re)starts:\t%s\n") % config.misc.startCounter.value AboutText += _("Skin:\t%s") % config.skin.primary_skin.value[0:-9] + _(" (%s x %s)") % (skinWidth, skinHeight) + "\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() elif path.exists('/proc/stb/sensors/temp/value'): f = open('/proc/stb/sensors/temp/value', 'r') tempinfo = f.read() f.close() if tempinfo and int(tempinfo.replace('\n', '')) > 0: mark = str('\xc2\xb0') AboutText += _("System temp:\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() elif path.exists('/sys/devices/virtual/thermal/thermal_zone0/temp'): try: f = open('/sys/devices/virtual/thermal/thermal_zone0/temp', 'r') tempinfo = f.read() tempinfo = tempinfo[:-4] f.close() except: tempinfo = "" if tempinfo and int(tempinfo.replace('\n', '')) > 0: mark = str('\xc2\xb0') AboutText += _("Processor temp:\t%s") % tempinfo.replace('\n', '').replace(' ','') + mark + "C\n" AboutLcdText = AboutText.replace('\t', ' ') fp_version = getFPVersion() if fp_version is None: fp_version = "" elif fp_version != 0: fp_version = _("FP version:\t%s") % fp_version AboutText += fp_version + "\n" bootloader = "" if path.exists('/sys/firmware/devicetree/base/bolt/tag'): f = open('/sys/firmware/devicetree/base/bolt/tag', 'r') bootloader = f.readline().replace('\x00', '').replace('\n', '') f.close() AboutText += _("Bootloader:\t%s\n") % (bootloader) self["AboutScrollLabel"] = ScrollLabel(AboutText)
def getAboutText(): AboutText = "" AboutText += _("Model:\t\t%s %s\n") % (getMachineBrand(), getMachineName()) AboutText += _("OEM Model:\t\t%s\n") % getMachineBuild() bootloader = "" if path.exists('/sys/firmware/devicetree/base/bolt/tag'): f = open('/sys/firmware/devicetree/base/bolt/tag', 'r') bootloader = f.readline().replace('\x00', '').replace('\n', '') f.close() AboutText += _("Bootloader:\t\t%s\n") % (bootloader) if path.exists('/proc/stb/info/chipset'): AboutText += _("Chipset:\t\t%s") % about.getChipSetString() + "\n" cpuMHz = "" if getMachineBuild() in ('u41', 'u42', 'u43'): cpuMHz = _(" (1.0 GHz)") elif getMachineBuild() in ('dags72604', 'vusolo4k', 'vuultimo4k', 'vuzero4k', 'gb72604'): cpuMHz = _(" (1.5 GHz)") elif getMachineBuild() in ('formuler1tc', 'formuler1', 'triplex', 'tiviaraplus'): cpuMHz = _(" (1.3 GHz)") elif getMachineBuild() in ('gbmv200', 'u51', 'u5', 'u53', 'u532', 'u533', 'u52', 'u54', 'u55', 'u56', 'u5pvr', 'h9', 'h9combo', 'h10', 'cc1', 'sf8008', 'hd60', 'hd61', 'i55plus', 'ustym4kpro', 'beyonwizv2', 'viper4k', 'v8plus', 'multibox'): cpuMHz = _(" (1.6 GHz)") elif getMachineBuild() in ('vuuno4kse', 'vuuno4k', 'dm900', 'dm920', 'gb7252', 'dags7252', 'xc7439', '8100s'): cpuMHz = _(" (1.7 GHz)") elif getMachineBuild() in ('alien5', ): cpuMHz = _(" (2.0 GHz)") elif getMachineBuild() in ('vuduo4k', ): cpuMHz = _(" (2.1 GHz)") elif getMachineBuild() in ('sf5008', 'et13000', 'et1x000', 'hd52', 'hd51', 'sf4008', 'vs1500', 'h7', 'osmio4k', 'osmio4kplus'): try: import binascii f = open( '/sys/firmware/devicetree/base/cpus/cpu@0/clock-frequency', 'rb') clockfrequency = f.read() f.close() cpuMHz = _(" (%s MHz)") % str( round(int(binascii.hexlify(clockfrequency), 16) / 1000000, 1)) except: cpuMHz = _(" (1.7 GHz)") else: 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('cpu MHz'): #cpuMHz = " (" + lisp[1].replace('\n', '') + " MHz)" cpuMHz = " (" + str( int(float(lisp[1].replace('\n', '')))) + " MHz)" break except: pass AboutText += _("CPU:\t\t%s") % about.getCPUString() + cpuMHz + "\n" AboutText += _("Cores:\t\t%s") % about.getCpuCoresString() + "\n" imagestarted = "" bootname = '' if path.exists('/boot/bootname'): f = open('/boot/bootname', 'r') bootname = f.readline().split('=')[1] f.close() if SystemInfo["HasRootSubdir"]: image = find_rootfssubdir("STARTUP") AboutText += _("Selected Image:\t\t%s") % _( "STARTUP_") + image[-1:] + bootname + "\n" elif getMachineBuild() in ('gbmv200', 'cc1', 'sf8008', 'ustym4kpro', 'beyonwizv2', "viper4k"): if path.exists('/boot/STARTUP'): f = open('/boot/STARTUP', 'r') f.seek(5) image = f.read(4) if image == "emmc": image = "1" elif image == "usb0": f.seek(13) image = f.read(1) if image == "1": image = "2" elif image == "3": image = "3" elif image == "5": image = "4" elif image == "7": image = "5" f.close() if bootname: bootname = " (%s)" % bootname AboutText += _("Selected Image:\t\t%s") % _( "STARTUP_") + image + bootname + "\n" elif getMachineBuild() in ('osmio4k', 'osmio4kplus'): if path.exists('/boot/STARTUP'): f = open('/boot/STARTUP', 'r') f.seek(38) image = f.read(1) f.close() if bootname: bootname = " (%s)" % bootname AboutText += _("Selected Image:\t\t%s") % _( "STARTUP_") + image + bootname + "\n" elif path.exists('/boot/STARTUP'): f = open('/boot/STARTUP', 'r') f.seek(22) image = f.read(1) f.close() if bootname: bootname = " (%s)" % bootname AboutText += _("Selected Image:\t\t%s") % _( "STARTUP_") + image + bootname + "\n" elif path.exists('/boot/cmdline.txt'): f = open('/boot/cmdline.txt', 'r') f.seek(38) image = f.read(1) f.close() if bootname: bootname = " (%s)" % bootname AboutText += _("Selected Image:\t\t%s") % _( "STARTUP_") + image + bootname + "\n" AboutText += _("Version:\t\t%s") % getImageVersion() + "\n" AboutText += _("Build:\t\t%s") % getImageBuild() + "\n" AboutText += _("Kernel:\t\t%s") % about.getKernelVersionString() + "\n" string = getDriverDate() year = string[0:4] month = string[4:6] day = string[6:8] driversdate = '-'.join((year, month, day)) AboutText += _("Drivers:\t\t%s") % MyDateConverter(driversdate) + "\n" AboutText += _( "GStreamer:\t\t%s") % about.getGStreamerVersionString() + "\n" AboutText += _("Python:\t\t%s") % about.getPythonVersionString() + "\n" if getMachineBuild() not in ('gbmv200', 'vuduo4k', 'v8plus', 'ustym4kpro', 'beyonwizv2', 'viper4k', 'hd60', 'hd61', 'i55plus', 'osmio4k', 'osmio4kplus', 'h9', 'h9combo', 'h10', 'vuzero4k', 'sf5008', 'et13000', 'et1x000', 'hd51', 'hd52', 'vusolo4k', 'vuuno4k', 'vuuno4kse', 'vuultimo4k', 'sf4008', 'dm820', 'dm7080', 'dm900', 'dm920', 'gb7252', 'dags7252', 'vs1500', 'h7', 'xc7439', '8100s', 'u5', 'u5pvr', 'u52', 'u53', 'u532', 'u533', 'u54', 'u55', 'u56', 'u51', 'cc1', 'sf8008'): AboutText += _("Installed:\t\t%s") % about.getFlashDateString() + "\n" AboutText += _("Last update:\t\t%s") % MyDateConverter( getEnigmaVersionString()) + "\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() elif path.exists('/proc/stb/sensors/temp/value'): f = open('/proc/stb/sensors/temp/value', '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() elif path.exists('/proc/stb/power/avs'): f = open('/proc/stb/power/avs', 'r') tempinfo = f.read() f.close() elif path.exists('/sys/devices/virtual/thermal/thermal_zone0/temp'): try: f = open('/sys/devices/virtual/thermal/thermal_zone0/temp', 'r') tempinfo = f.read() tempinfo = tempinfo[:-4] f.close() except: tempinfo = "" elif path.exists('/proc/hisi/msp/pm_cpu'): try: for line in open('/proc/hisi/msp/pm_cpu').readlines(): line = [x.strip() for x in line.strip().split(":")] if line[0] in ("Tsensor"): temp = line[1].split("=") temp = line[1].split(" ") tempinfo = temp[2] if getMachineBuild() in ('u41', 'u42', 'u43'): tempinfo = str(int(tempinfo) - 15) except: tempinfo = "" 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 __init__(self, session): Screen.__init__(self, session) AboutText = _("Hardware: ") + about.getHardwareTypeString() + "\n" AboutText += _("Image: ") + about.getImageTypeString() + "\n" AboutText += _( "Kernel Version: ") + about.getKernelVersionString() + "\n" EnigmaVersion = "Enigma: " + about.getEnigmaVersionString() self["EnigmaVersion"] = StaticText(EnigmaVersion) AboutText += EnigmaVersion + "\n" ImageVersion = _("Last Upgrade: ") + about.getImageVersionString() self["ImageVersion"] = StaticText(ImageVersion) AboutText += ImageVersion + "\n" fp_version = getFPVersion() if fp_version is None: fp_version = "" else: fp_version = _("Frontprocessor version: %d") % fp_version AboutText += fp_version + "\n" self["FPVersion"] = StaticText(fp_version) self["TunerHeader"] = StaticText(_("Detected NIMs:")) AboutText += "\n" + _("Detected NIMs:") + "\n" nims = nimmanager.nimList() 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: for count in range(len(hddlist)): if hddinfo: hddinfo += "\n" hdd = hddlist[count][1] if int(hdd.free()) > 1024: hddinfo += "%s\n(%s, %d GB %s)" % ( hdd.model(), hdd.capacity(), hdd.free() / 1024, _("free")) else: hddinfo += "%s\n(%s, %d MB %s)" % ( hdd.model(), hdd.capacity(), hdd.free(), _("free")) else: hddinfo = _("none") self["hddA"] = StaticText(hddinfo) AboutText += hddinfo self["AboutScrollLabel"] = ScrollLabel(AboutText) self["actions"] = ActionMap( ["SetupActions", "ColorActions", "DirectionActions"], { "cancel": self.close, "ok": self.close, "green": self.showTranslationInfo, "up": self["AboutScrollLabel"].pageUp, "down": self["AboutScrollLabel"].pageDown })