Example #1
0
	def ContainterFallback(self, data=None, retval=None, extra_args=None):
		self.container.killAll()
		slot = self.currentSelected[0][1]
		mode = GetCurrentImageMode() or 0
		currentimageslot = GetCurrentImage() or 1
		if pathExists("/tmp/startupmount/%s" %GetSTARTUPFile()):
			if currentimageslot == slot and SystemInfo["canMode12"]:
				if mode == 12:
					startupFileContents = ReadSTARTUP().replace("boxmode=12'","boxmode=1'").replace(SystemInfo["canMode12"][1],SystemInfo["canMode12"][0])
					open('/tmp/startupmount/%s'%GetSTARTUPFile(), 'w').write(startupFileContents)
				else:
					startupFileContents = ReadSTARTUP().replace("boxmode=1'","boxmode=12'").replace(SystemInfo["canMode12"][0],SystemInfo["canMode12"][1])
					open('/tmp/startupmount/%s'%GetSTARTUPFile(), 'w').write(startupFileContents)
			elif  fileExists("/tmp/startupmount/STARTUP_1"):
				copyfile("/tmp/startupmount/STARTUP_%s" % slot, "/tmp/startupmount/%s" %GetSTARTUPFile())
			elif fileExists("/tmp/startupmount/STARTUP_LINUX_4_BOXMODE_12"):
				if mode == 1:
					copyfile("/tmp/startupmount/STARTUP_LINUX_%s_BOXMODE_1" % slot, "/tmp/startupmount/%s" %GetSTARTUPFile())
				else:
					copyfile("/tmp/startupmount/STARTUP_LINUX_%s_BOXMODE_12" % slot, "/tmp/startupmount/%s" %GetSTARTUPFile())
			elif fileExists("/tmp/startupmount/STARTUP_LINUX_4"):
				copyfile("/tmp/startupmount/STARTUP_LINUX_%s" % slot, "/tmp/startupmount/%s" %GetSTARTUPFile())

			message = _("Do you want to reboot now the image in slot %s?") %slot
			self.session.openWithCallback(self.restartImage,MessageBox, message, MessageBox.TYPE_YESNO, timeout=20)
		else:
			self.session.open(MessageBox, _("Multiboot ERROR! - no %s in boot partition.") %GetSTARTUPFile(), MessageBox.TYPE_INFO, timeout=20)
Example #2
0
 def getImagelistCallback(self, imagesdict):
     list = []
     currentimageslot = GetCurrentImage()
     mode = GetCurrentImageMode() or 0
     if imagesdict:
         for x in sorted(imagesdict.keys()):
             if imagesdict[x]["imagename"] != _("Empty slot"):
                 if SystemInfo["canMode12"]:
                     list.append(
                         ChoiceEntryComponent(
                             '', ((_("slot%s - %s mode 1 (current image)")
                                   if x == currentimageslot and mode != 12
                                   else _("slot%s - %s mode 1")) %
                                  (x, imagesdict[x]['imagename']), x)))
                     list.append(
                         ChoiceEntryComponent(
                             '', ((_("slot%s - %s mode 12 (current image)")
                                   if x == currentimageslot and mode == 12
                                   else _("slot%s - %s mode 12")) %
                                  (x, imagesdict[x]['imagename']), x + 12)))
                 else:
                     list.append(
                         ChoiceEntryComponent(
                             '', ((_("slot%s - %s (current image)")
                                   if x == currentimageslot and mode != 12
                                   else _("slot%s - %s")) %
                                  (x, imagesdict[x]['imagename']), x)))
     else:
         list.append(
             ChoiceEntryComponent('', ((_("No images found")), "Waiter")))
     self["list"].setList(list)
Example #3
0
	def getImagelist(self):
		self.imagedict = GetImagelist()
		list = []
		self.deletedImagesExists = False
		currentimageslot = SystemInfo["MultiBootSlot"]
		mode = GetCurrentImageMode() or 0
		print("[MultiBootSelector] reboot0 slot:", currentimageslot)
		current = "  %s" % _("(Current)")
		slotSingle = _("Slot%s %s: %s%s")
		slotMulti = _("Slot%s %s: %s - %s mode%s")

		if self.imagedict:
			indextot = 0
			for index, x in enumerate(sorted(self.imagedict.keys())):
				if self.imagedict[x]["imagename"] == _("Deleted image"):
					self.deletedImagesExists = True
				if SystemInfo["canMode12"]:
					if self.imagedict[x]["imagename"] == _("Empty slot"):
						list.insert(index, ChoiceEntryComponent("", (slotSingle % (x, SystemInfo["canMultiBoot"][x]["slotname"], self.imagedict[x]["imagename"], current if x == currentimageslot else ""), (x, 1))))					
					else:
						list.insert(index, ChoiceEntryComponent("", (slotMulti % (x, SystemInfo["canMultiBoot"][x]["slotname"], self.imagedict[x]["imagename"], "Kodi", current if x == currentimageslot and mode != 12 else ""), (x, 1))))
						list.append(ChoiceEntryComponent("", (slotMulti % (x, SystemInfo["canMultiBoot"][x]["slotname"], self.imagedict[x]["imagename"], "PiP", current if x == currentimageslot and mode == 12 else ""), (x, 12))))
					indextot = index + 1
				elif self.imagedict[x]["imagename"] != _("Empty slot"):
					list.append(ChoiceEntryComponent("", (slotSingle % (x, SystemInfo["canMultiBoot"][x]["slotname"], self.imagedict[x]["imagename"], current if x == currentimageslot else ""), (x, 1))))
			if SystemInfo["canMode12"]:
				list.insert(indextot, " ")
		else:
			list.append(ChoiceEntryComponent("", ((_("No images found")), "Waiter")))
		self["config"].setList(list)
		print("[MultiBootSelector] list X = %s" % list)
Example #4
0
 def ImageList(self, imagedict):
     list = []
     mode = GetCurrentImageMode() or 0
     currentimageslot = GetCurrentImage()
     if not SystemInfo["canMode12"]:
         for x in sorted(imagedict.keys()):
             if imagedict[x]["imagename"] != _("Empty slot"):
                 list.append(
                     ChoiceEntryComponent(
                         '', ((_("slot%s - %s (current image)") if x
                               == currentimageslot else _("slot%s - %s ")) %
                              (x, imagedict[x]['imagename']), x)))
     else:
         for x in sorted(imagedict.keys()):
             if imagedict[x]["imagename"] != _("Empty slot"):
                 list.append(
                     ChoiceEntryComponent(
                         '', ((_("slot%s - %s mode 1 (current image)")
                               if x == currentimageslot and mode != 12 else
                               _("slot%s - %s mode 1")) %
                              (x, imagedict[x]['imagename']), x)))
                 if SystemInfo["canMode12"]:
                     list.append(
                         ChoiceEntryComponent(
                             '', ((_("slot%s - %s mode 12 (current image)")
                                   if x == currentimageslot and mode == 12
                                   else _("slot%s - %s mode 12")) %
                                  (x, imagedict[x]['imagename']), x + 12)))
     self["config"].setList(list)
Example #5
0
	def ImageList(self, imagedict):
		list = []
		mode = GetCurrentImageMode() or 0
		currentimageslot = GetCurrentImage()
		for x in sorted(imagedict.keys()):
			if imagedict[x]["imagename"] != _("Empty slot") and x != currentimageslot:
				list.append(ChoiceEntryComponent('',((_("slot%s - %s ")) % (x, imagedict[x]['imagename']), x)))
		self["config"].setList(list)
Example #6
0
 def ImageList(self, imagedict):
     list = []
     mode = GetCurrentImageMode() or 0
     currentimageslot = GetCurrentImage()
     if SystemInfo["HasSDmmc"]:
         currentimageslot += 1
     for x in sorted(list(imagedict.keys())):
         if imagedict[x]["imagename"] != _(
                 "Empty startup") and x != currentimageslot:
             list.append(
                 ChoiceEntryComponent('',
                                      ((_("startup %s - %s ")) %
                                       (x, imagedict[x]['imagename']), x)))
     self["config"].setList(list)
Example #7
0
 def getImagelistCallback(self, imagesdict):
     list = []
     currentimageslot = GetCurrentImage()
     mode = SystemInfo["canMode12"] and GetCurrentImageMode() or 0
     for x in sorted(imagesdict.keys()):
         list.append(
             ChoiceEntryComponent('',
                                  ((_("slot%s - %s mode 1 (current image)")
                                    if x == currentimageslot and mode == 1
                                    else _("slot%s - %s mode 1")) %
                                   (x, imagesdict[x]['imagename']), x)))
         if SystemInfo["canMode12"]:
             list.append(
                 ChoiceEntryComponent(
                     '', ((_("slot%s - %s mode 12 (current image)")
                           if x == currentimageslot and mode == 12 else
                           _("slot%s - %s mode 12")) %
                          (x, imagesdict[x]['imagename']), x + 12)))
     self["list"].setList(list)
	def getImagelistCallback(self, imagesdict):
		list = []
		currentimageslot = GetCurrentImage()
		mode = GetCurrentImageMode() or 0
		if imagesdict:
			for index, x in enumerate(sorted(imagesdict.keys())):
				if imagesdict[x]["imagename"] != _("Empty slot"):
					if SystemInfo["canMode12"]:
						list.insert(index, ChoiceEntryComponent('',((_("slot%s - %s mode 1 (current image)") if x == currentimageslot and mode != 12 else _("slot%s - %s mode 1")) % (x, imagesdict[x]['imagename']), x)))
						list.append(ChoiceEntryComponent('',((_("slot%s - %s mode 12 (current image)") if x == currentimageslot and mode == 12 else _("slot%s - %s mode 12")) % (x, imagesdict[x]['imagename']), x + 12)))
					else:
						list.append(ChoiceEntryComponent('',((_("slot%s - %s (current image)") if x == currentimageslot and mode != 12 else _("slot%s - %s")) % (x, imagesdict[x]['imagename']), x)))
		if os.path.isfile("/tmp/startupmount/STARTUP_RECOVERY"):
			list.append(ChoiceEntryComponent('',((_("Boot to Recovery menu")), "Recovery")))
		if os.path.isfile("/tmp/startupmount/STARTUP_ANDROID"):
			list.append(ChoiceEntryComponent('',((_("Boot to Android image")), "Android")))
		if not list:
			list.append(ChoiceEntryComponent('',((_("No images found")), "Waiter")))
		self["list"].setList(list)
Example #9
0
 def ImageList(self, imagedict):
     list = []
     mode = GetCurrentImageMode() or 0
     currentimageslot = GetCurrentImage()
     print "[MultiBoot Restart] reboot1 slot:\n", currentimageslot
     if SystemInfo["HasSDmmc"]:
         currentimageslot += 1  #allow for mmc as 1st slot, then SDCard slots
         print "[MultiBoot Restart] reboot2 slot:\n", currentimageslot
     if imagedict:
         if not SystemInfo["canMode12"]:
             for x in sorted(imagedict.keys()):
                 if imagedict[x]["imagename"] != _("Empty slot"):
                     list.append(
                         ChoiceEntryComponent(
                             '',
                             ((_("slot%s -%s - %s (current image)") if x ==
                               currentimageslot else _("slot%s -%s- %s ")) %
                              (x, imagedict[x]['part'][0:3],
                               imagedict[x]['imagename']), x)))
         else:
             for x in range(1, SystemInfo["canMultiBoot"][1] + 1):
                 if imagedict[x]["imagename"] != _("Empty slot"):
                     list.append(
                         ChoiceEntryComponent(
                             '', ((_("slot%s - %s mode 1 (current image)")
                                   if x == currentimageslot and mode != 12
                                   else _("slot%s - %s mode 1")) %
                                  (x, imagedict[x]['imagename']), x)))
             list.append("                                 ")
             list.append("                                 ")
             for x in range(1, SystemInfo["canMultiBoot"][1] + 1):
                 if SystemInfo["canMode12"] and imagedict[x][
                         "imagename"] != _("Empty slot"):
                     list.append(
                         ChoiceEntryComponent(
                             '', ((_("slot%s - %s mode 12 (current image)")
                                   if x == currentimageslot and mode == 12
                                   else _("slot%s - %s mode 12")) %
                                  (x, imagedict[x]['imagename']), x + 12)))
     else:
         list.append(
             ChoiceEntryComponent('', ((_("No images found")), "Waiter")))
     self["config"].setList(list)
Example #10
0
    def getImagelistCallback(self, imagedict):
        list = []
        mode = GetCurrentImageMode() or 0
        currentimageslot = GetCurrentImage()
        print '[MultiBootSelector] reboot1 slot:', currentimageslot
        current = '  %s' % _('(current image)')
        slotSingle = _('Slot %s: %s%s')
        slotMulti = _('Slot %s: %s - Mode %d%s')
        if imagedict:
            indextot = 0
            for index, x in enumerate(sorted(imagedict.keys())):
                if imagedict[x]['imagename'] != _('Empty slot'):
                    if SystemInfo['canMode12']:
                        list.insert(
                            index,
                            ChoiceEntryComponent(
                                '',
                                (slotMulti %
                                 (x, imagedict[x]['imagename'], 1, current if x
                                  == currentimageslot and mode != 12 else ''),
                                 x)))
                        list.append(
                            ChoiceEntryComponent('', (
                                slotMulti %
                                (x, imagedict[x]['imagename'], 12, current if
                                 x == currentimageslot and mode == 12 else ''),
                                x + 12)))
                        indextot = index + 1
                    else:
                        list.append(
                            ChoiceEntryComponent(
                                '',
                                (slotSingle %
                                 (x, imagedict[x]['imagename'],
                                  current if x == currentimageslot else ''),
                                 x)))

            if SystemInfo['canMode12']:
                list.insert(indextot, ' ')
        else:
            list.append(
                ChoiceEntryComponent('', (_('No images found'), 'Waiter')))
        self['config'].setList(list)
Example #11
0
 def getImagelistCallback(self, imagedict):
     _list = []
     mode = GetCurrentImageMode() or 0
     currentimageslot = GetCurrentImage()
     print("[MultiBootSelector] reboot1 slot:", currentimageslot)
     current = "  %s" % _("(current image)")
     slotSingle = _("Slot %s: %s%s")
     slotMulti = _("Slot %s: %s - Mode %d%s")
     if imagedict:
         indextot = 0
         for index, x in enumerate(sorted(list(imagedict.keys()))):
             if imagedict[x]["imagename"] != _("Empty slot"):
                 if SystemInfo["canMode12"]:
                     _list.insert(
                         index,
                         ChoiceEntryComponent(
                             "",
                             (slotMulti %
                              (x, imagedict[x]["imagename"], 1, current if x
                               == currentimageslot and mode != 12 else ""),
                              (x, 1))))
                     _list.append(
                         ChoiceEntryComponent("", (
                             slotMulti %
                             (x, imagedict[x]["imagename"], 12, current if
                              x == currentimageslot and mode == 12 else ""),
                             (x, 12))))
                     indextot = index + 1
                 else:
                     _list.append(
                         ChoiceEntryComponent(
                             "",
                             (slotSingle %
                              (x, imagedict[x]["imagename"],
                               current if x == currentimageslot else ""),
                              (x, 1))))
         if SystemInfo["canMode12"]:
             _list.insert(indextot, " ")
     else:
         _list.append(
             ChoiceEntryComponent("", ((_("No images found")), "Waiter")))
     self["config"].setList(_list)
Example #12
0
	def ImageList(self, imagedict):
		list = []
		mode = GetCurrentImageMode() or 0
		currentimageslot = GetCurrentImage()
		if SystemInfo["HasHiSi"] and "sd" in SystemInfo["canMultiBoot"][2]:
			currentimageslot += 1
		if not SystemInfo["canMode12"]:
			for x in sorted(imagedict.keys()):
				if imagedict[x]["imagename"] != _("Empty slot"):
					list.append(ChoiceEntryComponent('',((_("slot%s -%s - %s (current image)") if x == currentimageslot else _("slot%s -%s- %s ")) % (x, imagedict[x]['part'][0:3], imagedict[x]['imagename']), x)))
		else:
			for x in range(1, SystemInfo["canMultiBoot"][1] + 1):
				if imagedict[x]["imagename"] != _("Empty slot"):
					list.append(ChoiceEntryComponent('',((_("slot%s - %s mode 1 (current image)") if x == currentimageslot and mode != 12 else _("slot%s - %s mode 1")) % (x, imagedict[x]['imagename']), x)))
			list.append("                                 ")
			list.append("                                 ")
			for x in range(1, SystemInfo["canMultiBoot"][1] + 1):
					if SystemInfo["canMode12"] and imagedict[x]["imagename"] != _("Empty slot"):
						list.append(ChoiceEntryComponent('',((_("slot%s - %s mode 12 (current image)") if x == currentimageslot and mode == 12 else _("slot%s - %s mode 12")) % (x, imagedict[x]['imagename']), x + 12)))
		self["config"].setList(list)
Example #13
0
    def populate(self):
        self["lab1"] = StaticText(_("Virtuosso Image Xtreme"))
        self["lab2"] = StaticText(_("By Team ViX"))
        model = None
        AboutText = ""
        self["lab3"] = StaticText(
            _("Support at") + " www.world-of-satellite.com")

        AboutText += _("Model:\t%s %s\n") % (getMachineBrand(),
                                             getMachineName())

        if about.getChipSetString() != _("unavailable"):
            if SystemInfo["HasHiSi"]:
                AboutText += _("Chipset:\tHiSilicon %s\n"
                               ) % about.getChipSetString().upper()
            elif about.getIsBroadcom():
                AboutText += _("Chipset:\tBroadcom %s\n"
                               ) % about.getChipSetString().upper()
            else:
                AboutText += _(
                    "Chipset:\t%s\n") % about.getChipSetString().upper()

        AboutText += _("CPU:\t%s %s %s\n") % (about.getCPUArch(),
                                              about.getCPUSpeedString(),
                                              about.getCpuCoresString())
        imageSubBuild = ""
        if getImageType() != 'release':
            imageSubBuild = ".%s" % getImageDevBuild()
        AboutText += _("Image:\t%s.%s%s (%s)\n") % (getImageVersion(
        ), getImageBuild(), imageSubBuild, getImageType().title())

        if SystemInfo["canMultiBoot"]:
            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"

        if getMachineName() in ('ET8500') and path.exists('/proc/mtd'):
            self.dualboot = self.dualBoot()
            if self.dualboot:
                AboutText += _("ET8500 Multiboot: Installed\n")

        skinWidth = getDesktop(0).size().width()
        skinHeight = getDesktop(0).size().height()

        string = getDriverDate()
        year = string[0:4]
        month = string[4:6]
        day = string[6:8]
        driversdate = '-'.join((year, month, day))
        AboutText += _("Drivers:\t%s\n") % driversdate
        AboutText += _("Kernel:\t%s\n") % about.getKernelVersionString()
        AboutText += _("GStreamer:\t%s\n") % about.getGStreamerVersionString(
        ).replace("GStreamer ", "")
        AboutText += _("Python:\t%s\n") % about.getPythonVersionString()
        AboutText += _("Installed:\t%s\n") % about.getFlashDateString()
        AboutText += _("Last update:\t%s\n") % getEnigmaVersionString()
        AboutText += _("E2 (re)starts:\t%s\n") % config.misc.startCounter.value
        AboutText += _("Skin:\t%s") % config.skin.primary_skin.value[0:-9] + _(
            "  (%s x %s)") % (skinWidth, skinHeight) + "\n"

        tempinfo = ""
        if path.exists('/proc/stb/sensors/temp0/value'):
            f = open('/proc/stb/sensors/temp0/value', 'r')
            tempinfo = f.read()
            f.close()
        elif path.exists('/proc/stb/fp/temp_sensor'):
            f = open('/proc/stb/fp/temp_sensor', 'r')
            tempinfo = f.read()
            f.close()
        elif path.exists('/proc/stb/sensors/temp/value'):
            f = open('/proc/stb/sensors/temp/value', 'r')
            tempinfo = f.read()
            f.close()
        if tempinfo and int(tempinfo.replace('\n', '')) > 0:
            mark = str('\xc2\xb0')
            AboutText += _("System temp:\t%s") % tempinfo.replace(
                '\n', '').replace(' ', '') + mark + "C\n"

        tempinfo = ""
        if path.exists('/proc/stb/fp/temp_sensor_avs'):
            f = open('/proc/stb/fp/temp_sensor_avs', 'r')
            tempinfo = f.read()
            f.close()
        elif path.exists('/sys/devices/virtual/thermal/thermal_zone0/temp'):
            try:
                f = open('/sys/devices/virtual/thermal/thermal_zone0/temp',
                         'r')
                tempinfo = f.read()
                tempinfo = tempinfo[:-4]
                f.close()
            except:
                tempinfo = ""
        elif path.exists('/proc/hisi/msp/pm_cpu'):
            try:
                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)
Example #14
0
def getAboutText():
    AboutText = ''
    AboutText += _('Model:\t\t%s %s\n') % (getMachineBrand(), getMachineName())
    AboutText += _('OEM Model:\t\t%s\n') % getMachineBuild()
    bootloader = ''
    if path.exists('/sys/firmware/devicetree/base/bolt/tag'):
        f = open('/sys/firmware/devicetree/base/bolt/tag', 'r')
        bootloader = f.readline().replace('\x00', '').replace('\n', '')
        f.close()
        AboutText += _('Bootloader:\t\t%s\n') % bootloader
    if path.exists('/proc/stb/info/chipset'):
        AboutText += _('Chipset:\t\t%s') % about.getChipSetString() + '\n'
    cpuMHz = ''
    if getMachineBuild() in ('u41', 'u42', 'u43'):
        cpuMHz = _('   (1.0 GHz)')
    elif getMachineBuild() in ('dags72604', 'vusolo4k', 'vuultimo4k',
                               'vuzero4k', 'gb72604'):
        cpuMHz = _('   (1.5 GHz)')
    elif getMachineBuild() in ('formuler1tc', 'formuler1', 'triplex',
                               'tiviaraplus'):
        cpuMHz = _('   (1.3 GHz)')
    elif getMachineBuild() in ('gbmv200', 'u51', 'u5', 'u53', 'u532', 'u533',
                               'u52', 'u54', 'u55', 'u56', 'u5pvr', 'h9',
                               'h9combo', 'h10', 'cc1', 'sf8008', 'sf8008m',
                               'hd60', 'hd61', 'i55plus', 'ustym4kpro',
                               'beyonwizv2', 'viper4k', 'v8plus', 'multibox'):
        cpuMHz = _('   (1.6 GHz)')
    elif getMachineBuild() in ('vuuno4kse', 'vuuno4k', 'dm900', 'dm920',
                               'gb7252', 'dags7252', 'xc7439', '8100s'):
        cpuMHz = _('   (1.7 GHz)')
    elif getMachineBuild() in ('alien5', ):
        cpuMHz = _('   (2.0 GHz)')
    elif getMachineBuild() in ('vuduo4k', ):
        cpuMHz = _('   (2.1 GHz)')
    elif getMachineBuild() in ('sf5008', 'et13000', 'et1x000', 'hd52', 'hd51',
                               'sf4008', 'vs1500', 'h7', 'osmio4k',
                               'osmio4kplus', '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)')

    elif path.exists('/proc/cpuinfo'):
        f = open('/proc/cpuinfo', 'r')
        temp = f.readlines()
        f.close()
        try:
            for lines in temp:
                lisp = lines.split(': ')
                if lisp[0].startswith('cpu MHz'):
                    cpuMHz = '   (' + str(int(float(lisp[1].replace(
                        '\n', '')))) + ' MHz)'
                    break

        except:
            pass

    AboutText += _('CPU:\t\t%s') % about.getCPUString() + cpuMHz + '\n'
    AboutText += _('Cores:\t\t%s') % about.getCpuCoresString() + '\n'
    imagestarted = ''
    bootname = ''
    if path.exists('/boot/bootname'):
        f = open('/boot/bootname', 'r')
        bootname = f.readline().split('=')[1]
        f.close()
    if SystemInfo['canMultiBoot']:
        slot = image = GetCurrentImage()
        bootmode = ''
        part = _('eMMC slot %s') % slot
        if SystemInfo['canMode12']:
            bootmode = _('bootmode = %s') % GetCurrentImageMode()
        if SystemInfo['HasHiSi'] and 'sda' in SystemInfo['canMultiBoot'][slot][
                'device']:
            if slot > 4:
                image -= 4
            else:
                image -= 1
            part = 'SDcard slot %s (%s) ' % (
                image, SystemInfo['canMultiBoot'][slot]['device'])
        AboutText += _('Selected Image:\t\t%s') % _('STARTUP_') + str(
            slot) + '  ' + part + ' ' + bootmode + '\n'
    AboutText += _('Version:\t\t%s') % getImageVersion() + '\n'
    AboutText += _('Build:\t\t%s') % getImageBuild() + '\n'
    AboutText += _('Kernel:\t\t%s') % about.getKernelVersionString() + '\n'
    string = getDriverDate()
    year = string[0:4]
    month = string[4:6]
    day = string[6:8]
    driversdate = '-'.join((year, month, day))
    AboutText += _('Drivers:\t\t%s') % MyDateConverter(driversdate) + '\n'
    AboutText += _(
        'GStreamer:\t\t%s') % about.getGStreamerVersionString() + '\n'
    AboutText += _('Python:\t\t%s') % about.getPythonVersionString() + '\n'
    MyFlashDate = about.getFlashDateString()
    if MyFlashDate != _('unknown'):
        AboutText += _('Installed:\t\t%s') % MyFlashDate + '\n'
    AboutText += _('Last update:\t\t%s') % MyDateConverter(
        getEnigmaVersionString()) + '\n'
    fp_version = getFPVersion()
    if fp_version is None:
        fp_version = ''
    elif fp_version != 0:
        fp_version = _('Frontprocessor version: %s') % fp_version
        AboutText += fp_version + '\n'
    tempinfo = ''
    if path.exists('/proc/stb/sensors/temp0/value'):
        f = open('/proc/stb/sensors/temp0/value', 'r')
        tempinfo = f.read()
        f.close()
    elif path.exists('/proc/stb/fp/temp_sensor'):
        f = open('/proc/stb/fp/temp_sensor', 'r')
        tempinfo = f.read()
        f.close()
    elif path.exists('/proc/stb/sensors/temp/value'):
        f = open('/proc/stb/sensors/temp/value', 'r')
        tempinfo = f.read()
        f.close()
    if tempinfo and int(tempinfo.replace('\n', '')) > 0:
        mark = str('\xc2\xb0')
        AboutText += _('System temperature:\t%s') % tempinfo.replace(
            '\n', '').replace(' ', '') + mark + 'C\n'
    tempinfo = ''
    if path.exists('/proc/stb/fp/temp_sensor_avs'):
        f = open('/proc/stb/fp/temp_sensor_avs', 'r')
        tempinfo = f.read()
        f.close()
    elif path.exists('/proc/stb/power/avs'):
        f = open('/proc/stb/power/avs', 'r')
        tempinfo = f.read()
        f.close()
    elif path.exists('/sys/devices/virtual/thermal/thermal_zone0/temp'):
        try:
            f = open('/sys/devices/virtual/thermal/thermal_zone0/temp', 'r')
            tempinfo = f.read()
            tempinfo = tempinfo[:-4]
            f.close()
        except:
            tempinfo = ''

    elif path.exists('/proc/hisi/msp/pm_cpu'):
        try:
            for line in open('/proc/hisi/msp/pm_cpu').readlines():
                line = [x.strip() for x in line.strip().split(':')]
                if line[0] in 'Tsensor':
                    temp = line[1].split('=')
                    temp = line[1].split(' ')
                    tempinfo = temp[2]
                    if getMachineBuild() in ('u41', 'u42', 'u43'):
                        tempinfo = str(int(tempinfo) - 15)

        except:
            tempinfo = ''

    if tempinfo and int(tempinfo.replace('\n', '')) > 0:
        mark = str('\xc2\xb0')
        AboutText += _('Processor temperature:\t%s') % tempinfo.replace(
            '\n', '').replace(' ', '') + mark + 'C\n'
    AboutLcdText = AboutText.replace('\t', ' ')
    return (AboutText, AboutLcdText)
Example #15
0
    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 += _("FFmpeg:\t%s\n") % about.getFFmpegVersionString(
        ).replace("FFmpeg ", "")
        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)
Example #16
0
    def populate(self):
        self["lab1"] = StaticText(_("Virtuosso Image Xtreme"))
        self["lab2"] = StaticText(_("By Team ViX"))
        model = None
        AboutText = ""
        self["lab3"] = StaticText(
            _("Support at") + " www.world-of-satellite.com")

        AboutText += _("Model:\t%s %s\n") % (getMachineBrand(),
                                             getMachineName())

        if about.getChipSetString() != _("unavailable"):
            if SystemInfo["HasHiSi"]:
                AboutText += _("Chipset:\tHiSilicon %s\n"
                               ) % about.getChipSetString().upper()
            elif about.getIsBroadcom():
                AboutText += _("Chipset:\tBroadcom %s\n"
                               ) % about.getChipSetString().upper()
            else:
                AboutText += _(
                    "Chipset:\t%s\n") % about.getChipSetString().upper()

        AboutText += _("CPU:\t%s %s %s\n") % (about.getCPUArch(),
                                              about.getCPUSpeedString(),
                                              about.getCpuCoresString())

        if SystemInfo["BoxInfo"]:
            BoxInfo = SystemInfo["BoxInfo"]
            AboutText += _("SoC:\t%s\n") % BoxInfo.getItem("socfamily").upper()

        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:
            AboutText += _("System temp:\t%s") % tempinfo.replace(
                "\n", "").replace(" ", "") + "\xb0" + "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:
            AboutText += _("Processor temp:\t%s") % tempinfo.replace(
                "\n", "").replace(" ", "") + "\xb0" + "C\n"

        imageSubBuild = ""
        if getImageType() != "release":
            imageSubBuild = ".%s" % getImageDevBuild()
        AboutText += _("Image:\t%s.%s%s (%s)\n") % (getImageVersion(
        ), getImageBuild(), imageSubBuild, getImageType().title())

        if SystemInfo["BoxInfo"]:
            BoxInfo = SystemInfo["BoxInfo"]
            if BoxInfo.getItem(
                    "mtdbootfs") != "" and " " not in BoxInfo.getItem(
                        "mtdbootfs"):
                AboutText += _("Boot Device:\t%s\n") % BoxInfo.getItem(
                    "mtdbootfs")
        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 = SystemInfo["MultiBootSlot"]
            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"

        if getMachineName() in ("ET8500") and path.exists("/proc/mtd"):
            self.dualboot = self.dualBoot()
            if self.dualboot:
                AboutText += _("ET8500 Multiboot: Installed\n")

        skinWidth = getDesktop(0).size().width()
        skinHeight = getDesktop(0).size().height()

        string = getDriverDate()
        year = string[0:4]
        month = string[4:6]
        day = string[6:8]
        driversdate = "-".join((day, month, year))

        AboutText += _("Drivers:\t%s\n") % driversdate
        AboutText += _("Kernel:\t%s\n") % about.getKernelVersionString()
        AboutText += _("GStreamer:\t%s\n") % about.getGStreamerVersionString(
        ).replace("GStreamer ", "")
        if isPluginInstalled(
                "ServiceApp"
        ) and config.plugins.serviceapp.servicemp3.replace.value == True:
            AboutText += _(
                "4097 iptv player:\t%s\n"
            ) % config.plugins.serviceapp.servicemp3.player.value
        else:
            AboutText += _("4097 iptv player:\tDefault player\n")
        AboutText += _("Python:\t%s\n") % about.getPythonVersionString()
        flashDate = about.getFlashDateString()[8:] + about.getFlashDateString(
        )[4:8] + about.getFlashDateString()[0:4]
        AboutText += _("Installed:\t%s\n") % flashDate
        lastUpdate = getEnigmaVersionString()[8:] + getEnigmaVersionString(
        )[4:8] + getEnigmaVersionString()[0:4]
        AboutText += _("Last update:\t%s\n") % lastUpdate
        AboutText += _("E2 (re)starts:\t%s\n") % config.misc.startCounter.value
        uptime = about.getBoxUptime()
        if uptime:
            AboutText += _("Uptime:\t%s\n") % uptime
        e2uptime = about.getEnigmaUptime()
        if e2uptime:
            AboutText += _("Enigma2 uptime:\t%s\n") % e2uptime
        AboutText += _("Skin:\t%s") % config.skin.primary_skin.value[0:-9] + _(
            "  (%s x %s)") % (skinWidth, skinHeight) + "\n"

        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)
Example #17
0
    def __init__(self, session):
        Screen.__init__(self, session)
        self.setTitle(_("About"))
        OpenNFRVersion = _("OpenNFR %s") % about.getImageVersionString()
        self["OpenNFRVersion"] = Label(OpenNFRVersion)

        AboutText = _("Model:\t\t%s %s\n") % (getMachineBrand(),
                                              getMachineName())

        bootloader = ""
        if path.exists('/sys/firmware/devicetree/base/bolt/tag'):
            f = open('/sys/firmware/devicetree/base/bolt/tag', 'r')
            bootloader = f.readline().replace('\x00', '').replace('\n', '')
            f.close()
            AboutText += _("Bootloader:\t\t%s\n") % (bootloader)

        if path.exists('/proc/stb/info/chipset'):
            AboutText += _(
                "Chipset:\t\tBCM%s") % about.getChipSetString() + "\n"

        cpuMHz = ""
        if getMachineBuild() in ('u41', 'u42', 'u43'):
            cpuMHz = _("   (1.0 GHz)")
        elif getMachineBuild() in ('dags72604', 'vusolo4k', 'vuultimo4k',
                                   'vuzero4k', 'gb72604'):
            cpuMHz = "   (1,5 GHz)"
        elif getMachineBuild() in ('formuler1', 'triplex'):
            cpuMHz = "   (1,3 GHz)"
        elif getMachineBuild() in ('gbmv200', 'u51', 'u5', 'u53', 'u52', 'u54',
                                   'u55', 'u56', 'u5pvr', 'h9', 'h9combo',
                                   'cc1', 'sf8008', 'sf8008m', 'hd60', 'hd61',
                                   'i55plus', 'ustym4kpro', 'v8plus',
                                   'multibox'):
            cpuMHz = "   (1,6 GHz)"
        elif getMachineBuild() in ('vuuno4k', 'vuultimo4k', 'gb7252',
                                   'dags7252', '8100s'):
            cpuMHz = "   (1,7 GHz)"
        elif getMachineBuild() in ('alien5', 'u53'):
            cpuMHz = "   (2,0 GHz)"
        elif getMachineBuild() in ('vuduo4k', ):
            cpuMHz = _("   (2.1 GHz)")
        elif getMachineBuild() in ('sf5008', 'et13000', 'et1x000', 'hd52',
                                   'hd51', 'sf4008', 'vs1500', 'h7', 'osmio4k',
                                   'osmio4kplus', 'osmini4k'):
            try:
                import binascii
                f = open(
                    '/sys/firmware/devicetree/base/cpus/cpu@0/clock-frequency',
                    'rb')
                clockfrequency = f.read()
                f.close()
                cpuMHz = "   (%s MHz)" % str(
                    round(
                        int(binascii.hexlify(clockfrequency), 16) / 1000000,
                        1))
            except:
                cpuMHz = "   (1,7 GHz)"
        else:
            if path.exists('/proc/cpuinfo'):
                f = open('/proc/cpuinfo', 'r')
                temp = f.readlines()
                f.close()
                try:
                    for lines in temp:
                        lisp = lines.split(': ')
                        if lisp[0].startswith('cpu MHz'):
                            #cpuMHz = "   (" +  lisp[1].replace('\n', '') + " MHz)"
                            cpuMHz = "   (" + str(
                                int(float(lisp[1].replace('\n',
                                                          '')))) + " MHz)"
                            break
                except:
                    pass

        AboutText += _("CPU:\t\t%s") % about.getCPUString() + cpuMHz + "\n"
        AboutText += _("Cores:\t\t%s") % about.getCpuCoresString() + "\n"

        tempinfo = ""
        if path.exists('/proc/stb/sensors/temp0/value'):
            f = open('/proc/stb/sensors/temp0/value', 'r')
            tempinfo = f.read()
            f.close()
        elif path.exists('/proc/stb/fp/temp_sensor'):
            f = open('/proc/stb/fp/temp_sensor', 'r')
            tempinfo = f.read()
            f.close()
        elif path.exists('/proc/stb/sensors/temp/value'):
            f = open('/proc/stb/sensors/temp/value', 'r')
            tempinfo = f.read()
            f.close()
        if tempinfo and int(tempinfo.replace('\n', '')) > 0:
            mark = str('\xc2\xb0')
            AboutText += _("System temperature:\t%s") % tempinfo.replace(
                '\n', '') + mark + "C\n"

        tempinfo = ""
        if path.exists('/proc/stb/fp/temp_sensor_avs'):
            f = open('/proc/stb/fp/temp_sensor_avs', 'r')
            tempinfo = f.read()
            f.close()
        elif path.exists('/proc/stb/power/avs'):
            f = open('/proc/stb/power/avs', 'r')
            tempinfo = f.read()
            f.close()
        elif path.exists('/sys/devices/virtual/thermal/thermal_zone0/temp'):
            try:
                f = open('/sys/devices/virtual/thermal/thermal_zone0/temp',
                         'r')
                tempinfo = f.read()
                tempinfo = tempinfo[:-4]
                f.close()
            except:
                tempinfo = ""
        elif path.exists('/proc/hisi/msp/pm_cpu'):
            try:
                for line in open('/proc/hisi/msp/pm_cpu').readlines():
                    line = [x.strip() for x in line.strip().split(":")]
                    if line[0] in ("Tsensor"):
                        temp = line[1].split("=")
                        temp = line[1].split(" ")
                        tempinfo = temp[2]
            except:
                tempinfo = ""
        if tempinfo and int(tempinfo.replace('\n', '')) > 0:
            mark = str('\xc2\xb0')
            AboutText += _("Processor temperature:\t%s") % tempinfo.replace(
                '\n', '').replace(' ', '') + mark + "C\n"
        imagestarted = ""
        bootname = ''
        if path.exists('/boot/bootname'):
            f = open('/boot/bootname', 'r')
            bootname = f.readline().split('=')[1]
            f.close()

        if SystemInfo["canMultiBoot"]:
            slot = image = GetCurrentImage()
            bootmode = ""
            part = "eMMC slot %s" % slot
            if SystemInfo["canMode12"]:
                bootmode = "bootmode = %s" % GetCurrentImageMode()
            if SystemInfo["HasHiSi"] and "sda" in SystemInfo["canMultiBoot"][
                    slot]['device']:
                if slot > 4:
                    image -= 4
                else:
                    image -= 1
                part = "SDcard slot %s (%s) " % (
                    image, SystemInfo["canMultiBoot"][slot]['device'])
            AboutText += _("Selected Image:\t\t%s") % _("STARTUP_") + str(
                slot) + "  " + part + " " + bootmode + "\n"
        string = getDriverDate()
        year = string[0:4]
        month = string[4:6]
        day = string[6:8]
        driversdate = '-'.join((year, month, day))
        AboutText += _("Drivers:\t\t%s") % driversdate + "\n"
        AboutText += _("Image:\t\t%s") % about.getImageVersionString() + "\n"
        AboutText += _("Build:\t\t%s") % getImageBuild() + "\n"
        AboutText += _(
            "Kernel: \t\t%s") % about.getKernelVersionString() + "\n"
        AboutText += _("Oe-Core:\t\t%s") % getOEVersion() + "\n"
        AboutText += _(
            "Enigma (re)starts:\t%d\n") % config.misc.startCounter.value
        AboutText += _(
            "GStreamer:\t\t%s") % about.getGStreamerVersionString() + "\n"
        AboutText += _("Python:\t\t%s") % about.getPythonVersionString() + "\n"

        fp_version = getFPVersion()
        if fp_version is None:
            fp_version = ""
        elif fp_version != 0:
            fp_version = _("Front Panel:\t\t%s") % fp_version
            AboutText += fp_version + "\n"
        else:
            fp_version = _("Front Panel:\t\tVersion unknown")
            AboutText += fp_version + "\n"

        if getMachineBuild() not in ('gbmv200', 'vuduo4k', 'v8plus',
                                     'ustym4kpro', 'hd60', 'hd61', 'i55plus',
                                     'osmio4k', 'osmio4kplus', 'h9', 'h9combo',
                                     'vuzero4k', 'sf5008', 'et13000',
                                     'et1x000', 'hd51', 'hd52', 'vusolo4k',
                                     'vuuno4k', 'vuuno4kse', 'vuultimo4k',
                                     'sf4008', 'dm820', 'dm7080', 'dm900',
                                     'dm920', 'gb7252', 'dags7252', 'vs1500',
                                     'h7', 'xc7439', '8100s', 'u41', 'u42',
                                     'u43', 'u5', 'u5pvr', 'u52', 'u53', 'u54',
                                     'u55', 'u56', 'u51', 'cc1', 'sf8008m',
                                     'sf8008'):
            AboutText += _(
                "Installed:\t\t%s") % about.getFlashDateString() + "\n"
        AboutText += _(
            "Last Upgrade:\t\t%s") % about.getLastUpdateString() + "\n\n"

        self["FPVersion"] = StaticText(fp_version)

        AboutText += _("WWW:\t\t%s") % about.getImageUrlString() + "\n\n"
        AboutText += _(
            "based on:\t\t%s") % "www.github.com/oe-alliance" + "\n\n"
        # don't remove the string out of the _(), or it can't be "translated" anymore.
        # TRANSLATORS: Add here whatever should be shown in the "translator" about screen, up to 6 lines (use \n for newline)
        info = _("TRANSLATOR_INFO")

        if info == _("TRANSLATOR_INFO"):
            info = ""

        infolines = _("").split("\n")
        infomap = {}
        for x in infolines:
            l = x.split(': ')
            if len(l) != 2:
                continue
            (type, value) = l
            infomap[type] = value

        translator_name = infomap.get("Language-Team", "none")
        if translator_name == "none":
            translator_name = infomap.get("Last-Translator", "")

        self["FPVersion"] = StaticText(fp_version)

        self["TunerHeader"] = StaticText(_("Detected NIMs:"))

        nims = nimmanager.nimList()
        for count in range(len(nims)):
            if count < 4:
                self["Tuner" + str(count)] = StaticText(nims[count])
            else:
                self["Tuner" + str(count)] = StaticText("")

        self["HDDHeader"] = StaticText(_("Detected HDD:"))

        hddlist = harddiskmanager.HDDList()
        hddinfo = ""
        if hddlist:
            for count in range(len(hddlist)):
                if hddinfo:
                    hddinfo += "\n"
                hdd = hddlist[count][1]
                if int(hdd.free()) > 1024:
                    hddinfo += "%s\n(%s, %d GB %s)" % (
                        hdd.model(), hdd.capacity(), hdd.free() / 1024,
                        _("free"))
                else:
                    hddinfo += "%s\n(%s, %d MB %s)" % (
                        hdd.model(), hdd.capacity(), hdd.free(), _("free"))
        else:
            hddinfo = _("none")
        self["hddA"] = StaticText(hddinfo)

        self["AboutScrollLabel"] = ScrollLabel(AboutText)

        self["actions"] = ActionMap(
            ["SetupActions", "ColorActions", "DirectionActions"], {
                "cancel": self.close,
                "ok": self.close,
                "green": self.showTranslationInfo,
                "up": self["AboutScrollLabel"].pageUp,
                "down": self["AboutScrollLabel"].pageDown
            })
Example #18
0
    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"

        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()
            AboutText += _("STARTUP slot: ") + str(
                GetCurrentImage()) + bootmode + "\n"
            if SystemInfo["HasHiSi"]:
                slot += 1
                if image != 0:
                    part = "SDC slot %s (%s%s) " % (
                        image, SystemInfo["canMultiBoot"][2], image * 2)
                else:
                    part = "eMMC slot %s" % slot
            AboutText += _("Image Slot:\t%s") % "STARTUP_" + str(
                slot) + "  " + part + " " + bootmode + "\n"

        AboutText += _("Build date: ") + about.getBuildDateString() + "\n"
        AboutText += _("Last update: ") + about.getUpdateDateString() + "\n"

        # [WanWizard] Removed until we find a reliable way to determine the installation date
        # AboutText += _("Installed: ") + about.getFlashDateString() + "\n"

        EnigmaVersion = about.getEnigmaVersionString()
        EnigmaVersion = EnigmaVersion.rsplit("-", EnigmaVersion.count("-") - 2)
        if len(EnigmaVersion) == 3:
            EnigmaVersion = EnigmaVersion[0] + " (" + EnigmaVersion[
                2] + "-" + EnigmaVersion[1] + ")"
        else:
            EnigmaVersion = EnigmaVersion[0] + " (" + EnigmaVersion[1] + ")"
        EnigmaVersion = _("Enigma version: ") + EnigmaVersion
        self["EnigmaVersion"] = StaticText(EnigmaVersion)
        AboutText += "\n" + EnigmaVersion + "\n"

        AboutText += _(
            "Kernel version: ") + about.getKernelVersionString() + "\n"

        AboutText += _(
            "DVB driver version: ") + about.getDriverInstalledDate() + "\n"

        GStreamerVersion = _("GStreamer version: "
                             ) + about.getGStreamerVersionString(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
            })
Example #19
0
    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 about.getIsBroadcom():
                AboutText += _(
                    "Chipset:\tBCM%s\n") % about.getChipSetString().upper()
            else:
                AboutText += _(
                    "Chipset:\t%s\n") % about.getChipSetString().upper()

        AboutText += _("CPU:\t%s %s %s\n") % (about.getCPUArch(),
                                              about.getCPUSpeedString(),
                                              about.getCpuCoresString())
        imageSubBuild = ""
        if getImageType() != 'release':
            imageSubBuild = ".%s" % getImageDevBuild()
        AboutText += _("Image:\t%s.%s%s (%s)\n") % (getImageVersion(
        ), getImageBuild(), imageSubBuild, getImageType().title())

        if SystemInfo["canMultiBoot"]:
            image = GetCurrentImage()
            bootmode = ""
            if SystemInfo["canMode12"]:
                bootmode = "bootmode = %s" % GetCurrentImageMode()
            AboutText += _("Image Slot:\t%s") % "STARTUP_" + str(
                image) + " " + bootmode + "\n"

        skinWidth = getDesktop(0).size().width()
        skinHeight = getDesktop(0).size().height()

        string = getDriverDate()
        year = string[0:4]
        month = string[4:6]
        day = string[6:8]
        driversdate = '-'.join((year, month, day))
        AboutText += _("Drivers:\t%s\n") % driversdate
        AboutText += _("Kernel:\t%s\n") % about.getKernelVersionString()
        AboutText += _("GStreamer:\t%s\n") % about.getGStreamerVersionString(
        ).replace("GStreamer ", "")
        AboutText += _("Python:\t%s\n") % about.getPythonVersionString()
        AboutText += _("Installed:\t%s\n") % about.getFlashDateString()
        AboutText += _("Last update:\t%s\n") % getEnigmaVersionString()
        AboutText += _("E2 (re)starts:\t%s\n") % config.misc.startCounter.value
        AboutText += _("Skin:\t%s") % config.skin.primary_skin.value[0:-9] + _(
            "  (%s x %s)") % (skinWidth, skinHeight) + "\n"

        tempinfo = ""
        if path.exists('/proc/stb/sensors/temp0/value'):
            f = open('/proc/stb/sensors/temp0/value', 'r')
            tempinfo = f.read()
            f.close()
        elif path.exists('/proc/stb/fp/temp_sensor'):
            f = open('/proc/stb/fp/temp_sensor', 'r')
            tempinfo = f.read()
            f.close()
        elif path.exists('/proc/stb/sensors/temp/value'):
            f = open('/proc/stb/sensors/temp/value', 'r')
            tempinfo = f.read()
            f.close()
        if tempinfo and int(tempinfo.replace('\n', '')) > 0:
            mark = str('\xc2\xb0')
            AboutText += _("System temp:\t%s") % tempinfo.replace(
                '\n', '').replace(' ', '') + mark + "C\n"

        tempinfo = ""
        if path.exists('/proc/stb/fp/temp_sensor_avs'):
            f = open('/proc/stb/fp/temp_sensor_avs', 'r')
            tempinfo = f.read()
            f.close()
        elif path.exists('/sys/devices/virtual/thermal/thermal_zone0/temp'):
            try:
                f = open('/sys/devices/virtual/thermal/thermal_zone0/temp',
                         'r')
                tempinfo = f.read()
                tempinfo = tempinfo[:-4]
                f.close()
            except:
                tempinfo = ""
        if tempinfo and int(tempinfo.replace('\n', '')) > 0:
            mark = str('\xc2\xb0')
            AboutText += _("Processor temp:\t%s") % tempinfo.replace(
                '\n', '').replace(' ', '') + mark + "C\n"
        AboutLcdText = AboutText.replace('\t', ' ')

        fp_version = getFPVersion()
        if fp_version is None:
            fp_version = ""
        elif fp_version != 0:
            fp_version = _("FP version:\t%s") % fp_version
            AboutText += fp_version + "\n"

        bootloader = ""
        if path.exists('/sys/firmware/devicetree/base/bolt/tag'):
            f = open('/sys/firmware/devicetree/base/bolt/tag', 'r')
            bootloader = f.readline().replace('\x00', '').replace('\n', '')
            f.close()
            AboutText += _("Bootloader:\t%s\n") % (bootloader)

        self["AboutScrollLabel"] = ScrollLabel(AboutText)
Example #20
0
def getAboutText():
    AboutText = ""
    AboutText += _("Model:\t\t%s %s\n") % (getMachineBrand(), getMachineName())
    AboutText += _("OEM Model:\t\t%s\n") % getMachineBuild()

    bootloader = ""
    if path.exists('/sys/firmware/devicetree/base/bolt/tag'):
        f = open('/sys/firmware/devicetree/base/bolt/tag', 'r')
        bootloader = f.readline().replace('\x00', '').replace('\n', '')
        f.close()
        AboutText += _("Bootloader:\t\t%s\n") % (bootloader)

    if path.exists('/proc/stb/info/chipset'):
        AboutText += _("Chipset:\t\t%s") % about.getChipSetString() + "\n"

    AboutText += _("CPU:\t\t%s  (%s)  %s cores") % (about.getCPUString(
    ), about.getCPUSpeedString(), about.getCpuCoresString()) + "\n"

    imagestarted = ""
    bootname = ''
    if path.exists('/boot/bootname'):
        f = open('/boot/bootname', 'r')
        bootname = f.readline().split('=')[1]
        f.close()
    if SystemInfo["canMultiBoot"]:
        slot = image = GetCurrentImage()
        bootmode = ""
        part = _("eMMC slot %s") % slot
        if SystemInfo["canMode12"]:
            bootmode = _("bootmode = %s") % GetCurrentImageMode()
        if SystemInfo["HasHiSi"] and "sda" in SystemInfo["canMultiBoot"][slot][
                'device']:
            if slot > 4:
                image -= 4
            else:
                image -= 1
            part = "SDcard slot %s (%s) " % (
                image, SystemInfo["canMultiBoot"][slot]['device'])
        AboutText += _("Selected Image:\t\t%s") % _("STARTUP_") + str(
            slot) + "  (" + part + " " + bootmode + ")\n"

    AboutText += _("Version / Build:\t\t%s  (%s)") % (
        getImageVersion(), MyDateConverter(getImageBuild())) + "\n"
    AboutText += _("Kernel:\t\t%s") % about.getKernelVersionString() + "\n"
    AboutText += _("Drivers:\t\t%s") % MyDateConverter(getDriverDate()) + "\n"

    skinWidth = getDesktop(0).size().width()
    skinHeight = getDesktop(0).size().height()

    AboutText += _("Skin:\t\t%s") % config.skin.primary_skin.value.split(
        "/")[0] + _("  (%s x %s)") % (skinWidth, skinHeight) + "\n"

    AboutText += _(
        "GStreamer:\t\t%s") % about.getGStreamerVersionString() + "\n"
    AboutText += _("Python:\t\t%s") % about.getPythonVersionString() + "\n"

    MyFlashDate = about.getFlashDateString()
    if MyFlashDate != _("unknown"):
        AboutText += _("Installed:\t\t%s") % MyDateConverter(
            MyFlashDate) + "\n"

    AboutText += _("Last E2 update:\t\t%s") % MyDateConverter(
        getEnigmaVersionString()) + "\n"

    fp_version = getFPVersion()
    if fp_version is None:
        fp_version = ""
    elif fp_version != 0:
        fp_version = _("Frontprocessor version:\t%s") % fp_version
        AboutText += fp_version + "\n"

    tempinfo = ""
    if path.exists('/proc/stb/sensors/temp0/value'):
        f = open('/proc/stb/sensors/temp0/value', 'r')
        tempinfo = f.read()
        f.close()
    elif path.exists('/proc/stb/fp/temp_sensor'):
        f = open('/proc/stb/fp/temp_sensor', 'r')
        tempinfo = f.read()
        f.close()
    elif path.exists('/proc/stb/sensors/temp/value'):
        f = open('/proc/stb/sensors/temp/value', 'r')
        tempinfo = f.read()
        f.close()
    if tempinfo and int(tempinfo.replace('\n', '')) > 0:
        mark = str('\xc2\xb0')
        AboutText += _("System temperature:\t%s") % tempinfo.replace(
            '\n', '').replace(' ', '') + mark + "C\n"

    tempinfo = ""
    if path.exists('/proc/stb/fp/temp_sensor_avs'):
        f = open('/proc/stb/fp/temp_sensor_avs', 'r')
        tempinfo = f.read()
        f.close()
    elif path.exists('/proc/stb/power/avs'):
        f = open('/proc/stb/power/avs', 'r')
        tempinfo = f.read()
        f.close()
    elif path.exists('/sys/devices/virtual/thermal/thermal_zone0/temp'):
        try:
            f = open('/sys/devices/virtual/thermal/thermal_zone0/temp', 'r')
            tempinfo = f.read()
            tempinfo = tempinfo[:-4]
            f.close()
        except:
            tempinfo = ""
    elif path.exists('/proc/hisi/msp/pm_cpu'):
        try:
            for line in open('/proc/hisi/msp/pm_cpu').readlines():
                line = [x.strip() for x in line.strip().split(":")]
                if line[0] in ("Tsensor"):
                    temp = line[1].split("=")
                    temp = line[1].split(" ")
                    tempinfo = temp[2]
                    if getMachineBuild() in ('u41', 'u42', 'u43'):
                        tempinfo = str(int(tempinfo) - 15)
        except:
            tempinfo = ""
    if tempinfo and int(tempinfo.replace('\n', '')) > 0:
        mark = str('\xc2\xb0')
        AboutText += _("Processor temperature:\t%s") % tempinfo.replace(
            '\n', '').replace(' ', '') + mark + "C\n"
    AboutLcdText = AboutText.replace('\t', ' ')

    return AboutText, AboutLcdText