def populate2(self): self.activityTimer.stop() self.Console = Console() niminfo = "" nims = nimmanager.nimList() for count in range(len(nims)): if niminfo: niminfo += "\n" niminfo += nims[count] self["nims"].setText(niminfo) 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 (%s, %d GB %s)" % (hdd.model(), hdd.capacity(), hdd.free()/1024, _("free")) else: hddinfo += "%s (%s, %d MB %s)" % (hdd.model(), hdd.capacity(), hdd.free(), _("free")) else: hddinfo = _("none") self["hdd"].setText(hddinfo) self.mountinfo = "" f = open('/proc/mounts', 'r') for line in f.readlines(): self.parts = line.strip().split() if self.parts[0] and (self.parts[0].startswith('192') or self.parts[0].startswith('//192')): self.Console.ePopen("df -mh " + self.parts[1] + " | grep -v '^Filesystem'", self.Stage1Complete) else: self["mounts"].setText(_('none')) f.close()
def getTunerName(self): nr = self.getCurrentTuner() if nr is not None: from Components.NimManager import nimmanager nims = nimmanager.nimList() return str(nims[nr].split(':')[:1][0].split(' ')[1]) return ""
def __init__(self, session): Screen.__init__(self, session) MEVer = 'Mediasat' f = open('/etc/MEversion', 'r') MEVer = f.readline().strip() f.close() MERev = '' f = open('/etc/MErev', 'r') MERev = f.readline().strip() f.close() self['EnigmaVersion'] = StaticText('Firmware: ' + MEVer + ' ' + MERev) self['ImageVersion'] = StaticText('Build: ' + about.getEnigmaVersionString()) self['DriverVersion'] = StaticText(_('DVB drivers: ') + self.getDriverInstalledDate()) self['KernelVersion'] = StaticText(_('Kernel version: ') + self.getKernelVersionString()) self['FPVersion'] = StaticText('Team Homesite: media-sat.net') self['Devlopement'] = StaticText('Coder: Redouane') 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 __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 populate2(self): self.activityTimer.stop() self.Console = Console() niminfo = '' nims = nimmanager.nimList() for count in range(len(nims)): if niminfo: niminfo += '\n' niminfo += nims[count] self['nims'].setText(niminfo) self.list = [] list2 = [] f = open('/proc/partitions', 'r') for line in f.readlines(): parts = line.strip().split() if not parts: continue device = parts[3] if not search('sd[a-z][1-9]', device): continue if device in list2: continue mount = '/dev/' + device f = open('/proc/mounts', 'r') for line in f.readlines(): if device in line: parts = line.strip().split() mount = str(parts[1]) break f.close() if not mount.startswith('/dev/'): size = Harddisk(device).diskSize() free = Harddisk(device).free() if float(size) / 1024 / 1024 >= 1: sizeline = _('Size: ') + str(round(float(size) / 1024 / 1024, 2)) + _('TB') elif size / 1024 >= 1: sizeline = _('Size: ') + str(round(float(size) / 1024, 2)) + _('GB') elif size >= 1: sizeline = _('Size: ') + str(size) + _('MB') else: sizeline = _('Size: ') + _('unavailable') if float(free) / 1024 / 1024 >= 1: freeline = _('Free: ') + str(round(float(free) / 1024 / 1024, 2)) + _('TB') elif free / 1024 >= 1: freeline = _('Free: ') + str(round(float(free) / 1024, 2)) + _('GB') elif free >= 1: freeline = _('Free: ') + str(free) + _('MB') else: freeline = _('Free: ') + _('full') self.list.append(mount + '\t' + sizeline + ' \t' + freeline) else: self.list.append(mount + '\t' + _('Not mounted')) list2.append(device) self.list = '\n'.join(self.list) self['hdd'].setText(self.list) self.Console.ePopen("df -mh | grep -v '^Filesystem'", self.Stage1Complete)
def populate2(self): self.activityTimer.stop() self.Console = Console() niminfo = "" nims = nimmanager.nimList() for count in range(len(nims)): if niminfo: niminfo += "\n" niminfo += nims[count] self["nims"].setText(niminfo) self.list = [] list2 = [] f = open("/proc/partitions", "r") for line in f.readlines(): parts = line.strip().split() if not parts: continue device = parts[3] if not search("sd[a-z][1-9]", device): continue if device in list2: continue mount = "/dev/" + device f = open("/proc/mounts", "r") for line in f.readlines(): if device in line: parts = line.strip().split() mount = str(parts[1]) break f.close() if not mount.startswith("/dev/"): size = Harddisk(device).diskSize() free = Harddisk(device).free() if float(size) / 1024 / 1024 >= 1: sizeline = _("Size: ") + str(round(float(size) / 1024 / 1024, 2)) + _("TB") elif size / 1024 >= 1: sizeline = _("Size: ") + str(round(float(size) / 1024, 2)) + _("GB") elif size >= 1: sizeline = _("Size: ") + str(size) + _("MB") else: sizeline = _("Size: ") + _("unavailable") if float(free) / 1024 / 1024 >= 1: freeline = _("Free: ") + str(round(float(free) / 1024 / 1024, 2)) + _("TB") elif free / 1024 >= 1: freeline = _("Free: ") + str(round(float(free) / 1024, 2)) + _("GB") elif free >= 1: freeline = _("Free: ") + str(free) + _("MB") else: freeline = _("Free: ") + _("full") self.list.append(mount + "\t" + sizeline + " \t" + freeline) else: self.list.append(mount + "\t" + _("Not mounted")) list2.append(device) self.list = "\n".join(self.list) self["hdd"].setText(self.list) self.Console.ePopen("df -mh | grep -v '^Filesystem'", self.Stage1Complete)
def getTunerName(self): nr = self.getCurrentTuner() if nr is not None: nims = nimmanager.nimList() if nr < 4: return "".join(nims[nr].split(':')[:1]) return " ".join((_("Tuner"),str(nr))) return ""
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() # bhCod = "SODO" # f = open("/etc/bhcoder",'r') # bhVer = f.readline().strip() # f.close() self["EnigmaVersion"] = StaticText("Firmware: " + bhVer + " " + bhRev) # self["ImageVersion"] = StaticText("Image: " + about.getImageVersionString()) self["ImageVersion"] = StaticText("Build: " + about.getEnigmaVersionString()) driverdate = self.getDriverInstalledDate() if driverdate == "unknown": driverdate = self.getDriverInstalledDate_proxy() self["DriverVersion"] = StaticText(_("DVB drivers: ") + driverdate) self["KernelVersion"] = StaticText(_("Kernel version: ") + self.getKernelVersionString()) self["FPVersion"] = StaticText("Team Homesite: vuplus-community.net") # self["COder"] = StaticText("Devlopeur: " + bhCod) 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 getList(self): nims = [] for nim in nimmanager.nimList(): info = nim.split(":") nims.append(( info[0], info[1] )) return nims
def playService(self, service=None): if service: self.service = service self.session.nav.stopService() if self.service == "ch1": self.session.nav.playService(eServiceReference("1:0:1:F:1:9D:C00000:0:0:0:")) elif self.service == "ch2": self.session.nav.playService(eServiceReference("1:0:1:6:1:1:C00000:0:0:0:")) elif self.service == "ch3": if len(nimmanager.nimList()) == 2: self.session.nav.playService(eServiceReference("1:0:1:8:1:FFFF:C80FA0:0:0:0:")) else: self.session.nav.playService(eServiceReference("1:0:1:8:1:FFFF:C00FA0:0:0:0:")) elif self.service == "ch4": if len(nimmanager.nimList()) == 2: self.session.nav.playService(eServiceReference("1:0:1:2:1:1:C89034:0:0:0:")) else: self.session.nav.playService(eServiceReference("1:0:1:2:1:1:C00000:0:0:0:"))
def getTunerName(self): nr = self.getCurrentTuner() if nr is not None: nims = nimmanager.nimList() if nr < len(nims) and nr >= 0: return ''.join(nims[nr].split(':')[:1]) print '[Dish.py] bug hunting nr: %s\n' % nr print '[Dish.py] bug hunting nims:\n' print nims raise return ''
def getTunerName(self): nr = self.getCurrentTuner() if nr is not None: nims = nimmanager.nimList() if nr < len(nims) and nr >= 0: return "".join(nims[nr].split(':')[:1]) print "[Dish] getTunerName nr: %s\n" %nr print "[Dish] getTunerName nims:\n" print nims raise # return " ".join((_("Tuner"),str(nr))) return ""
def playService(self, service=None): if service: self.service = service self.session.nav.stopService() if self.service == "ch1": self.session.nav.playService(eServiceReference("1:0:1:1E:1:FFFF:C00FA0:0:0:0:")) elif self.service == "ch2": self.session.nav.playService(eServiceReference("1:0:1:7:15:800:C00000:0:0:0:")) elif self.service == "ch3": if len(nimmanager.nimList()) == 2: self.session.nav.playService(eServiceReference("1:0:1:8:1:FFFF:C80FA0:0:0:0:")) else: if len(nimmanager.nimList()) == 1: self.session.nav.playService(eServiceReference("1:0:1:1E:1:FFFF:C00FA0:0:0:0:")) if len(nimmanager.nimList()) == 3: self.session.nav.playService(eServiceReference("1:0:1:8:1:FFFF:C80FA0:0:0:0:")) elif self.service == "ch4": if len(nimmanager.nimList()) == 2: self.session.nav.playService(eServiceReference("1:0:1:2:15:800:C80000:0:0:0:")) else: if len(nimmanager.nimList()) == 1: self.session.nav.playService(eServiceReference("1:0:1:2:15:800:C80000:0:0:0:")) if len(nimmanager.nimList()) == 3: self.session.nav.playService(eServiceReference("1:0:1:2:15:800:C80000:0:0:0:")) elif self.service == "ch5": #self.session.nav.playService(eServiceReference("1:0:1:1005:1:601:FFFF0000:0:0:0:")) # Cable self.session.nav.playService(eServiceReference("1:0:1:113F:1003:233A:EEEE0000:0:0:0:")) # Terrestrial
def getTunerName(self): nr = self.getCurrentTuner() if nr is not None: from Components.NimManager import nimmanager nims = nimmanager.nimList() if nr < len(nims) and nr >= 0: return "".join(nims[nr].split(':')[:1]) print "[Dish.py] bug hunting nr: %s\n" %nr print "[Dish.py] bug hunting nims:\n" print nims raise # return " ".join((_("Tuner"),str(nr))) return ""
def __init__(self, session): Screen.__init__(self, session) self["EnigmaVersion"] = StaticText("Enigma2: " + about.getEnigmaVersionString()) self["ImageVersion"] = StaticText("Image: " + about.getImageVersionString()) self["TunerHeader"] = StaticText(_("Detected NIMs:")) fp_version = getFPVersion() if fp_version is None: fp_version = "" else: fp_version = _("Frontprocessor version: %d") % fp_version self["FPVersion"] = StaticText(fp_version) 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["IPHeader"] = StaticText(_("Current IP Address:")) iNetwork = resourcemanager.getResource("iNetwork") ifaces = iNetwork.getConfiguredAdapters() convertIP = lambda l: "%s.%s.%s.%s" % tuple(l) if l and len(l) == 4 else "0.0.0.0" ipA = _("none") if len(ifaces) > 0: iface = ifaces[0] ip = iNetwork.getAdapterAttribute(iface, "ip") name = iNetwork.getFriendlyAdapterName(iface) if ip != None: ipA = "%s (%s)" %(convertIP(ip), name) self["ipA"] = StaticText(ipA) self["actions"] = ActionMap(["SetupActions", "ColorActions"], { "cancel": self.close, "ok": self.close, "green": self.showTranslationInfo })
def __init__(self, session): Screen.__init__(self, session) self["EnigmaVersion"] = StaticText("Dreambox OS: " + about.getEnigmaVersionString()) self["ImageVersion"] = StaticText("Image: " + about.getImageVersionString()) self["TunerHeader"] = StaticText(_("Detected NIMs:")) fp_version = getFPVersion() if fp_version is None: fp_version = "" else: fp_version = _("Frontprocessor version: %d") % fp_version self["FPVersion"] = StaticText(fp_version) 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["IPHeader"] = StaticText(_("Current IP Address:")) ipA = _("none") services = eNetworkManager.getInstance().getServices() for service in services: ip = self.getServiceIP(service) name = service.name() if ip != None: ipA = "%s (%s)" %(ip, name) self["ipA"] = StaticText(ipA) self["actions"] = ActionMap(["SetupActions", "ColorActions"], { "cancel": self.close, "ok": self.close, "green": self.showTranslationInfo })
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: " + about.getEnigmaVersionString()) self["FPVersion"] = StaticText("DevloPeur: ST7TEAM") 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 mainInfo(self): listnims = "" self["Hardware"].text = about.getHardwareTypeString() self["Image"].text = about.getImageTypeString() self["Kernel"].text = about.getKernelVersionString() self["EnigmaVersion"].text = about.getImageVersionString() nims = nimmanager.nimList() for count in range(len(nims)): if count < 4: listnims += "%s\n" % nims[count] else: listnims += "\n" self["nim"].text = listnims try: drv = os.popen("opkg info *-dvb-modules") for line in drv: if line.find("Version:") > -1: self["driver"].text = line.split()[1] drv.close() except: self["driver"].text = " "
def generateInformation(): from os import popen from Tools.DreamboxHardware import getFPVersion from Components.Harddisk import harddiskmanager from Components.NimManager import nimmanager from Components.About import about def command(cmd): try: result = popen(cmd, "r").read().strip() return str(result) except: pass information = [ "kernel : %s\n"%(command("uname -a")) ,"version : %s (%s)\n"%(str(about.getImageVersionString()), str(about.getEnigmaVersionString())) ,"frontprocessor : %s\n"%(str(getFPVersion())) ,"frontend : %s\n"%(str(nimmanager.nimList())) ,"hdd info : %s\n"%(str(harddiskmanager.HDDList())) ,"network information : \n%s\n"%(command("ifconfig -a")) ] f = open("/tmp/machine.info", 'w') f.writelines(information) f.close()
def __init__(self, session): Screen.__init__(self, session) self["EnigmaVersion"] = StaticText("Version: " + about.getEnigmaVersionString()) self["ImageVersion"] = StaticText("Image: " + about.getImageVersionString()) self["TunerHeader"] = StaticText(_("Detected NIMs:")) fp_version = getFPVersion() if fp_version is None: fp_version = "" else: fp_version = _("Frontprocessor version: %d") % fp_version self["FPVersion"] = StaticText(fp_version) 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, "green": self.showTranslationInfo })
def mainInfo(self): listnims = "" package = 0 self["Hardware"].text = about.getHardwareTypeString() self["Image"].text = about.getImageTypeString() self["Kernel"].text = about.getKernelVersionString() self["EnigmaVersion"].text = about.getImageVersionString() nims = nimmanager.nimList() for count in range(len(nims)): if count < 4: listnims += "%s\n" % nims[count] else: listnims += "\n" self["nim"].text = listnims for line in open(self.status()): if line.find("-dvb-modules") > -1 and line.find("Package:") > -1: package = 1 if line.find("Version:") > -1 and package == 1: package = 0 try: self["driver"].text = line.split()[1] except: self["driver"].text = " " break
def __init__(self, session): Screen.__init__(self, session) try: f = open("/etc/bpversion", "r") name = f.readline().strip() f.close() except: name = "Black Pole" AboutText = _("Hardware: ") + about.getHardwareTypeString() + "\n" AboutText += _("Image: ") + about.getImageTypeString() + "\n" AboutText += _("Kernel Version: ") + about.getKernelVersionString() + "\n" EnigmaVersion = "Firmware: " + name self["EnigmaVersion"] = StaticText(EnigmaVersion) AboutText += EnigmaVersion + "\n" ImageVersion = "Team Homesite: vuplus-community.net" 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, }, )
def populate2(self): self.list = [] self.list.append(self.makeHeadingInfoEntry(_("Model:"), "%s %s" % (getMachineBrand(), getMachineName()))) self.list.append(self.makeEmptyEntry()) self.list.append(self.makeHeadingEntry(_("Detected Tuners:"))) nims = nimmanager.nimList() for count in range(min(len(nims), 4)): self.list.append(self.makeInfoEntry(*nims[count].split(": "))) self.list.append(self.makeEmptyEntry()) self.list.append(self.makeHeadingEntry(_("Detected HDDs and Volumes:"))) partitions = getPartitionNames() partitions.sort() mounts = getProcMounts() mountIndex = {} for m in mounts: x = m[0] if x.startswith('/dev/'): x = x[5:] mountIndex[x] = m self.mountinfo = [] for hddtup in harddiskmanager.HDDList(): hdd = hddtup[1] self.mountinfo.append(self.makeHDDEntry(hdd.dev_path, hdd.model(), self.sizeStr(hdd.diskSize()))) for part in [p for p in partitions if p.startswith(hdd.device)]: if part in mountIndex: mount = mountIndex[part] fs = mount[2] if fs: fs = fs.upper() else: fs = "Unknown" fsType = mount[2] if fsType in Devices.fsNameMap: fsType = Devices.fsNameMap[fsType] self.mountinfo += self.mountInfo(mount[0], mount[1], fsType) else: self.mountinfo.append(self.makeInfoEntry(part, _('Not mounted'))) if not self.mountinfo: self.mountinfo.append(self.makeHDDEntry(_('none'), '', '')) self.list += self.mountinfo self.mountinfo = [] self.list.append(self.makeEmptyEntry()) self.list.append(self.makeHeadingEntry(_("Network Servers:"))) for mount in [m for m in mounts if match(Devices.FSTABIPMATCH, m[0])]: self.mountinfo += self.mountInfo(mount[0], mount[1], mount[2].upper(), twoLines=True) try: for mountname in listdir('/media/autofs'): mountpoint = path.join('/media/autofs', mountname) self.mountinfo += self.mountInfo(mountpoint, mountpoint, 'AUTOFS', twoLines=True) except Exception, e: print "[Devices] find autofs mounts:", e
def __init__(self, session): Screen.__init__(self, session) if config.misc.boxtype.value == 'gb800solo': AboutText = _("Hardware: ") + " GigaBlue HD 800solo\n" elif config.misc.boxtype.value == 'gb800se': AboutText = _("Hardware: ") + " GigaBlue HD 800se\n" elif config.misc.boxtype.value == 'gb800ue': AboutText = _("Hardware: ") + " GigaBlue HD 800ue\n" elif config.misc.boxtype.value == 'gbquad': AboutText = _("Hardware: ") + " GigaBlue HD Quad\n" elif config.misc.boxtype.value == 'gbquadplus': AboutText = _("Hardware: ") + " GigaBlue HD Quad Plus\n" elif config.misc.boxtype.value == 'gb800seplus': AboutText = _("Hardware: ") + " GigaBlue HD 800se Plus\n" elif config.misc.boxtype.value == 'gb800ueplus': AboutText = _("Hardware: ") + " GigaBlue HD 800ue Plus\n" else: AboutText = _("Hardware: ") + about.getHardwareTypeString() + "\n" AboutText += _("Image: ") + about.getImageTypeString() + "\n" AboutText += _("Kernel version: ") + about.getKernelVersionString() + "\n" EnigmaVersion = "GUI Build: " + 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 })
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 == 'gbx3': BoxName = "GigaBlue X3" elif boxtype == 'spycat': BoxName = "XCORE Spycat" 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" CPUinfo = _("CPU: ") + about.getCPUInfoString() + "\n" self["CPUinfo"] = StaticText(CPUinfo) AboutText += CPUinfo + "\n" CPUspeed = _("Speed: ") + about.getCPUSpeedString() + "\n" self["CPUspeed"] = StaticText(CPUspeed) AboutText += CPUspeed + "\n" ChipsetInfo = _("Chipset: ") + about.getChipSetString() + "\n" self["ChipsetInfo"] = StaticText(ChipsetInfo) AboutText += ChipsetInfo + "\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(["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 __init__(self, session): Screen.__init__(self, session) self["Model"] = StaticText(api.enigma2.systeminfo.modelname()) self["EnigmaVersion"] = StaticText("Dreambox OS: " + about.getEnigmaVersionString()) self["ImageVersion"] = StaticText("Image: " + about.getImageVersionString()) self["TunerHeader"] = StaticText(_("Detected NIMs:")) fp_version = getFPVersion() if fp_version is None: fp_version = "" else: fp_version = _("Frontprocessor version: %s") % fp_version self["FPVersion"] = StaticText(fp_version) nims = nimmanager.nimList() for count in (0, 1, 2, 3, 4): if count < len(nims): self["Tuner" + str(count)] = StaticText(nims[count]) else: self["Tuner" + str(count)] = StaticText("") self["HDDHeader"] = StaticText(_("Detected HDD:")) hdd = None hddlist = harddiskmanager.HDDList() defaultDisk = harddiskmanager.getDefaultStorageDevicebyUUID(config.storage_options.default_device.value) if defaultDisk: default_hdd = "/dev/%s" %(defaultDisk.device,) for hd in hddlist: hd = hd[1] if default_hdd.startswith(hd.getDeviceDir()): Log.i("Default HDD matched! (%s -> %s)" %(default_hdd,hd.getDeviceDir())) hdd = hd break if not hdd: hdd = hddlist and hddlist[0][1] or None Log.w("No default Harddisk found. Falling back to first in list -> %s" %(hdd,)) 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["IPHeader"] = StaticText(_("Current IP Address:")) ipA = _("none") services = eNetworkManager.getInstance().getServices() for service in services: ip = self.getServiceIP(service) name = service.name() if ip != None: ipA = "%s (%s)" %(ip, name) self["ipA"] = StaticText(ipA) self["actions"] = ActionMap(["SetupActions", "ColorActions"], { "cancel": self.close, "ok": self.close, "green": self.showTranslationInfo })
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['key_green'] = Button(_('Translations')) self['key_red'] = Button(_('Latest Commits')) self['actions'] = ActionMap(['ColorActions', 'SetupActions', 'DirectionActions'], {'cancel': self.close, 'ok': self.close, #'red': self.showCommits, 'green': self.showTranslationInfo, 'up': self['AboutScrollLabel'].pageUp, 'down': self['AboutScrollLabel'].pageDown}) return
def __init__(self, session): Screen.__init__(self, session) 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" 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["key_green"] = Button(_("Translations")) self["key_red"] = Button(_("Latest Commits")) self["actions"] = ActionMap(["ColorActions", "SetupActions", "DirectionActions"], { "cancel": self.close, "ok": self.close, "red": self.showCommits, "green": self.showTranslationInfo, "up": self["AboutScrollLabel"].pageUp, "down": self["AboutScrollLabel"].pageDown })
def populate2(self): self.activityTimer.stop() self.Console = Console() niminfo = "" nims = nimmanager.nimList(showFBCTuners=False) for count in range(len(nims)): if niminfo: niminfo += "\n" niminfo += nims[count] self["nims"].setText(niminfo) nims = nimmanager.nimList() if len(nims) <= 4 : for count in (0, 1, 2, 3): if count < len(nims): self["Tuner" + str(count)].setText(nims[count]) else: self["Tuner" + str(count)].setText("") else: desc_list = [] count = 0 cur_idx = -1 while count < len(nims): data = nims[count].split(":") idx = data[0].strip('Tuner').strip() desc = data[1].strip() if desc_list and desc_list[cur_idx]['desc'] == desc: desc_list[cur_idx]['end'] = idx else: desc_list.append({'desc' : desc, 'start' : idx, 'end' : idx}) cur_idx += 1 count += 1 for count in (0, 1, 2, 3): if count < len(desc_list): if desc_list[count]['start'] == desc_list[count]['end']: text = "Tuner %s: %s" % (desc_list[count]['start'], desc_list[count]['desc']) else: text = "Tuner %s-%s: %s" % (desc_list[count]['start'], desc_list[count]['end'], desc_list[count]['desc']) else: text = "" self["Tuner" + str(count)].setText(text) self.list = [] list2 = [] f = open('/proc/partitions', 'r') for line in f.readlines(): parts = line.strip().split() if not parts: continue device = parts[3] if not search('sd[a-z][1-9]', device): continue if device in list2: continue mount = '/dev/' + device f = open('/proc/mounts', 'r') for line in f.readlines(): if device in line: parts = line.strip().split() mount = str(parts[1]) break f.close() if not mount.startswith('/dev/'): size = Harddisk(device).diskSize() free = Harddisk(device).free() if ((float(size) / 1024) / 1024) >= 1: sizeline = _("Size: ") + str(round(((float(size) / 1024) / 1024), 2)) + _("TB") elif (size / 1024) >= 1: sizeline = _("Size: ") + str(round((float(size) / 1024), 2)) + _("GB") elif size >= 1: sizeline = _("Size: ") + str(size) + _("MB") else: sizeline = _("Size: ") + _("unavailable") if ((float(free) / 1024) / 1024) >= 1: freeline = _("Free: ") + str(round(((float(free) / 1024) / 1024), 2)) + _("TB") elif (free / 1024) >= 1: freeline = _("Free: ") + str(round((float(free) / 1024), 2)) + _("GB") elif free >= 1: freeline = _("Free: ") + str(free) + _("MB") else: freeline = _("Free: ") + _("full") self.list.append(mount + '\t' + sizeline + ' \t' + freeline) else: self.list.append(mount + '\t' + _('Not mounted')) list2.append(device) self.list = '\n'.join(self.list) self["hdd"].setText(self.list) self.Console.ePopen("df -mh | grep -v '^Filesystem'", self.Stage1Complete)
def __init__(self, session): Screen.__init__(self, session) # [ IQON : by knuth model = HardwareInfo().get_device_name() macaddress = about.getMacAddressString("eth0") if model in ("force2solid"): AboutText = _("BRAND: ") + "IQON" + "\n" AboutText += _("Hardware: ") + "FORCE2" + "\n" elif model in ("tmnanose"): AboutText = _("Hardware: ") + "TM-NANO-SE" + "\n" elif model in ("optimussosplus"): AboutText = _("Hardware: ") + "OPTIMUSS OS+" + "\n" elif model in ("force2plus"): AboutText = _("Hardware: ") + "FORCE2+" + "\n" elif model in ("tmnanosecombo"): AboutText = _("Hardware: ") + "TM-NANO-SE Combo" + "\n" elif model in ("tmnanosem2"): AboutText = _("Hardware: ") + "TM-NANO-SE M2" + "\n" elif model in ("optimussos2"): AboutText = _("Hardware: ") + "OPTIMUSS OS2" + "\n" elif model in ("optimussos1"): AboutText = _("Hardware: ") + "OPTIMUSS OS1" + "\n" elif model in ("optimussos2plus"): AboutText = _("Hardware: ") + "OPTIMUSS OS2+" + "\n" elif model in ("optimussos1plus"): AboutText = _("Hardware: ") + "OPTIMUSS OS1+" + "\n" elif model in ("force2eco"): AboutText = _("Hardware: ") + "FORCE2 Eco" + "\n" elif model in ("fusionhd"): AboutText = _("Hardware: ") + "FUSION HD" + "\n" elif model in ("force1plus"): f = open("/etc/.brandtype", 'r') line = f.readline() if "technomate" in line: AboutText = _("Hardware: ") + "TM-NANO-3T COMBO" + "\n" elif "edision" in line: AboutText = _("Hardware: ") + "OPTIMUSS OS3+" + "\n" elif "iqon" in line: AboutText = _("BRAND: ") + "IQON" + "\n" AboutText += _("Hardware: ") + about.getHardwareTypeString() + "\n" else: AboutText = _("Hardware: ") + about.getHardwareModelString() + "\n" f.close() else: AboutText = _("Hardware: ") + about.getHardwareModelString() + "\n" AboutText += _("Mac Address: ") + macaddress + "\n" if HardwareInfo().has_micom(): AboutText += _("Micom Version: ") + about.getMicomVersionString() + "\n" # 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" # if path.exists('/proc/stb/info/chipset'): AboutText += _("Chipset: BCM%s\n") % about.getChipSetString() AboutText += _("CPU: %s\n") % about.getCPUString() AboutText += _("CPU Speed: %s\n") % about.getCPUSpeedString() AboutText += _("Cores: %s\n") % about.getCpuCoresString() 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["key_green"] = Button(_("Translations")) self["key_red"] = Button(_("Latest Commits")) self["actions"] = ActionMap(["ColorActions", "SetupActions", "DirectionActions"], { "cancel": self.close, "ok": self.close, "red": self.showCommits, "green": self.showTranslationInfo, "up": self["AboutScrollLabel"].pageUp, "down": self["AboutScrollLabel"].pageDown }) self["hidden_action"] = ActionMap(["ColorActions"], { "red": self.red_action, "blue": self.blue_action, "info": self.info_action, "1": self.first_action, "2": self.second_action, "3": self.third_action, },-1) self.key_status = -1
def __init__(self, session): Screen.__init__(self, session) 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 += _("Cores: %s") % about.getCpuCoresString() + "\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() 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() 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_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 }, -2)