def __init__(self, session, *args): SelectImage.__init__(self, session) self.skinName = ["MultibootSelection", "SelectImage"] self.expanded = [] self.tmp_dir = None self.setTitle(_("Multiboot image selector")) self["key_red"] = StaticText(_("Cancel")) self["key_green"] = StaticText(_("Reboot")) self["key_yellow"] = StaticText() self["list"] = ChoiceList([]) self["actions"] = ActionMap(["OkCancelActions", "ColorActions", "DirectionActions", "KeyboardInputActions", "MenuActions"], { "ok": self.keyOk, "cancel": self.cancel, "red": self.cancel, "green": self.keyOk, "yellow": self.deleteImage, "up": self.keyUp, "down": self.keyDown, "left": self.keyLeft, "right": self.keyRight, "upRepeated": self.keyUp, "downRepeated": self.keyDown, "leftRepeated": self.keyLeft, "rightRepeated": self.keyRight, "menu": boundFunction(self.cancel, True), }, -1) self.currentimageslot = getCurrentImage() self.tmp_dir = tempfile.mkdtemp(prefix="MultibootSelection") Console().ePopen('mount %s %s' % (SystemInfo["MultibootStartupDevice"], self.tmp_dir)) self.getImagesList()
def ImageList(self): imagedict = getImagelist() self.saveImageList = imagedict list = [] currentimageslot = getCurrentImage() or 1 print "[Image Backup] Current Image Slot %s, Imagelist %s" % ( currentimageslot, imagedict) if imagedict: for x in sorted(imagedict.keys()): if imagedict[x]["imagename"] != _("Empty slot"): if x == 1 and currentimageslot == 1 and SystemInfo[ "canRecovery"]: list.append( ChoiceEntryComponent( '', (_("slot%s - %s as USB Recovery") % (x, imagedict[x]["imagename"]), x, True))) list.append( ChoiceEntryComponent( '', ((_("slot%s - %s (current image)") if x == currentimageslot else _("slot%s - %s")) % (x, imagedict[x]["imagename"]), x, False))) else: if SystemInfo["canRecovery"]: list.append( ChoiceEntryComponent( '', (_("internal flash: %s %s as USB Recovery") % (getImageDistro(), getImageVersion()), "x", True))) list.append( ChoiceEntryComponent( '', (_("internal flash: %s %s ") % (getImageDistro(), getImageVersion()), "x", False))) self["config"].setList(list)
def ImageList(self, imagedict): list = [] mode = getCurrentImageMode() or 0 currentimageslot = getCurrentImage() for x in sorted(imagedict.keys()): if imagedict[x]["imagename"] != _("Empty slot") and x != currentimageslot: list.append(ChoiceEntryComponent('', ((_("slot%s - %s ")) % (x, imagedict[x]['imagename']), x))) self["config"].setList(list)
def confirmation(self): if self.reasons: self.message = _("%s\nDo you still want to flash image\n%s?") % (self.reasons, self.imagename) else: self.message = _("Do you want to flash image\n%s") % self.imagename if SystemInfo["canMultiBoot"]: imagesList = getImagelist() currentimageslot = getCurrentImage() choices = [] for x in range(1, len(SystemInfo["canMultiBoot"]) + 1): choices.append(((_("slot%s - %s (current image) with, backup") if x == currentimageslot else _("slot%s - %s, with backup")) % (x, imagesList[x]['imagename']), (x, "with backup"))) for x in range(1, len(SystemInfo["canMultiBoot"]) + 1): choices.append(((_("slot%s - %s (current image), without backup") if x == currentimageslot else _("slot%s - %s, without backup")) % (x, imagesList[x]['imagename']), (x, "without backup"))) choices.append((_("No, do not flash image"), False)) self.session.openWithCallback(self.checkMedia, MessageBox, self.message, list=choices, default=currentimageslot, simple=True) else: choices = [(_("Yes, with backup"), "with backup"), (_("Yes, without backup"), "without backup"), (_("No, do not flash image"), False)] self.session.openWithCallback(self.checkMedia, MessageBox, self.message , list=choices, default=False, simple=True)
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 })