def InitSkin(self): global showAllButtons global longButtonText global buttonText_na global skin global skinName self.skinName = skinName if skin: try: SRSkin = open(skin) self.skin = SRSkin.read() SRSkin.close() except: showAllButtons = False longButtonText = False buttonText_na = "-----" skinName = default_skinName skin = default_skin SRSkin = open(skin) self.skin = SRSkin.read() SRSkin.close() self['bt_red'] = Pixmap() self['bt_green'] = Pixmap() self['bt_yellow'] = Pixmap() self['bt_blue'] = Pixmap() self['bt_ok'] = Pixmap() self['bt_exit'] = Pixmap() self['bt_text'] = Pixmap() self['bt_epg'] = Pixmap() self['bt_info'] = Pixmap() self['bt_menu'] = Pixmap() self['bt_0'] = Pixmap() self['bt_1'] = Pixmap() self['bt_2'] = Pixmap() self['bt_3'] = Pixmap() self['bt_4'] = Pixmap() self['bt_5'] = Pixmap() self['bt_6'] = Pixmap() self['bt_7'] = Pixmap() self['bt_8'] = Pixmap() self['bt_9'] = Pixmap() self['text_red'] = Label("") self['text_green'] = Label("") self['text_yellow'] = Label("") self['text_blue'] = Label("") self['text_ok'] = Label("") self['text_exit'] = Label("") self['text_text'] = Label("") self['text_epg'] = Label("") self['text_info'] = Label("") self['text_menu'] = Label("") self['text_0'] = Label("") self['text_1'] = Label("") self['text_2'] = Label("") self['text_3'] = Label("") self['text_4'] = Label("") self['text_5'] = Label("") self['text_6'] = Label("") self['text_7'] = Label("") self['text_8'] = Label("") self['text_9'] = Label("") self['Web_Channel'] = Label("") self['Web_Channel'].hide() self['STB_Channel'] = Label("") self['STB_Channel'].hide() self['alt_STB_Channel'] = Label("") self['alt_STB_Channel'].hide() self['separator'] = Label("") self['separator'].hide() self['path'] = Label("") self['path'].hide() self['menu_list'] = MenuList([]) self['menu_list'].hide() self['config'] = MenuList([]) self['config'].hide() self['log'] = MenuList([]) self['log'].hide() self['list'] = MenuList([]) self['list'].hide() self['popup_list'] = MenuList([]) self['popup_list'].hide() self['popup_list2'] = MenuList([]) self['popup_list2'].hide() self['popup_bg'] = Pixmap() self['popup_bg'].hide() self['cover'] = Pixmap() self['cover'].hide() self['config_information'] = Label("") self['config_information'].hide() self['config_information_text'] = Label("") self['config_information_text'].hide() self['info'] = ScrollLabel() self['info'].hide() desktopSize = getDesktop(0).size() self["video"] = VideoWindow(decoder=0, fb_width=desktopSize.width(), fb_height=desktopSize.height()) self['title'] = Label("") self['version'] = Label("SerienRecorder v%s" % config.plugins.serienRec.showversion.value) self['headline'] = Label("") setSkinProperties(self, False) if not showAllButtons: self['bt_red'].hide() self['bt_green'].hide() self['bt_yellow'].hide() self['bt_blue'].hide() self['bt_ok'].hide() self['bt_exit'].hide() self['bt_text'].hide() self['bt_epg'].hide() self['bt_info'].hide() self['bt_menu'].hide() self['bt_0'].hide() self['bt_1'].hide() self['bt_2'].hide() self['bt_3'].hide() self['bt_4'].hide() self['bt_5'].hide() self['bt_6'].hide() self['bt_7'].hide() self['bt_8'].hide() self['bt_9'].hide() self['text_red'].hide() self['text_green'].hide() self['text_yellow'].hide() self['text_blue'].hide() self['text_ok'].hide() self['text_0'].hide() self['text_1'].hide() self['text_2'].hide() self['text_3'].hide() self['text_4'].hide() self['text_5'].hide() self['text_6'].hide() self['text_7'].hide() self['text_8'].hide() self['text_9'].hide()
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" AboutText += _("Developer Name:\tRedouane ") + "\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) AboutText += _('Skin & Resolution: %s (%sx%s)\n') % ( config.skin.primary_skin.value.split('/')[0], getDesktop(0).size().width(), getDesktop(0).size().height()) self["TunerHeader"] = StaticText(_("Detected NIMs:")) AboutText += "\n" + _("Detected NIMs:") + "\n" nims = nimmanager.nimListCompressed() for count in range(len(nims)): if count < 4: self["Tuner" + str(count)] = StaticText(nims[count]) else: self["Tuner" + str(count)] = StaticText("") AboutText += nims[count] + "\n" self["HDDHeader"] = StaticText(_("Detected HDD:")) AboutText += "\n" + _("Detected HDD:") + "\n" hddlist = harddiskmanager.HDDList() hddinfo = "" if hddlist: formatstring = hddsplit and "%s:%s, %.1f %sB %s" or "%s\n(%s, %.1f %sB %s)" for count in range(len(hddlist)): if hddinfo: hddinfo += "\n" hdd = hddlist[count][1] if int(hdd.free()) > 1024: hddinfo += formatstring % (hdd.model(), hdd.capacity(), hdd.free() / 1024.0, "G", _("free")) else: hddinfo += formatstring % (hdd.model(), hdd.capacity(), hdd.free(), "M", _("free")) else: hddinfo = _("none") self["hddA"] = StaticText(hddinfo) AboutText += hddinfo + "\n\n" + _("Network Info:") for x in about.GetIPsFromNetworkInterfaces(): AboutText += "\n" + x[0] + ": " + x[1] self["AboutScrollLabel"] = ScrollLabel(AboutText) self["key_green"] = Button(_("Translations")) self["key_red"] = Button(_("Latest Commits")) self["key_yellow"] = Button(_("Troubleshoot")) self["key_blue"] = Button(_("Memory Info")) self["actions"] = ActionMap( ["ColorActions", "SetupActions", "DirectionActions"], { "cancel": self.close, "ok": self.close, "red": self.showCommits, "green": self.showTranslationInfo, "blue": self.showMemoryInfo, "yellow": self.showTroubleshoot, "up": self["AboutScrollLabel"].pageUp, "down": self["AboutScrollLabel"].pageDown })
def __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" 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%s" ) % "STARTUP_" + image + bootname + "\n" 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" 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" 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) 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.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(_("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 __init__(self, session, menu_path = ""): Screen.__init__(self, session) screentitle = _("Network") if config.usage.show_menupath.value == 'large': menu_path += screentitle title = menu_path self["menu_path_compressed"] = StaticText("") elif config.usage.show_menupath.value == 'small': title = screentitle self["menu_path_compressed"] = StaticText(menu_path + " >" if not menu_path.endswith(' / ') else menu_path[:-3] + " >" or "") else: title = screentitle self["menu_path_compressed"] = StaticText("") Screen.setTitle(self, title) self.skinName = ["SystemNetworkInfo", "WlanStatus"] self["LabelBSSID"] = StaticText() self["LabelESSID"] = StaticText() self["LabelQuality"] = StaticText() self["LabelSignal"] = StaticText() self["LabelBitrate"] = StaticText() self["LabelEnc"] = StaticText() self["BSSID"] = StaticText() self["ESSID"] = StaticText() self["quality"] = StaticText() self["signal"] = StaticText() self["bitrate"] = StaticText() self["enc"] = StaticText() self["IFtext"] = StaticText() self["IF"] = StaticText() self["Statustext"] = StaticText() self["statuspic"] = MultiPixmap() self["statuspic"].setPixmapNum(1) self["statuspic"].show() self["devicepic"] = MultiPixmap() self["AboutScrollLabel"] = ScrollLabel() self.iface = None self.createscreen() self.iStatus = None if iNetwork.isWirelessInterface(self.iface): try: from Plugins.SystemPlugins.WirelessLan.Wlan import iStatus self.iStatus = iStatus except: pass self.resetList() self.onClose.append(self.cleanup) self["key_red"] = StaticText(_("Close")) self["actions"] = ActionMap(["SetupActions", "ColorActions", "DirectionActions"], { "cancel": self.close, "ok": self.close, "up": self["AboutScrollLabel"].pageUp, "down": self["AboutScrollLabel"].pageDown }) self.onLayoutFinish.append(self.updateStatusbar)
def __init__(self, session, eventName, callbackNeeded=False, save=False, savepath=None, localpath=None): Screen.__init__(self, session) for tag in config.plugins.imdb.ignore_tags.getValue().split(','): eventName = eventName.replace(tag, '') self.eventName = eventName self.callbackNeeded = callbackNeeded self.callbackData = "" self.callbackGenre = "" self.saving = save self.savingpath = savepath self.localpath = localpath self.fetchurl = None self.dictionary_init() self["poster"] = Pixmap() self.picload = ePicLoad() self.picload.PictureData.get().append(self.paintPosterPixmapCB) self["stars"] = ProgressBar() self["starsbg"] = Pixmap() self["stars"].hide() self["starsbg"].hide() self.ratingstars = -1 self["title"] = StaticText(_("The Internet Movie Database")) # map new source -> old component def setText(txt): StaticText.setText(self["title"], txt) self["titellabel"].setText(txt) self["title"].setText = setText self["titellabel"] = Label() self["detailslabel"] = ScrollLabel("") self["castlabel"] = ScrollLabel("") self["extralabel"] = ScrollLabel("") self["statusbar"] = Label("") self["ratinglabel"] = Label("") self.resultlist = [] self["menu"] = MenuList(self.resultlist) self["menu"].hide() self["key_red"] = Button(_("Exit")) self["key_green"] = Button("") self["key_yellow"] = Button("") self["key_blue"] = Button("") # 0 = multiple query selection menu page # 1 = movie info page # 2 = extra infos page self.Page = 0 self["actions"] = ActionMap( [ "OkCancelActions", "ColorActions", "MovieSelectionActions", "DirectionActions" ], { "ok": self.showDetails, "cancel": self.exit, "down": self.pageDown, "up": self.pageUp, "red": self.exit, "green": self.showMenu, "yellow": self.showDetails, "blue": self.showExtras, "contextMenu": self.contextMenuPressed, "showEventInfo": self.showDetails }, -1) self.getIMDB() if self.localpath is not None: # otherwise the stars are not correctly shown if we call details directly self.onLayoutFinish.append(self._layoutFinished)
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 == 'vusolo2': BoxName = "Vuplus Solo2" elif boxtype == 'vuzero': BoxName = "Vuplus Zero" elif 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 == '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" 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: ") + config.skin.primary_skin.value[0:-9] 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 __init__(self, event, Ref, callback=None, similarEPGCB=None, parent=None): self.similarEPGCB = similarEPGCB self.cbFunc = callback self.currentService = Ref self.isRecording = (not Ref.ref.flags & eServiceReference.isGroup) and Ref.ref.getPath() self.event = event self["Service"] = ServiceEvent() self["Event"] = Event() self["epg_eventname"] = ScrollLabel() self["epg_description"] = ScrollLabel() self["FullDescription"] = ScrollLabel() self["datetime"] = Label() self["channel"] = Label() self["duration"] = Label() if self['Event'] == StaticText: self["key_red"] = StaticText("") else: self["key_red"] = Button("") if similarEPGCB is not None: self.SimilarBroadcastTimer = eTimer() self.SimilarBroadcastTimer.callback.append(self.getSimilarEvents) else: self.SimilarBroadcastTimer = None self.key_green_choice = self.ADD_TIMER if self.isRecording: if self["Event"] == StaticText: self["key_green"] = StaticText("") else: self["key_green"] = Button("") else: if self["Event"] == StaticText: self["key_green"] = StaticText(_("Add timer")) else: self["key_green"] = Button(_("Add timer")) if self["Event"] == StaticText: self["key_yellow"] = StaticText("") self["key_blue"] = StaticText("") else: self["key_yellow"] = Button("") self["key_blue"] = Button("") self["actions"] = ActionMap( ["OkCancelActions", "EventViewActions"], { "cancel": self.close, "ok": self.close, "pageUp": self.pageUp, "pageDown": self.pageDown, "prevEvent": self.prevEvent, "nextEvent": self.nextEvent, "timerAdd": self.timerAdd, "openSimilarList": self.openSimilarList, "contextMenu": self.doContext, }) if parent and hasattr(parent, "fallbackTimer"): self.fallbackTimer = parent.fallbackTimer self.onLayoutFinish.append(self.onCreate) else: self.fallbackTimer = FallbackTimerList(self, self.onCreate)
def __init__(self, session, text): self.showsource = CfgPlTr.showsource.getValue() if self.showsource == "yes": size = MySD.tMyes else: size = MySD.tMno self.dict = {'size': size, 'plug_loc': plugin_location} self.skin = applySkinVars(MySD.translatorMain_skin, self.dict) self.session = session Screen.__init__(self, session) if self.showsource != "yes": self.skinName = ["translatorMainSingle", "translatorMain" ] self.text = text self.hideflag = True self.refresh = False self.max = 1 self.count = 0 self.list = [] self.eventName = '' self['flag'] = Pixmap() self['flag2'] = Pixmap() self['timing'] = Label('') self['text'] = ScrollLabel('') self['text2'] = ScrollLabel('') self['label'] = Label('= Hide') self['label2'] = Label('= Clear cache') # Add the helptext for the default destination now lang = CfgPlTr.destination.getValue() if lang not in self.helptext: self.helptext[lang] = DO_translation(self.helptext['en'], 'en', lang) AMbindings = { 'ok': self.get_text, 'cancel': self.exit, 'down': self.down, 'up': self.up, 'yellow': self.clear_cache, 'red': self.getEPG, 'green': self.showHelp, 'blue': self.hideScreen, 'contextMenu': self.config, 'bluelong': self.showHelp, 'showEventInfo': self.showHelp } # We need to know whether we are playing a recording as, if so, we do # NOT want to activate the service-changing keys, nor programme text # changes. # We also don't need to set-up a ServiceEventTracker for a recording, as # the even can't occur. # The playback state is also needed for getEPG(), so save it. # Do NOT use: # self.session.nav.getCurrentlyPlayingServiceOrGroup().isPlayback() # as that isPlayback() is Vix-specific. So just replicate the code here. # self.inPlayBack = "0:0:0:0:0:0:0:0:0" in self.My_Sref().toCompareString() # Add the channel name. wintitle = 'EPG Translator' try: cur_serv = self.My_Sref().getServiceName() wintitle += " - " + cur_serv except: pass self.setTitle(wintitle) if not self.inPlayBack: # We can add in service-change keys AMbindings.update({ 'right': self.rightDown, 'left': self.leftUp, 'nextBouquet': self.zapDown, 'prevBouquet': self.zapUp }) # Also add the event tracker for changing service for not-in-Playback # This means we can call getEPG() *after* the service changes, even # if there may be a user prompt related to timeshift. # self.__event_tracker = ServiceEventTracker(screen=self, eventmap= {iPlayableService.evTunedIn: self.__serviceTuned}) self['actions'] = ActionMap(['OkCancelActions', 'DirectionActions', 'ChannelSelectBaseActions', 'ColorActions', 'MovieSelectionActions', 'HelpActions'], AMbindings, -1) self.onLayoutFinish.append(self.onLayoutFinished) self["key_red"] = StaticText(_("Refresh EPG")) self["key_green"] = StaticText(_("Info")) self["key_yellow"] = StaticText(_("Clear cache")) self["key_blue"] = StaticText(_("Hide")) self["key_menu"] = StaticText(_("MENU")) self["key_ok"] = StaticText(_("Translate text"))
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 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 createscreen(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) self.AboutText = "" self.iface = "eth0" eth0 = about.getIfConfig('eth0') if 'addr' in eth0: if 'ifname' in eth0: self.AboutText += '{:<35}'.format( _('Interface:')) + "\t" + " /dev/" + eth0['ifname'] + "\n" self.AboutText += '{:<35}'.format( _("IP:")) + "\t" + eth0['addr'] + "\n" if 'netmask' in eth0: self.AboutText += '{:<35}'.format( _("Netmask:")) + "\t" + eth0['netmask'] + "\n" if 'hwaddr' in eth0: self.AboutText += '{:<35}'.format( _("MAC:")) + "\t" + eth0['hwaddr'] + "\n" self.AboutText += '{:<35}'.format( _("Network Speed:")) + "\t" + netspeed() + "\n" self.iface = 'eth0' eth1 = about.getIfConfig('eth1') if 'addr' in eth1: if 'ifname' in eth1: self.AboutText += '{:<35}'.format( _('Interface:')) + "\t" + " /dev/" + eth1['ifname'] + "\n" self.AboutText += '{:<35}'.format( _("IP:")) + "\t" + eth1['addr'] + "\n" if 'netmask' in eth1: self.AboutText += '{:<35}'.format( _("Netmask:")) + "\t" + eth1['netmask'] + "\n" if 'hwaddr' in eth1: self.AboutText += '{:<35}'.format( _("MAC:")) + "\t" + eth1['hwaddr'] + "\n" self.AboutText += '{:<35}'.format( _("Network Speed:")) + "\t" + netspeed_eth1() + "\n" self.iface = 'eth1' ra0 = about.getIfConfig('ra0') if 'addr' in ra0: if 'ifname' in ra0: self.AboutText += '{:<35}'.format( _('Interface:')) + "\t" + " /dev/" + ra0['ifname'] + "\n" self.AboutText += '{:<35}'.format( _("IP:")) + "\t" + ra0['addr'] + "\n" if 'netmask' in ra0: self.AboutText += '{:<35}'.format( _("Netmask:")) + "\t" + ra0['netmask'] + "\n" if 'hwaddr' in ra0: self.AboutText += '{:<35}'.format( _("MAC:")) + "\t" + ra0['hwaddr'] + "\n" self.iface = 'ra0' wlan0 = about.getIfConfig('wlan0') if 'addr' in wlan0: if 'ifname' in wlan0: self.AboutText += '{:<35}'.format( _('Interface:')) + "\t" + " /dev/" + wlan0['ifname'] + "\n" self.AboutText += '{:<35}'.format( _("IP:")) + "\t" + wlan0['addr'] + "\n" if 'netmask' in wlan0: self.AboutText += '{:<35}'.format( _("Netmask:")) + "\t" + wlan0['netmask'] + "\n" if 'hwaddr' in wlan0: self.AboutText += '{:<35}'.format( _("MAC:")) + "\t" + wlan0['hwaddr'] + "\n" self.iface = 'wlan0' wlan1 = about.getIfConfig('wlan1') if 'addr' in wlan1: if 'ifname' in wlan1: self.AboutText += '{:<35}'.format( _('Interface:')) + "\t" + " /dev/" + wlan1['ifname'] + "\n" self.AboutText += '{:<35}'.format( _("IP:")) + "\t" + wlan1['addr'] + "\n" if 'netmask' in wlan1: self.AboutText += '{:<35}'.format( _("Netmask:")) + "\t" + wlan1['netmask'] + "\n" if 'hwaddr' in wlan1: self.AboutText += '{:<35}'.format( _("MAC:")) + "\t" + wlan1['hwaddr'] + "\n" self.iface = 'wlan1' rx_bytes, tx_bytes = about.getIfTransferredData(self.iface) self.AboutText += "\n" + '{:<35}'.format( _("Bytes received:")) + "\t" + rx_bytes + "\n" self.AboutText += '{:<35}'.format( _("Bytes sent:")) + "\t" + tx_bytes + "\n" hostname = open('/proc/sys/kernel/hostname').read() self.AboutText += "\n" + '{:<35}'.format( _("Hostname:")) + "\t" + hostname + "\n" self["AboutScrollLabel"] = ScrollLabel(self.AboutText)
def __init__(self, session, items, service=None): Screen.__init__(self, session) self.skinName = SkinTools.appendResolution( "AdvancedMovieSelectionDownload") self.onShow.append(self.selectionChanged) self.service = service self["logo"] = Pixmap() self["info"] = Label() self["title"] = Label() self["poster"] = Pixmap() self["poster"].hide() self["description"] = ScrollLabel() self["key_red"] = Button(_("Cancel")) self["key_green"] = Button("") self["key_yellow"] = Button("") self["key_yellow"] = Label(_("Manual search")) if self.service is not None: self["key_green"] = Label(_("Save infos/cover")) else: self["key_green"] = Label(_("Background")) self["key_yellow"].hide() self["ActionsMap"] = ActionMap( ["SetupActions", "ColorActions"], { "ok": self.titleSelected, "green": self.titleSelected, "red": self.__cancel, "yellow": self.editTitle, "cancel": self.__cancel, "left": self.scrollLabelPageUp, "right": self.scrollLabelPageDown }, -1) self.onShown.append(self.setWindowTitle) self.l = [] self["list"] = MenuList(self.l) self["list"].onSelectionChanged.append(self.selectionChanged) self.picload = ePicLoad() self.picload.PictureData.get().append(self.paintPosterPixmap) self.refreshTimer = eTimer() self.refreshTimer.callback.append(self.refresh) self.tmdb3 = tmdb.init_tmdb3() if self.service is not None: global movie_title movie_title = ServiceCenter.getInstance().info( self.service).getName( self.service).encode("utf-8").split(" - ")[0].strip() self.refreshTimer.start(1, True) return global fetchingMovies, this_session, is_hidden if fetchingMovies is None: fetchingMovies = FetchingMovies(items) else: fetchingMovies.cancel = False self.progressTimer = eTimer() self.progressTimer.callback.append(self.updateProgress) self.progressTimer.start(250, False) this_session = session is_hidden = False
def __init__(self, session, moviename, spath=None): Screen.__init__(self, session) #self.session = session self.moviename = getMovieNameWithoutExt(moviename) moviename = getMovieNameWithoutPhrases(self.moviename) self.movielist = None self.spath = spath self["previewcover"] = Pixmap() self.picload = ePicLoad() try: self.picload_conn = self.picload.PictureData.connect(self.showPreviewCoverCB) except: self.picload.PictureData.get().append(self.showPreviewCoverCB) self.previewTimer = eTimer() try: self.previewTimer_conn = self.previewTimer.timeout.connect(self.showPreviewCover) except: self.previewTimer.callback.append(self.showPreviewCover) self.selectionTimer = eTimer() try: self.selectionTimer_conn = self.selectionTimer.timeout.connect(self.updateSelection) except: self.selectionTimer.callback.append(self.updateSelection) self["previewlist"] = MenuList([]) self.page = 0 self.id = None self.cat = None self["contenttxt"] = ScrollLabel() self["runtime"] = Label("") self["runtimetxt"] = Label("") self["genre"] = Label("") self["genretxt"] = Label("") self["country"] = Label("") self["countrytxt"] = Label("") self["release"] = Label("") self["releasetxt"] = Label("") self["rating"] = Label("") self["ratingtxt"] = Label("") self["stars"] = ProgressBar() self["starsbg"] = Pixmap() self["stars"].hide() self["starsbg"].hide() self["setup"] = Label(_("Setup")) self["key_menu"] = Pixmap() self["save"] = Label(_("Save")) self["key_green"] = Pixmap() self.ratingstars = -1 self.movielist = getMovieList(moviename) if self.movielist is not None: self["previewlist"] = MenuList(self.movielist[0]) if self.movielist[1] > 1: self.page = 1 self["movie_name"] = Label(_("Search results for:") + " " + moviename) else: self.page = 0 sel = self["previewlist"].l.getCurrentSelection() if sel is not None: preview = getMovieInfo(sel[1], sel[2]) if preview is not None: self.id = sel[1] self.cat = sel[2] self["previewlist"].hide() self["movie_name"] = Label(_("Movie Information Preview for:") + " " + moviename) else: self["movie_name"] = Label(_("Search results for:") + " " + moviename) self["contenttxt"].setText(_("Nothing was found !")) self.file_format = "(\.ts|\.avi|\.mkv|\.divx|\.f4v|\.flv|\.img|\.iso|\.m2ts|\.m4v|\.mov|\.mp4|\.mpeg|\.mpg|\.mts|\.vob|\.asf|\.wmv|.\stream|.\webm)" # for file-operations self.txtsaved = False self.jpgsaved = False self.mpath = None self.onLayoutFinish.append(self.layoutFinished) self["actions"] = HelpableActionMap(self, "EMCMovieInfo", { "EMCEXIT": self.exit, "EMCUp": self.pageUp, "EMCDown": self.pageDown, "EMCOK": self.ok, "EMCGreen": self.save, "EMCMenu": self.setup, #"EMCINFO": self.info, #"EMCRed": self.red, }, -1) self["previewlist"].onSelectionChanged.append(self.selectionChanged)
def __init__(self, session, artItem, addParams): self.session = session self.artItem = artItem ############################################# # calculate num of rich desc items and pages ############################################# self.richDesc = {'items_count': 0, 'pages_count': 0, 'page': 0, 'avalable_params':[] } try: if 'custom_items_list' in artItem.richDescParams: self.richDesc['custom_items_list'] = artItem.richDescParams['custom_items_list'] self.richDesc['items_count'] = len(self.richDesc['custom_items_list']) else: for item in ArticleContent.RICH_DESC_PARAMS: if item in artItem.richDescParams: self.richDesc['items_count'] += 1 self.richDesc['avalable_params'].append(item) # yes I know, len(self.richDesc['avalable_params']) == self.richDesc['items_count'] except Exception: printExc() self.richDesc['pages_count'] = self.richDesc['items_count'] / self.MAX_RICH_DESC_ROW_NUM if self.richDesc['items_count'] % self.MAX_RICH_DESC_ROW_NUM > 0: self.richDesc['pages_count'] += 1 if self.richDesc['items_count'] < self.MAX_RICH_DESC_ROW_NUM: self.richDesc['rows_count'] = self.richDesc['items_count'] else: self.richDesc['rows_count'] = self.MAX_RICH_DESC_ROW_NUM ############################################# self.__prepareSkin() Screen.__init__(self, session) for idx in range(self.richDesc['rows_count']): self["dsc_label_{0}".format(idx+1)] = Label("") self["dsc_text_{0}".format(idx+1)] = Label("") self["title"] = Label("") self["text"] = ScrollLabel(" ") self["page_marker"] = Cover3() ############################################# # COVER ############################################# self["cover"] = Cover() self.cover = {'src':'', 'downloader':None, 'files_to_remove':[], 'image_path':''} try: self.cover['image_path'] = os.path.join(addParams['buffering_path'], '.iptv_buffering.jpg') except Exception: printExc() ############################################# ############################################# # SPINER ############################################# try: for idx in range(5): spinnerName = "spinner" if idx: spinnerName += '_%d' % idx self[spinnerName] = Cover3() except Exception: printExc() self.spinner = {} self.spinner["pixmap"] = [LoadPixmap(GetIconDir('radio_button_on.png')), LoadPixmap(GetIconDir('radio_button_off.png'))] # spinner timer self.spinner["timer"] = eTimer() self.spinner["timer_conn"] = eConnectCallback(self.spinner["timer"].timeout, self.updateSpinner) self.spinner["timer_interval"] = 200 self.spinner["enabled"] = False ############################################# self["actions"] = ActionMap(['IPTVAlternateVideoPlayer', 'MoviePlayerActions', 'MediaPlayerActions', 'WizardActions', 'DirectionActions'], { "ok": self.key_ok, "back": self.key_back, "left": self.key_left, "right": self.key_right, "up": self.key_up, "down": self.key_down, }, -1) self.onClose.append(self.__onClose) #self.onShow.append(self.onStart) self.onLayoutFinish.append(self.onStart)
def __init__(self, session): Screen.__init__(self, session) self.setTitle(_("About")) hddsplit = 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 == 'gbx34k': BoxName = "GigaBlue X3 4k" elif boxtype == 'gbtrio4k': BoxName = "GigaBlue TRIO 4k" elif boxtype == 'gbip4k': BoxName = "GigaBlue IP 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" cpu = about.getCPUInfoString() CPUinfo = _("CPU: ") + cpu 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' or boxtype == 'gbx34k': 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() in ('gb7252', 'gb72604'): 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.split('/')[0], getDesktop(0).size().width(), getDesktop(0).size().height()) self["EnigmaSkin"] = StaticText(EnigmaSkin) AboutText += EnigmaSkin + "\n" AboutText += _( "Python version: ") + about.getPythonVersionString() + "\n" AboutText += _( "Enigma2 debug level:\t%d") % eGetEnigmaDebugLvl() + "\n" GStreamerVersion = _("GStreamer: ") + about.getGStreamerVersionString( cpu).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 storage devices:")) AboutText += "\n" + _("Detected storage devices:") + "\n" hddlist = harddiskmanager.HDDList() hddinfo = "" if hddlist: formatstring = hddsplit and "%s:%s, %.1f %s %s" or "%s\n(%s, %.1f %s %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, _("GB"), _("free")) else: hddinfo += formatstring % (hdd.model(), hdd.capacity(), hdd.free(), _("MB"), _("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] AboutText += '\n\n' + _("Uptime") + ": " + about.getBoxUptime() if SystemInfo["HasHDMI-CEC"] and config.hdmicec.enabled.value: address = config.hdmicec.fixed_physical_address.value if config.hdmicec.fixed_physical_address.value != "0.0.0.0" else _( "not set") AboutText += "\n\n" + _("HDMI-CEC address") + ": " + address 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 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 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()) 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 __init__(self, session, args=0): Screen.__init__(self, session) self.skinName = ["Setup"] config.easysetup = ConfigSubsection() config.easysetup.restart = ConfigBoolean(default=False) config.easysetup.backup = ConfigYesNo(default=True) config.easysetup.hddsetup = ConfigYesNo(default=False) config.easysetup.records = ConfigYesNo(default=False) config.easysetup.timeshift = ConfigYesNo(default=False) config.easysetup.Keymap = ConfigYesNo(default=False) config.easysetup.Hotkey = ConfigYesNo(default=False) config.easysetup.channellist = ConfigYesNo(default=False) config.easysetup.m3u = ConfigYesNo(default=False) config.easysetup.menusort = ConfigYesNo(default=False) config.easysetup.hdmicec = ConfigYesNo(default=False) config.easysetup.password = ConfigYesNo(default=False) config.easysetup.displaysetup = ConfigYesNo(default=False) config.wizardsetup.UserInterfacePositionerWizard = ConfigYesNo( default=False) config.wizardsetup.OpenWebifConfig = ConfigYesNo(default=False) config.wizardsetup.OpenNFRaddonsWizardSetup = ConfigYesNo( default=False) config.wizardsetup.poweroffsetup = ConfigYesNo(default=False) config.wizardsetup.ipkinstall = ConfigYesNo(default=False) self.backup = '0' self.runed = '0' self['spaceused'] = ProgressBar() self["status"] = ScrollLabel() self.onShown.append(self.setWindowTitle) self["description"] = Label(_("")) list = [] list.append( getConfigListEntry( _('Enable Fullbackup after Easy-Setup?'), config.easysetup.backup, _("Default is enable and Fullbackup will start after all Setups are ready." ))) list.append( getConfigListEntry( _('Enable HDD/USB/SD Mounts Setup?'), config.easysetup.hddsetup, _("Choose your Device mounts (USB, HDD, others...)."))) list.append( getConfigListEntry(_('Enable Records Setup?'), config.easysetup.records, _("Choose your recording config."))) list.append( getConfigListEntry(_('Enable Timeshift Setup?'), config.easysetup.timeshift, _("Choose your timeshift config."))) list.append( getConfigListEntry(_('Enable Keymap Setup?'), config.easysetup.Keymap, _("Choose your keymap."))) list.append( getConfigListEntry(_('Enable Hotkey Setup?'), config.easysetup.Hotkey, _("Choose your remote buttons."))) list.append( getConfigListEntry(_('Enable Channellist Setup?'), config.easysetup.channellist, _("Choose your Channel selection config."))) list.append( getConfigListEntry( _('Enable M3U Convert to Channellist Setup?'), config.easysetup.m3u, _("Install your IPTV-m3u-files into channellist.\nFirst you must coppy a M3U-List to /etc/enigma2" ))) if os.path.isfile( "/usr/lib/enigma2/python/Plugins/Extensions/MenuSort/plugin.pyo" ) is True: list.append( getConfigListEntry(_('Enable Menusort Setup?'), config.easysetup.menusort, _("Choose your Mainmenu sorts."))) if os.path.isfile( "/usr/lib/enigma2/python/Plugins/SystemPlugins/HdmiCEC/plugin.pyo" ) is True: list.append( getConfigListEntry(_('Enable HDMI-CEC Setup?'), config.easysetup.hdmicec, _("Choose your HDMI-CEC config."))) list.append( getConfigListEntry( _('Enable Password change?'), config.easysetup.password, _("Change the rootpassword for login in ftp, telnet and webif." ))) list.append( getConfigListEntry(_('Enable Display Setup?'), config.easysetup.displaysetup, _("Choose your Display config."))) list.append( getConfigListEntry( _('Enable Position Setup?'), config.wizardsetup.UserInterfacePositionerWizard, _("Choose your OSD Position in TV"))) list.append( getConfigListEntry(_('Enable OpenWebif Setup?'), config.wizardsetup.OpenWebifConfig, _("Choose your Openwebif config."))) list.append( getConfigListEntry(_('Enable OpenNFR-Addons Setup?'), config.wizardsetup.OpenNFRaddonsWizardSetup, _("Install OpenNFR Plugins."))) list.append( getConfigListEntry( _('Enable Install local extension Setup?'), config.wizardsetup.ipkinstall, _("Scan for local extensions and install them."))) list.append( getConfigListEntry( _('Enable Power Off Menu Setup?'), config.wizardsetup.poweroffsetup, _("Choose your Powerbutton Funktion on Remotecontrol."))) self["key_red"] = Label(_("Exit")) self["key_green"] = Label(_("Start Easy-Setup")) self['label1'] = Label(_('')) self['label2'] = Label(_('% Flash Used....')) self['label3'] = Label(_('')) ConfigListScreen.__init__(self, list) self['actions'] = ActionMap( ['OkCancelActions', 'ColorActions'], { 'red': self.dontSaveAndExit, 'green': self.run1, 'cancel': self.dontSaveAndExit }, -1)
def __init__(self, session): Screen.__init__(self, session) self.setTitle(_("Translation")) # 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 = "(N/A)" infolines = _("").split("\n") infomap = {} for x in infolines: l = x.split(': ') if len(l) != 2: continue (type, value) = l infomap[type] = value #print infomap self["actions"] = ActionMap(["SetupActions"], { "cancel": self.close, "ok": self.close }) translator_name = infomap.get("Language-Team", "none") if translator_name == "none": translator_name = infomap.get("Last-Translator", "") self["TranslatorName"] = StaticText(translator_name) linfo = "" linfo += _("Translations Info") + ":" + "\n\n" linfo += _("Project") + ":" + infomap.get("Project-Id-Version", "") + "\n" linfo += _("Language") + ":" + infomap.get("Language", "") + "\n" print infomap.get("Language-Team", "") if infomap.get("Language-Team", "") == "" or infomap.get( "Language-Team", "") == "none": linfo += _("Language Team") + ":" + "n/a" + "\n" else: linfo += _("Language Team") + ":" + infomap.get( "Language-Team", "") + "\n" linfo += _("Last Translator") + ":" + translator_name + "\n" linfo += "\n" linfo += _("Source Charset") + ":" + infomap.get( "X-Poedit-SourceCharset", "") + "\n" linfo += _("Content Type") + ":" + infomap.get("Content-Type", "") + "\n" linfo += _("Content Encoding") + ":" + infomap.get( "Content-Transfer-Encoding", "") + "\n" linfo += _("MIME Version") + ":" + infomap.get("MIME-Version", "") + "\n" linfo += "\n" linfo += _("POT-Creation Date") + ":" + infomap.get( "POT-Creation-Date", "") + "\n" linfo += _("Revision Date") + ":" + infomap.get( "PO-Revision-Date", "") + "\n" linfo += "\n" linfo += _("Generator") + ":" + infomap.get("X-Generator", "") + "\n" if infomap.get("Report-Msgid-Bugs-To", "") != "": linfo += _("Report Msgid Bugs To") + ":" + infomap.get( "Report-Msgid-Bugs-To", "") + "\n" else: linfo += _( "Report Msgid Bugs To") + ":" + "*****@*****.**" + "\n" self["AboutScrollLabel"] = ScrollLabel(linfo)
def __init__(self, session): Screen.__init__(self, session) self.setTitle(_('About')) hddsplit = skin.parameters.get('AboutHddSplit', 0) TSVer = 'OpenTSimage' f = open('/etc/imageversion', 'r') TSVer = f.readline().strip() f.close() TSRev = '' f = open('/etc/TSRev', 'r') TSRev = f.readline().strip() f.close() AboutText = _('OpenTSimage ') + TSVer + '\n' AboutText += _('Support: REDOUANE [email protected]') + '\n\n' AboutText += _('Hardware: ') + about.getHardwareTypeString() + '\n' AboutText += _('CPU: ') + about.getCPUInfoString() + '\n' # AboutText += _("Build date: ") + about.getBuildDateString() + "\n" # [WanWizard] Removed until we find a reliable way to determine the installation date # AboutText += _("Installed: ") + about.getFlashDateString() + "\n" # [WanWizard] No longer that relevant as we now have an accurate build date # as I'm not sure this variable isn't used elsewhere, I haven't removed it #ImageVersion = _('Last upgrade: ') + about.getImageVersionString() #self['ImageVersion'] = StaticText(ImageVersion) #AboutText += ImageVersion + '\n' self["ImageVersion"] = StaticText('Firmware: ' + TSVer + ' ' + TSRev) EnigmaVersion = about.getEnigmaVersionString() EnigmaVersion = EnigmaVersion.rsplit("-", EnigmaVersion.count("-") - 2) if len(EnigmaVersion) == 3: EnigmaVersion = EnigmaVersion[0] + " " + EnigmaVersion[ 2] + "-" + EnigmaVersion[1] else: EnigmaVersion = " ".join(EnigmaVersion) 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 createscreen(self): self.AboutText = "" self.iface = "eth0" eth0 = about.getIfConfig('eth0') if eth0.has_key('addr'): self.iface = 'eth0' eth1 = about.getIfConfig('eth1') if eth1.has_key('addr'): self.iface = 'eth1' ra0 = about.getIfConfig('ra0') if ra0.has_key('addr'): self.iface = 'ra0' wlan0 = about.getIfConfig('wlan0') if wlan0.has_key('addr'): self.iface = 'wlan0' self.AboutText += iNetwork.getFriendlyAdapterName( self.iface) + ":" + iNetwork.getFriendlyAdapterDescription( self.iface) + "\n" def nameserver(): nameserver = "" v4 = 0 v6 = 0 ns4 = "" ns6 = "" datei = open("/etc/resolv.conf", "r") for line in datei.readlines(): line = line.strip() if "nameserver" in line: if line.count(".") == 3: v4 = v4 + 1 ns4 += str(v4) + ".IPv4 Nameserver" + ":" + line.strip( ).replace("nameserver ", "") + "\n" if line.count(":") > 1 and line.count(":") < 8: v6 = v6 + 1 ns6 += str(v6) + ".IPv6 Nameserver" + ":" + line.strip( ).replace("nameserver ", "") + "\n" nameserver = ns4 + ns6 datei.close() return nameserver.strip() def domain(): domain = "" for line in open('/etc/resolv.conf', 'r'): line = line.strip() if "domain" in line: domain += line.strip().replace("domain ", "") return domain else: domain = _("no domain name found") return domain def gateway(): gateway = "" for line in popen('ip route show'): line = line.strip() if "default via " in line: line = line.split(' ') line = line[2] return line else: line = _("no gateway found") return line 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) if eth0.has_key('addr'): if eth0.has_key('ifname'): self.AboutText += _('Interface: /dev/' + eth0['ifname'] + "\n") self.AboutText += _("Network Speed:") + netspeed() + "\n" if eth0.has_key('hwaddr'): self.AboutText += _("MAC:") + eth0['hwaddr'] + "\n" self.AboutText += "\n" + _("IP:") + eth0['addr'] + "\n" self.AboutText += _("Gateway:") + gateway() + "\n" self.AboutText += nameserver() + "\n" if eth0.has_key('netmask'): self.AboutText += _("Netmask:") + eth0['netmask'] + "\n" if eth0.has_key('brdaddr'): if eth0['brdaddr'] == "0.0.0.0": self.AboutText += _('Broadcast:') + _("DHCP is off") + "\n" else: self.AboutText += _('Broadcast:' + eth0['brdaddr'] + "\n") self.AboutText += _("Domain:") + domain() + "\n" self.iface = 'eth0' eth1 = about.getIfConfig('eth1') if eth1.has_key('addr'): if eth1.has_key('ifname'): self.AboutText += _('Interface:/dev/' + eth1['ifname'] + "\n") self.AboutText += _("NetSpeed:") + netspeed_eth1() + "\n" if eth1.has_key('hwaddr'): self.AboutText += _("MAC:") + eth1['hwaddr'] + "\n" self.AboutText += "\n" + _("IP:") + eth1['addr'] + "\n" self.AboutText += _("Gateway:") + gateway() + "\n" self.AboutText += nameserver() + "\n" if eth1.has_key('netmask'): self.AboutText += _("Netmask:") + eth1['netmask'] + "\n" if eth1.has_key('brdaddr'): if eth1['brdaddr'] == "0.0.0.0": self.AboutText += _('Broadcast:') + _("DHCP is off") + "\n" else: self.AboutText += _('Broadcast:' + eth1['brdaddr'] + "\n") self.AboutText += _("Domain:") + domain() + "\n" self.iface = 'eth1' ra0 = about.getIfConfig('ra0') if ra0.has_key('addr'): if ra0.has_key('ifname'): self.AboutText += _('Interface:/dev/') + ra0['ifname'] + "\n" self.AboutText += "\n" + _("IP:") + ra0['addr'] + "\n" if ra0.has_key('netmask'): self.AboutText += _("Netmask:") + ra0['netmask'] + "\n" if ra0.has_key('brdaddr'): self.AboutText += _("Broadcast:") + ra0['brdaddr'] + "\n" if ra0.has_key('hwaddr'): self.AboutText += _("MAC:") + ra0['hwaddr'] + "\n" self.iface = 'ra0' wlan0 = about.getIfConfig('wlan0') if wlan0.has_key('addr'): if wlan0.has_key('ifname'): self.AboutText += _('Interface:/dev/') + wlan0['ifname'] + "\n" if wlan0.has_key('hwaddr'): self.AboutText += _("MAC:") + wlan0['hwaddr'] + "\n" self.AboutText += "\n" + _("IP:") + wlan0['addr'] + "\n" self.AboutText += _("Gateway:") + gateway() + "\n" self.AboutText += nameserver() + "\n" if wlan0.has_key('netmask'): self.AboutText += _("Netmask:") + wlan0['netmask'] + "\n" if wlan0.has_key('brdaddr'): if wlan0['brdaddr'] == "0.0.0.0": self.AboutText += _('Broadcast:') + _("DHCP is off") + "\n" else: self.AboutText += _('Broadcast:') + wlan0['brdaddr'] + "\n" self.AboutText += _("Domain:") + domain() + "\n" self.iface = 'wlan0' #not use this , adapter make reset after 4GB (32bit restriction) #rx_bytes, tx_bytes = about.getIfTransferredData(self.iface) #self.AboutText += "\n" + _("Bytes received:") + "\t" + rx_bytes + ' (~' + str(int(rx_bytes)/1024/1024) + ' MB)' + "\n" #self.AboutText += _("Bytes sent:") + "\t" + tx_bytes + ' (~' + str(int(tx_bytes)/1024/1024)+ ' MB)' + "\n" hostname = file('/proc/sys/kernel/hostname').read() self.AboutText += _("Hostname:") + hostname + "\n" self["AboutScrollLabel"] = ScrollLabel(self.AboutText)
def createscreen(self): self.AboutText = "" self.iface = "eth0" eth0 = about.getIfConfig('eth0') if eth0.has_key('addr'): if eth0.has_key('ifname'): self.AboutText += _('Interface:\t/dev/' + eth0['ifname'] + "\n") self.AboutText += _("IP:") + "\t" + eth0['addr'] + "\n" if eth0.has_key('netmask'): self.AboutText += _("Netmask:") + "\t" + eth0['netmask'] + "\n" if eth0.has_key('brdaddr'): self.AboutText += _('Broadcast:\t' + eth0['brdaddr'] + "\n") if eth0.has_key('hwaddr'): self.AboutText += _("MAC:") + "\t" + eth0['hwaddr'] + "\n" self.iface = 'eth0' eth1 = about.getIfConfig('eth1') if eth1.has_key('addr'): if eth1.has_key('ifname'): self.AboutText += _('Interface:\t/dev/' + eth1['ifname'] + "\n") self.AboutText += _("IP:") + "\t" + eth1['addr'] + "\n" if eth1.has_key('netmask'): self.AboutText += _("Netmask:") + "\t" + eth1['netmask'] + "\n" if eth1.has_key('brdaddr'): self.AboutText += _('Broadcast:\t' + eth1['brdaddr'] + "\n") if eth1.has_key('hwaddr'): self.AboutText += _("MAC:") + "\t" + eth1['hwaddr'] + "\n" self.iface = 'eth1' ra0 = about.getIfConfig('ra0') if ra0.has_key('addr'): if ra0.has_key('ifname'): self.AboutText += _('Interface:\t/dev/' + ra0['ifname'] + "\n") self.AboutText += _("IP:") + "\t" + ra0['addr'] + "\n" if ra0.has_key('netmask'): self.AboutText += _("Netmask:") + "\t" + ra0['netmask'] + "\n" if ra0.has_key('brdaddr'): self.AboutText += _('Broadcast:\t' + ra0['brdaddr'] + "\n") if ra0.has_key('hwaddr'): self.AboutText += _("MAC:") + "\t" + ra0['hwaddr'] + "\n" self.iface = 'ra0' wlan0 = about.getIfConfig('wlan0') if wlan0.has_key('addr'): if wlan0.has_key('ifname'): self.AboutText += _('Interface:\t/dev/' + wlan0['ifname'] + "\n") self.AboutText += _("IP:") + "\t" + wlan0['addr'] + "\n" if wlan0.has_key('netmask'): self.AboutText += _( "Netmask:") + "\t" + wlan0['netmask'] + "\n" if wlan0.has_key('brdaddr'): self.AboutText += _('Broadcast:\t' + wlan0['brdaddr'] + "\n") if wlan0.has_key('hwaddr'): self.AboutText += _("MAC:") + "\t" + wlan0['hwaddr'] + "\n" self.iface = 'wlan0' rx_bytes, tx_bytes = about.getIfTransferredData(self.iface) self.AboutText += "\n" + _( "Bytes received:") + "\t" + rx_bytes + ' (~' + str( int(rx_bytes) / 1024 / 1024) + ' MB)' + "\n" self.AboutText += _("Bytes sent:") + "\t" + tx_bytes + ' (~' + str( int(tx_bytes) / 1024 / 1024) + ' MB)' + "\n" hostname = file('/proc/sys/kernel/hostname').read() self.AboutText += "\n" + _("Hostname:") + "\t" + hostname + "\n" self["AboutScrollLabel"] = ScrollLabel(self.AboutText)
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 __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 })
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["canMultiBoot"]: image = GetCurrentImage() bootmode = "" part = "" if SystemInfo["canMode12"]: bootmode = "bootmode = %s" %GetCurrentImageMode() if SystemInfo["HasHiSi"]: if image != 0: part = "%s%s" %(SystemInfo["canMultiBoot"][2], image*2) image += 1 else: part = "MMC" image += 1 AboutText += _("Image Slot:\t%s") % "STARTUP_" + str(image) + " " + 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 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: 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 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 populate(self): if isVTISkin: 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() self.tuner_list = [] if len(nims) <= 4: for count in (0, 1, 2, 3, 4, 5, 6, 7): if count < len(nims): self["Tuner" + str(count)] = StaticText(nims[count]) self.tuner_list.append((nims[count] + "\n")) else: self["Tuner" + str(count)] = StaticText("") 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, 4, 5, 6, 7): 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)] = StaticText(text) if text != "": self.tuner_list.append(text + "\n") 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.enigma2_version = _( "Version") + ": " + about.getEnigmaVersionString() self.image_version = _( "Image") + ": " + about.getImageVersionString() cpu_info = parseLines("/proc/cpuinfo") cpu_name = "N/A" for line in cpu_info: if line.find('model') != -1: cpu_name = line.split(':') if len(cpu_name) >= 2: cpu_name = cpu_name[1].strip() break self.cpu = _("CPU") + ": " + cpu_name self.chipset = _("Chipset") + ": " + parseFile( "/proc/stb/info/chipset") self.tuner_header = _("Detected NIMs:") self.hdd_header = _("Detected HDD:") self.hdd_list = [] if len(hddlist): for hddX in hddlist: hdd = hddX[1] if hdd.model() != "": self.hdd_list.append( (hdd.model() + "\n %.2f GB - %.2f GB" % (hdd.diskSize() / 1000.0, hdd.free() / 1000.0) + " " + _("free") + "\n\n")) ifaces = iNetwork.getConfiguredAdapters() iface_list = [] for iface in ifaces: iface_list.append( (_("Interface") + " : " + iNetwork.getAdapterName(iface) + " (" + iNetwork.getFriendlyAdapterName(iface) + ")\n")) iface_list.append( (_("IP") + " : " + parse_ipv4(iNetwork.getAdapterAttribute(iface, "ip")) + "\n")) iface_list.append((_("Netmask") + " : " + parse_ipv4( iNetwork.getAdapterAttribute(iface, "netmask")) + "\n")) iface_list.append((_("Gateway") + " : " + parse_ipv4( iNetwork.getAdapterAttribute(iface, "gateway")) + "\n")) if iNetwork.getAdapterAttribute(iface, "dhcp"): iface_list.append((_("DHCP") + " : " + _("Yes") + "\n")) else: iface_list.append((_("DHCP") + " : " + _("No") + "\n")) iface_list.append( (_("MAC") + " : " + iNetwork.getAdapterAttribute(iface, "mac") + "\n")) iface_list.append(("\n")) my_txt = self.enigma2_version + "\n" my_txt += self.image_version + "\n" my_txt += "\n" my_txt += self.cpu + "\n" my_txt += self.chipset + "\n" my_txt += "\n" my_txt += self.tuner_header + "\n" for x in self.tuner_list: my_txt += " " + x my_txt += "\n" my_txt += _("Network") + ":\n" for x in iface_list: my_txt += " " + x my_txt += self.hdd_header + "\n" for x in self.hdd_list: my_txt += " " + x my_txt += "\n" self["FullAbout"] = ScrollLabel(my_txt) else: self["lab1"] = StaticText(_("openATV")) self["lab2"] = StaticText(_("By openATV Image Team")) self["lab3"] = StaticText(_("Support at") + " www.opena.tv") model = None AboutText = getAboutText()[0] self["AboutScrollLabel"] = ScrollLabel(AboutText)
def __init__(self, session, eventName, callbackNeeded=False): Screen.__init__(self, session) self.eventName = eventName self.callbackNeeded = callbackNeeded self.callbackData = "" self.callbackGenre = "" self.dictionary_init() self["poster"] = Pixmap() self.picload = ePicLoad() self.picload.PictureData.get().append(self.paintPosterPixmapCB) self["stars"] = ProgressBar() self["starsbg"] = Pixmap() self["stars"].hide() self["starsbg"].hide() self.ratingstars = -1 self["title"] = StaticText(_("The Internet Movie Database")) # map new source -> old component def setText(txt): StaticText.setText(self["title"], txt) self["titellabel"].setText(txt) self["title"].setText = setText self["titellabel"] = Label() self["detailslabel"] = ScrollLabel("") self["castlabel"] = ScrollLabel("") self["extralabel"] = ScrollLabel("") self["statusbar"] = Label("") self["ratinglabel"] = Label("") self.resultlist = [] self["menu"] = MenuList(self.resultlist) self["menu"].hide() self["key_red"] = Button(_("Exit")) self["key_green"] = Button("") self["key_yellow"] = Button("") self["key_blue"] = Button("") # 0 = multiple query selection menu page # 1 = movie info page # 2 = extra infos page self.Page = 0 self["actions"] = ActionMap( [ "OkCancelActions", "ColorActions", "MovieSelectionActions", "DirectionActions" ], { "ok": self.showDetails, "cancel": self.exit, "down": self.pageDown, "up": self.pageUp, "red": self.exit, "green": self.showMenu, "yellow": self.showDetails, "blue": self.showExtras, "contextMenu": self.contextMenuPressed, "showEventInfo": self.showDetails }, -1) self.getIMDB()
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() AboutText += _("Version:\t%s\n") % getImageVersion() AboutText += _("Build:\t%s\n") % getImageBuild() 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\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 __init__(self, session, searchTitle, service=None): Screen.__init__(self, session) HelpableScreen.__init__(self) InfoLoadChoice.__init__(self, self.callback_green_pressed) self.skinName = SkinTools.appendResolution('TMDbMain') self.service = service self.movies = [] if not os_path.exists(IMAGE_TEMPFILE): os_mkdir(IMAGE_TEMPFILE) self['ColorActions'] = HelpableActionMap( self, 'ColorActions', { 'red': (self.ok_pressed, _('Toggle detail and list view')), 'green': (self.green_pressed, _('Save info/cover')), 'yellow': (self.yellow_pressed, _('Manual search')), 'blue': (self.blue_pressed, _('Trailer search')) }, -1) self['WizardActions'] = HelpableActionMap( self, 'WizardActions', { 'ok': (self.ok_pressed, _('Toggle detail and list view')), 'back': (self.cancel, _('Close')), 'up': (self.moveUp, _('Move up')), 'down': (self.moveDown, _('Move down')) }, -1) self['WizardActions2'] = HelpableActionMap( self, 'WizardActions', { 'left': (self.left, _('Show previous cover')), 'right': (self.right, _('Show next cover')) }, -1) self['ChannelSelectBaseActions'] = HelpableActionMap( self, 'ChannelSelectBaseActions', { 'nextMarker': (self.right, _('Show next cover')), 'prevMarker': (self.left, _('Show previous cover')) }, -1) self['list'] = TMDbList() self['tmdblogo'] = Pixmap() self['cover'] = Pixmap() self.picload = ePicLoad() self.picload.PictureData.get().append(self.paintCoverPixmapCB) self['description'] = ScrollLabel() self['extended'] = Label() self['status'] = Label() self['stars'] = ProgressBar() self['no_stars'] = Pixmap() self['vote'] = Label() self['result_txt'] = Label() self['seperator'] = Pixmap() self['button_red'] = Pixmap() self['button_green'] = Pixmap() self['button_yellow'] = Pixmap() self['button_blue'] = Pixmap() self['key_red'] = StaticText('') self['key_green'] = StaticText('') self['key_yellow'] = StaticText('') self['key_blue'] = StaticText('') self.ratingstars = -1 self.searchTitle = searchTitle self.downloadItems = {} self.useTMDbInfoAsEventInfo = True self.timer = eTimer() self.timer.callback.append(self.searchForMovies) self.blue_button_timer = eTimer() self.blue_button_timer.callback.append(self.callback_blue_pressed) self.onClose.append(self.deleteTempDir) self.onLayoutFinish.append(self.layoutFinished) self.view_mode = self.SHOW_SEARCH self.tmdb3 = tmdb.init_tmdb3() self.updateView() self.startSearch()
def __init__(self, session, menu_path=""): Screen.__init__(self, session) screentitle = _("Memory") if config.usage.show_menupath.value == 'large': menu_path += screentitle title = menu_path self["menu_path_compressed"] = StaticText("") elif config.usage.show_menupath.value == 'small': title = screentitle self["menu_path_compressed"] = StaticText( menu_path + " >" if not menu_path.endswith(' / ') else menu_path[:-3] + " >" or "") else: title = screentitle self["menu_path_compressed"] = StaticText("") Screen.setTitle(self, title) self.skinName = ["SystemMemoryInfo", "About"] self["lab1"] = StaticText(_("Virtuosso Image Xtreme")) self["lab2"] = StaticText(_("By Team ViX")) self["lab3"] = StaticText( _("Support at %s") % "www.world-of-satellite.com") self["AboutScrollLabel"] = ScrollLabel() self["key_red"] = Button(_("Close")) self["actions"] = ActionMap(["SetupActions", "ColorActions"], { "cancel": self.close, "ok": self.close, "red": self.close, }) out_lines = file("/proc/meminfo").readlines() self.AboutText = _("RAM") + '\n\n' RamTotal = "-" RamFree = "-" for lidx in range(len(out_lines) - 1): tstLine = out_lines[lidx].split() if "MemTotal:" in tstLine: MemTotal = out_lines[lidx].split() self.AboutText += _( "Total memory:") + "\t" + MemTotal[1] + "\n" if "MemFree:" in tstLine: MemFree = out_lines[lidx].split() self.AboutText += _("Free memory:") + "\t" + MemFree[1] + "\n" if "Buffers:" in tstLine: Buffers = out_lines[lidx].split() self.AboutText += _("Buffers:") + "\t" + Buffers[1] + "\n" if "Cached:" in tstLine: Cached = out_lines[lidx].split() self.AboutText += _("Cached:") + "\t" + Cached[1] + "\n" if "SwapTotal:" in tstLine: SwapTotal = out_lines[lidx].split() self.AboutText += _("Total swap:") + "\t" + SwapTotal[1] + "\n" if "SwapFree:" in tstLine: SwapFree = out_lines[lidx].split() self.AboutText += _("Free swap:") + "\t" + SwapFree[1] + "\n\n" self["actions"].setEnabled(False) self.Console = Console() self.Console.ePopen("df -mh / | grep -v '^Filesystem'", self.Stage1Complete)
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 += _("Info: www.nonsolosat.net") + "\n" # [WanWizard] Removed until we find a reliable way to determine the installation date # AboutText += _("Installed: ") + about.getFlashDateString() + "\n" # [WanWizard] No longer that relevant as we now have an accurate build date # as I'm not sure this variable isn't used elsewhere, I haven't removed it ImageVersion = _("Last upgrade: ") + about.getImageVersionString() self["ImageVersion"] = StaticText(ImageVersion) # AboutText += ImageVersion + "\n" EnigmaVersion = about.getEnigmaVersionString() EnigmaVersion = EnigmaVersion.rsplit("-", EnigmaVersion.count("-") - 2) if len(EnigmaVersion) == 3: EnigmaVersion = EnigmaVersion[0] + " " + EnigmaVersion[ 2] + "-" + EnigmaVersion[1] else: EnigmaVersion = " ".join(EnigmaVersion) 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 20-30','r'): line = line.strip() netspeed += line return str(netspeed) def netspeed_wlan0(): netspeed="" for line in popen('iwconfig wlan0 | grep Bit | cut -c 20-30','r'): line = line.strip() netspeed += line return str(netspeed) def netspeed_wlan1(): netspeed="" for line in popen('iwconfig wlan1 | grep Bit | cut -c 20-30','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','gbx34k'): 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','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 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" 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" 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 SystemInfo["HaveMultiBoot"]: MyFlashDate = about.getFlashDateString() if path.isfile("/etc/filesystems"): AboutText += _("Flashed:\t%s") % MyFlashDate + "\n" #AboutText += _("Flashed:\tMultiboot active\n") else: AboutText += _("Flashed:\t%s\n") % about.getFlashDateString() 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() 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 += _("Uptime") + ":\t" + about.getBoxUptime() + "\n" if SystemInfo["WakeOnLAN"]: if fileCheck("/proc/stb/power/wol"): WOLmode = open("/proc/stb/power/wol").read()[:-1] if fileCheck("/proc/stb/fp/wol"): WOLmode = open("/proc/stb/fp/wol").read()[:-1] AboutText += _("WakeOnLAN:\t%s\n") % WOLmode 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)