def __init__(self): self.last_modes_preferred = [ ] self.on_hotplug = CList() self.current_mode = None self.current_port = None self.readAvailableModes() if self.hw_type == "me" or self.hw_type == "minime" : del self.modes["Scart"] if self.modes.has_key("DVI-PC") and not self.getModeList("DVI-PC"): print "remove DVI-PC because of not existing modes" del self.modes["DVI-PC"] if self.hw_type == "me" or self.hw_type == "minime" : self.readPreferredModes() self.createConfig() self.readPreferredModes() portlist = self.getPortList() has1080p50 = False for port in portlist: if port == 'DVI' and HardwareInfo().has_hdmi(): if "1080p50" in self.modes_available: has1080p50 = True if about.getCPUString().startswith('BCM'): if has1080p50: self.widescreen_modes = set(["720p", "1080i", "1080p"]) else: self.widescreen_modes = set(["720p", "1080i"]) elif about.getCPUString().startswith('STx'): if has1080p50: self.widescreen_modes = set(["576i", "576p", "720p", "1080i", "1080p"]) else: self.widescreen_modes = set(["576i", "576p", "720p", "1080i"]) # take over old AVSwitch component :) from Components.AVSwitch import AVSwitch config.av.aspectratio.notifiers = [ ] config.av.tvsystem.notifiers = [ ] config.av.wss.notifiers = [ ] AVSwitch.getOutputAspect = self.getOutputAspect if about.getCPUString().startswith('STx'): config.av.colorformat_hdmi = ConfigSelection(choices = {"hdmi_rgb": _("RGB"), "hdmi_yuv": _("YUV"), "hdmi_422": _("422")}, default="hdmi_rgb") config.av.colorformat_yuv = ConfigSelection(choices = {"yuv": _("YUV")}, default="yuv") config.av.hdmi_audio_source = ConfigSelection(choices = {"pcm": _("PCM"), "spdif": _("SPDIF")}, default="pcm") config.av.colorformat_hdmi.addNotifier(self.setHDMIColor) config.av.colorformat_yuv.addNotifier(self.setYUVColor) config.av.hdmi_audio_source.addNotifier(self.setHDMIAudioSource) config.av.aspect.addNotifier(self.updateAspect) config.av.wss.addNotifier(self.updateAspect) config.av.policy_169.addNotifier(self.updateAspect) config.av.policy_43.addNotifier(self.updateAspect)
def imageInfo(self): AboutText = _("OpenHDF Full-Image Backupscript\n") AboutText += _("Support at") + " www.hdfreaks.cc\n\n" AboutText += _("[Image Info's]\n") AboutText += _("Model: %s %s\n") % (getMachineBrand(), getMachineName()) AboutText += _("Backup Date: %s\n") % strftime("%Y-%m-%d", localtime(self.START)) if path.exists('/proc/stb/info/chipset'): AboutText += _("Chipset: BCM%s") % about.getChipSetString().lower().replace('\n','').replace('bcm','') + "\n" AboutText += _("CPU: %s") % about.getCPUString() + "\n" AboutText += _("Cores: %s") % about.getCpuCoresString() + "\n" AboutText += _("Version: %s") % getImageVersion() + "\n" AboutText += _("HDF Build: %s") % getImageBuild() + "\n" AboutText += _("Kernel: %s") % about.getKernelVersionString() + "\n" string = getDriverDate() year = string[0:4] month = string[4:6] day = string[6:8] driversdate = '-'.join((year, month, day)) AboutText += _("Drivers:\t%s") % driversdate + "\n" AboutText += _("Last update:\t%s") % getEnigmaVersionString() + "\n\n" AboutText += _("[Enigma2 Settings]\n") AboutText += commands.getoutput("cat /etc/enigma2/settings") AboutText += _("\n[Installed Plugins]\n") AboutText += commands.getoutput("opkg list_installed | grep enigma2-plugin-") return AboutText
def setMode(self, port, mode, rate, force = None): print '[VideoMode] setMode - port: %s, mode: %s, rate: %s' % (port, mode, rate) self.current_mode = mode self.current_port = port modes = self.rates[mode][rate] mode_50 = modes.get(50) mode_60 = modes.get(60) if mode_50 is None or force == 60: mode_50 = mode_60 if mode_60 is None or force == 50: mode_60 = mode_50 try: f = open('/proc/stb/video/videomode_50hz', 'w') f.write(mode_50) f.close() f = open('/proc/stb/video/videomode_60hz', 'w') f.write(mode_60) f.close() except IOError: try: f = open('/proc/stb/video/videomode', 'w') f.write(mode_50) f.close() except IOError: print '[AVSwitch] setting videomode failed.' map = {'cvbs': 0, 'rgb': 1, 'svideo': 2, 'yuv': 3} self.setColorFormat(map[config.av.colorformat.value]) if about.getCPUString().startswith('STx'): from enigma import gMainDC gMainDC.getInstance().setResolution(-1, -1) return
def setMode(self, port, mode, rate, force=None): print '[VideoMode] setMode - port: %s, mode: %s, rate: %s' % ( port, mode, rate) self.current_mode = mode self.current_port = port modes = self.rates[mode][rate] mode_50 = modes.get(50) mode_60 = modes.get(60) if mode_50 is None or force == 60: mode_50 = mode_60 if mode_60 is None or force == 50: mode_60 = mode_50 try: f = open('/proc/stb/video/videomode_50hz', 'w') f.write(mode_50) f.close() f = open('/proc/stb/video/videomode_60hz', 'w') f.write(mode_60) f.close() except IOError: try: f = open('/proc/stb/video/videomode', 'w') f.write(mode_50) f.close() except IOError: print '[AVSwitch] setting videomode failed.' map = {'cvbs': 0, 'rgb': 1, 'svideo': 2, 'yuv': 3} self.setColorFormat(map[config.av.colorformat.value]) if about.getCPUString().startswith('STx'): from enigma import gMainDC gMainDC.getInstance().setResolution(-1, -1) return
def populate(self): self["lab1"] = StaticText(_("openATV")) self["lab2"] = StaticText(_("By openATV Image Team")) model = None AboutText = "" self["lab3"] = StaticText(_("Support at") + " www.opena.tv") AboutText += _("Model:\t%s %s\n") % (getMachineBrand(), getMachineName()) if path.exists('/proc/stb/info/chipset'): AboutText += _("Chipset:\t%s") % about.getChipSetString() + "\n" AboutText += _("CPU:\t%s") % about.getCPUString() + "\n" AboutText += _("Cores:\t%s") % about.getCpuCoresString() + "\n" AboutText += _("Version:\t%s") % getImageVersion() + "\n" AboutText += _("Build:\t%s") % getImageBuild() + "\n" AboutText += _("Kernel:\t%s") % about.getKernelVersionString() + "\n" string = getDriverDate() year = string[0:4] month = string[4:6] day = string[6:8] driversdate = '-'.join((year, month, day)) AboutText += _("Drivers:\t%s") % driversdate + "\n" AboutText += _("Last update:\t%s") % getEnigmaVersionString() + "\n\n" fp_version = getFPVersion() if fp_version is None: fp_version = "" elif fp_version != 0: fp_version = _("Frontprocessor version: %s") % fp_version AboutText += fp_version + "\n" tempinfo = "" if path.exists('/proc/stb/sensors/temp0/value'): f = open('/proc/stb/sensors/temp0/value', 'r') tempinfo = f.read() f.close() elif path.exists('/proc/stb/fp/temp_sensor'): f = open('/proc/stb/fp/temp_sensor', 'r') tempinfo = f.read() f.close() if tempinfo and int(tempinfo.replace('\n', '')) > 0: mark = str('\xc2\xb0') AboutText += _("System temperature:\t%s") % tempinfo.replace( '\n', '') + mark + "C\n" tempinfo = "" if path.exists('/proc/stb/fp/temp_sensor_avs'): f = open('/proc/stb/fp/temp_sensor_avs', 'r') tempinfo = f.read() f.close() if tempinfo and int(tempinfo.replace('\n', '')) > 0: mark = str('\xc2\xb0') AboutText += _("Processor temperature:\t%s") % tempinfo.replace( '\n', '') + mark + "C\n" self["AboutScrollLabel"] = ScrollLabel(AboutText)
def setMode(self, port, mode, rate, force=None): print("[AVSwitch] setMode - port: %s, mode: %s, rate: %s" % (port, mode, rate)) # config.av.videoport.setValue(port) # we can ignore "port" self.current_mode = mode self.current_port = port modes = self.rates[mode][rate] mode_50 = modes.get(50) mode_60 = modes.get(60) mode_24 = modes.get(24) if mode_50 is None or force == 60: mode_50 = mode_60 if mode_60 is None or force == 50: mode_60 = mode_50 if mode_24 is None or force: mode_24 = mode_60 if force == 50: mode_24 = mode_50 try: f = open("/proc/stb/video/videomode_50hz", "w") f.write(mode_50) f.close() f = open("/proc/stb/video/videomode_60hz", "w") f.write(mode_60) f.close() except IOError: try: # fallback if no possibility to setup 50/60 hz mode f = open("/proc/stb/video/videomode", "w") f.write(mode_50) f.close() except IOError: print("[AVSwitch] setting videomode failed.") if SystemInfo["have24hz"]: try: open("/proc/stb/video/videomode_24hz", "w").write(mode_24) except IOError: print("[VideoHardware] cannot open /proc/stb/video/videomode_24hz") if getBrandOEM() in ('gigablue'): try: # use 50Hz mode (if available) for booting f = open("/etc/videomode", "w") f.write(mode_50) f.close() except IOError: print("[AVSwitch] writing initial videomode to /etc/videomode failed.") map = {"cvbs": 0, "rgb": 1, "svideo": 2, "yuv": 3} self.setColorFormat(map[config.av.colorformat.value]) if about.getCPUString().startswith('STx'): #call setResolution() with -1,-1 to read the new scrren dimensions without changing the framebuffer resolution from enigma import gMainDC gMainDC.getInstance().setResolution(-1, -1)
def imageInfo(self): AboutText = _("OpenHDF Full-Image Backupscript\n") AboutText += _("Support at") + " www.hdfreaks.cc\n\n" AboutText += _("[Image Info's]\n") AboutText += _("Model: %s %s\n") % (getMachineBrand(), getMachineName()) AboutText += _("Backup Date: %s\n") % strftime("%Y-%m-%d", localtime(self.START)) if path.exists('/proc/stb/info/chipset'): AboutText += _("Chipset: BCM%s") % about.getChipSetString().lower( ).replace('\n', '').replace('bcm', '') + "\n" AboutText += _("CPU: %s") % about.getCPUString() + "\n" AboutText += _("Cores: %s") % about.getCpuCoresString() + "\n" AboutText += _("Version: %s") % getImageVersion() + "\n" AboutText += _("HDF Build: %s") % getImageBuild() + "\n" AboutText += _("Kernel: %s") % about.getKernelVersionString() + "\n" string = getDriverDate() year = string[0:4] month = string[4:6] day = string[6:8] driversdate = '-'.join((year, month, day)) AboutText += _("Drivers:\t%s") % driversdate + "\n" AboutText += _("Last update:\t%s") % getEnigmaVersionString() + "\n\n" AboutText += _("[Enigma2 Settings]\n") AboutText += commands.getoutput("cat /etc/enigma2/settings") AboutText += _("\n[Installed Plugins]\n") AboutText += commands.getoutput( "opkg list_installed | grep enigma2-plugin-") return AboutText
def 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() 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 setMode(self, port, mode, rate, force=None): # config.av.videoport.setValue(port) # we can ignore "port" self.current_mode = mode self.current_port = port modes = self.rates[mode][rate] mode_50 = modes.get(50) mode_60 = modes.get(60) if mode_50 is None or force == 60: mode_50 = mode_60 if mode_60 is None or force == 50: mode_60 = mode_50 if os.path.exists('/proc/stb/video/videomode_50hz') and getBoxType( ) not in ('gb800solo', 'gb800se', 'gb800ue'): try: f = open("/proc/stb/video/videomode_50hz", "w") f.write(mode_50) f.close() except: print "[AVSwitch] failed to set videomode_50hz to", mode_50 if os.path.exists('/proc/stb/video/videomode_60hz') and getBoxType( ) not in ('gb800solo', 'gb800se', 'gb800ue'): try: f = open("/proc/stb/video/videomode_60hz", "w") f.write(mode_60) f.close() except: print "[AVSwitch] failed to set videomode_60hz to", mode_60 try: if rate == "multi": mode_etc = mode_50 else: mode_etc = modes.get(int(rate[:2])) f = open("/proc/stb/video/videomode", "w") f.write(mode_etc) f.close() except: # not support 50Hz, 60Hz for 1080p try: # fallback if no possibility to setup 50/60 hz mode f = open("/proc/stb/video/videomode", "w") f.write(mode_50) f.close() except IOError as err: print "[AVSwitch] setting videomode failed:", err self.setColorFormat({ "cvbs": 0, "rgb": 1, "svideo": 2, "yuv": 3 }[config.av.colorformat.value]) if about.getCPUString().startswith('STx'): #call setResolution() with -1,-1 to read the new scrren dimesions without changing the framebuffer resolution from enigma import gMainDC gMainDC.getInstance().setResolution(-1, -1)
def populate(self): self["lab1"] = StaticText(_("openATV")) self["lab2"] = StaticText(_("By openATV Image Team")) model = None AboutText = "" self["lab3"] = StaticText(_("Support at") + " www.opena.tv") AboutText += _("Model:\t%s %s\n") % (getMachineBrand(), getMachineName()) if path.exists("/proc/stb/info/chipset"): AboutText += _("Chipset:\t%s") % about.getChipSetString() + "\n" AboutText += _("CPU:\t%s") % about.getCPUString() + "\n" AboutText += _("Cores:\t%s") % about.getCpuCoresString() + "\n" AboutText += _("Version:\t%s") % getImageVersion() + "\n" AboutText += _("Build:\t%s") % getImageBuild() + "\n" AboutText += _("Kernel:\t%s") % about.getKernelVersionString() + "\n" string = getDriverDate() year = string[0:4] month = string[4:6] day = string[6:8] driversdate = "-".join((year, month, day)) AboutText += _("Drivers:\t%s") % driversdate + "\n" AboutText += _("Last update:\t%s") % getEnigmaVersionString() + "\n\n" fp_version = getFPVersion() if fp_version is None: fp_version = "" elif fp_version != 0: fp_version = _("Frontprocessor version: %s") % fp_version AboutText += fp_version + "\n" tempinfo = "" if path.exists("/proc/stb/sensors/temp0/value"): f = open("/proc/stb/sensors/temp0/value", "r") tempinfo = f.read() f.close() elif path.exists("/proc/stb/fp/temp_sensor"): f = open("/proc/stb/fp/temp_sensor", "r") tempinfo = f.read() f.close() if tempinfo and int(tempinfo.replace("\n", "")) > 0: mark = str("\xc2\xb0") AboutText += _("System temperature:\t%s") % tempinfo.replace("\n", "") + mark + "C\n" tempinfo = "" if path.exists("/proc/stb/fp/temp_sensor_avs"): f = open("/proc/stb/fp/temp_sensor_avs", "r") tempinfo = f.read() f.close() if tempinfo and int(tempinfo.replace("\n", "")) > 0: mark = str("\xc2\xb0") AboutText += _("Processor temperature:\t%s") % tempinfo.replace("\n", "") + mark + "C\n" self["AboutScrollLabel"] = ScrollLabel(AboutText)
def setMode(self, port, mode, rate, force = None): print "[AVSwitch] setMode - port: %s, mode: %s, rate: %s" % (port, mode, rate) self.current_mode = mode self.current_port = port modes = self.rates[mode][rate] mode_50 = modes.get(50) mode_60 = modes.get(60) mode_24 = modes.get(24) if mode_50 is None or force == 60: mode_50 = mode_60 if mode_60 is None or force == 50: mode_60 = mode_50 if mode_24 is None or force: mode_24 = mode_60 if force == 50: mode_24 = mode_50 try: f = open("/proc/stb/video/videomode_50hz", "w") f.write(mode_50) f.close() f = open("/proc/stb/video/videomode_60hz", "w") f.write(mode_60) f.close() except IOError: try: f = open("/proc/stb/video/videomode", "w") f.write(mode_50) f.close() except IOError: print "[AVSwitch] setting videomode failed." if SystemInfo["have24hz"]: try: open("/proc/stb/video/videomode_24hz", "w").write(mode_24) except IOError: print "[VideoHardware] cannot open /proc/stb/video/videomode_24hz" if getBrandOEM() in ('gigablue',): try: # use 50Hz mode (if available) for booting f = open("/etc/videomode", "w") f.write(mode_50) f.close() except IOError: print "[AVSwitch] writing initial videomode to /etc/videomode failed." map = {"cvbs": 0, "rgb": 1, "svideo": 2, "yuv": 3} self.setColorFormat(map[config.av.colorformat.value]) if about.getCPUString().startswith('STx'): from enigma import gMainDC gMainDC.getInstance().setResolution(-1, -1)
def populate(self): self["lab1"] = StaticText(_("Virtuosso Image Xtreme")) self["lab2"] = StaticText(_("By Team ViX")) model = None AboutText = "" self["lab3"] = StaticText(_("Support at") + " www.world-of-satellite.com") AboutText += _("Model:\t%s %s\n") % (getMachineBrand(), getMachineName()) if path.exists('/proc/stb/info/chipset'): AboutText += _("Chipset:\tBCM%s\n") % about.getChipSetString() AboutText += _("CPU:\t%s\n") % about.getCPUString() AboutText += _("CPU speed:\t%s\n") % about.getCPUSpeedString() AboutText += _("Cores:\t%s\n") % about.getCpuCoresString() imageSubBuild = "" if getImageType() != 'release': imageSubBuild = ".%s" % getImageDevBuild() AboutText += _("Build:\t%s.%s%s (%s)\n") % (getImageVersion(), getImageBuild(), imageSubBuild, getImageType().title()) AboutText += _("Skin name:\t%s\n") % config.skin.primary_skin.value[0:-9] string = getDriverDate() year = string[0:4] month = string[4:6] day = string[6:8] driversdate = '-'.join((year, month, day)) AboutText += _("Drivers:\t%s\n") % driversdate AboutText += _("Kernel:\t%s\n") % about.getKernelVersionString() AboutText += _("GStreamer:\t%s\n") % about.getGStreamerVersionString().replace("GStreamer ","") AboutText += _("Python:\t%s\n") % about.getPythonVersionString() AboutText += _("Installed:\t%s\n") % about.getFlashDateString() AboutText += _("Last update:\t%s\n\n") % getEnigmaVersionString() fp_version = getFPVersion() if fp_version is None: fp_version = "" elif fp_version != 0: fp_version = _("Frontprocessor version: %d") % fp_version AboutText += fp_version + "\n" tempinfo = "" if path.exists('/proc/stb/sensors/temp0/value') and getBoxType() not in ('gbquad'): f = open('/proc/stb/sensors/temp0/value', 'r') tempinfo = f.read() f.close() elif path.exists('/proc/stb/fp/temp_sensor') and getBoxType() not in ('gbquad'): f = open('/proc/stb/fp/temp_sensor', 'r') tempinfo = f.read() f.close() if tempinfo and int(tempinfo.replace('\n', '')) > 0: mark = str('\xc2\xb0') AboutText += _("System temperature: %s%sC\n\n") % (tempinfo.replace('\n', ''), mark) self["AboutScrollLabel"] = ScrollLabel(AboutText)
def populate(self): self["lab1"] = StaticText(_("Virtuosso Image Xtreme")) self["lab2"] = StaticText(_("By Team ViX")) model = None AboutText = "" self["lab3"] = StaticText(_("Support at") + " www.world-of-satellite.com") if getMachineBrand() == 'Vu+': self["lab3"] = StaticText(_("Support at") + " www.vuplus-support.com") elif getMachineBrand() == 'Xtrend': self["lab3"] = StaticText(_("Support at") + " www.xtrend-support.com") elif getMachineBrand() == 'Odin': self["lab3"] = StaticText(_("Support at") + " www.odin-support.com") AboutText += _("Model:\t%s %s\n") % (getMachineBrand(), getMachineName()) if path.exists('/proc/stb/info/chipset'): AboutText += _("Chipset:\tBCM%s") % about.getChipSetString() + "\n" AboutText += _("CPU:\t%s") % about.getCPUString() + "\n" AboutText += _("Cores:\t%s") % about.getCpuCoresString() + "\n" AboutText += _("Version:\t%s") % getImageVersion() + "\n" AboutText += _("Build:\t%s") % getImageBuild() + "\n" AboutText += _("Kernel:\t%s") % about.getKernelVersionString() + "\n" string = getDriverDate() year = string[0:4] month = string[4:6] day = string[6:8] driversdate = '-'.join((year, month, day)) AboutText += _("Drivers:\t%s") % driversdate + "\n" AboutText += _("Last update:\t%s") % getEnigmaVersionString() + "\n\n" fp_version = getFPVersion() if fp_version is None: fp_version = "" elif fp_version != 0: fp_version = _("Frontprocessor version: %d") % fp_version AboutText += fp_version + "\n" tempinfo = "" if path.exists('/proc/stb/sensors/temp0/value') and getBoxType() not in ('gbquad'): f = open('/proc/stb/sensors/temp0/value', 'r') tempinfo = f.read() f.close() elif path.exists('/proc/stb/fp/temp_sensor') and getBoxType() not in ('gbquad'): f = open('/proc/stb/fp/temp_sensor', 'r') tempinfo = f.read() f.close() if tempinfo and int(tempinfo.replace('\n', '')) > 0: mark = str('\xc2\xb0') AboutText += _("System temperature: %s") % tempinfo.replace('\n', '') + mark + "C\n\n" self["AboutScrollLabel"] = ScrollLabel(AboutText)
def updateColor(self, port): if about.getCPUString().startswith('STx'): print "updateColor: ", port if port == "DVI": self.setHDMIColor(config.av.colorformat_hdmi) elif port == "YPbPr": self.setYUVColor(config.av.colorformat_yuv) elif port == "Scart": map = {"cvbs": 0, "rgb": 1, "svideo": 2, "yuv": 3} from enigma import eAVSwitch eAVSwitch.getInstance().setColorFormat(map[config.av.colorformat.value])
def setMode(self, port, mode, rate, force=None): print "[VideoMode] setMode - port: %s, mode: %s, rate: %s" % (port, mode, rate) # config.av.videoport.setValue(port) # we can ignore "port" self.current_mode = mode self.current_port = port modes = self.rates[mode][rate] mode_50 = modes.get(50) mode_60 = modes.get(60) if mode_50 is None or force == 60: mode_50 = mode_60 if mode_60 is None or force == 50: mode_60 = mode_50 mode_etc = None if os.path.exists("/proc/stb/video/videomode_50hz") and getBoxType() not in ("gb800solo", "gb800se", "gb800ue"): try: f = open("/proc/stb/video/videomode_50hz", "w") f.write(mode_50) f.close() except IOError: print "setting videomode_50hz failed." if os.path.exists("/proc/stb/video/videomode_60hz") and getBoxType() not in ("gb800solo", "gb800se", "gb800ue"): try: f = open("/proc/stb/video/videomode_60hz", "w") f.write(mode_60) f.close() except IOError: print "setting videomode failed." try: mode_etc = modes.get(int(rate[:2])) f = open("/proc/stb/video/videomode", "w") f.write(mode_etc) f.close() except: # not support 50Hz, 60Hz for 1080p try: # fallback if no possibility to setup 50/60 hz mode f = open("/proc/stb/video/videomode", "w") f.write(mode_50) f.close() except IOError: print "setting videomode failed." map = {"cvbs": 0, "rgb": 1, "svideo": 2, "yuv": 3} self.setColorFormat(map[config.av.colorformat.value]) if about.getCPUString().startswith("STx"): # call setResolution() with -1,-1 to read the new scrren dimensions without changing the framebuffer resolution from enigma import gMainDC gMainDC.getInstance().setResolution(-1, -1)
def setMode(self, port, mode, rate, force=None): print "[VideoHardware] setMode - port: %s, mode: %s, rate: %s" % ( port, mode, rate) # config.av.videoport.setValue(port) # we can ignore "port" self.current_mode = mode self.current_port = port modes = self.rates[mode][rate] mode_50 = modes.get(50) mode_60 = modes.get(60) if mode_50 is None or force == 60: mode_50 = mode_60 if mode_60 is None or force == 50: mode_60 = mode_50 try: f = open("/proc/stb/video/videomode_50hz", "w") f.write(mode_50) f.close() except IOError: print "[AVSwitch] cannot open /proc/stb/video/videomode_50hz" try: f = open("/proc/stb/video/videomode_60hz", "w") f.write(mode_60) f.close() except IOError: print "[AVSwitch] cannot open /proc/stb/video/videomode_60hz" if getBrandOEM() in ('gigablue'): try: # use 50Hz mode (if available) for booting f = open("/etc/videomode", "w") f.write(mode_50) f.close() except IOError: print "[AVSwitch] GigaBlue writing initial videomode to /etc/videomode failed." try: set_mode = modes.get(int(rate[:2])) except: # not support 50Hz, 60Hz for 1080p set_mode = mode_50 f = open("/proc/stb/video/videomode", "w") f.write(set_mode) f.close() map = {"cvbs": 0, "rgb": 1, "svideo": 2, "yuv": 3} self.setColorFormat(map[config.av.colorformat.value]) if about.getCPUString().startswith('STx'): #call setResolution() with -1,-1 to read the new scrren dimensions without changing the framebuffer resolution from enigma import gMainDC gMainDC.getInstance().setResolution(-1, -1)
def populate(self): self["lab1"] = StaticText(_("ViX4E2PROJECT")) self["lab2"] = StaticText(_("By ViX4 Antony")) model = None AboutText = "" self["lab3"] = StaticText(_("www.ViX4.com")) AboutText += _("Model:\t%s %s\n") % (getMachineBrand(), getMachineName()) if path.exists('/proc/stb/info/chipset'): AboutText += _("Chipset:\t%s\n") % about.getChipSetString() AboutText += _("CPU:\t%s\n") % about.getCPUString() AboutText += _("CPU Speed:\t%s\n") % about.getCPUSpeedString() AboutText += _("Cores/Threads:\t%s\n") % about.getCpuCoresString() AboutText += _("Version:\t%s\n") % getImageVersion() AboutText += _("Build:\t%s\n") % getImageBuild() string = getDriverDate() year = string[0:4] month = string[4:6] day = string[6:8] driversdate = '-'.join((year, month, day)) AboutText += _("Drivers:\t%s\n") % driversdate AboutText += _("Kernel:\t%s\n") % about.getKernelVersionString() AboutText += _("GStreamer:\t%s\n") % about.getGStreamerVersionString().replace("GStreamer ","") AboutText += _("Python:\t%s\n") % about.getPythonVersionString() AboutText += _("Last update:\t%s\n\n") % getEnigmaVersionString() fp_version = getFPVersion() if fp_version is None: fp_version = "" elif fp_version != 0: fp_version = _("Frontprocessor version: %d") % fp_version AboutText += fp_version + "\n" tempinfo = "" if path.exists('/proc/stb/sensors/temp0/value') and getBoxType() not in ('gbquad'): f = open('/proc/stb/sensors/temp0/value', 'r') tempinfo = f.read() f.close() elif path.exists('/proc/stb/fp/temp_sensor') and getBoxType() not in ('gbquad'): f = open('/proc/stb/fp/temp_sensor', 'r') tempinfo = f.read() f.close() if tempinfo and int(tempinfo.replace('\n', '')) > 0: mark = str('\xc2\xb0') AboutText += _("System temperature: %s%sC\n\n") % (tempinfo.replace('\n', ''), mark) self["AboutScrollLabel"] = ScrollLabel(AboutText)
def populate(self): EGAMIVersion = _('EGAMI %s') % about.getImageVersionString() self['lab1'] = Label(EGAMIVersion) model = None AboutText = '' AboutText += _('Model:\t%s %s\n') % (getMachineBrand(), getMachineName()) if path.exists('/proc/stb/info/chipset'): AboutText += _('Chipset:\tBCM%s\n') % about.getChipSetString() AboutText += _('CPU:\t%s\n') % about.getCPUString() AboutText += _('CPU speed:\t%s\n') % about.getCPUSpeedString() AboutText += _('Cores:\t%s\n') % about.getCpuCoresString() AboutText += _('Version:\t%s') % EGAMIVersion + '\n' AboutText += _('Kernel:\t%s') % about.getKernelVersionString() + '\n' AboutText += _('Oe-Core:\t%s') % about.getEnigmaVersionString() + '\n' AboutText += _( 'Skin name:\t%s\n') % config.skin.primary_skin.value[0:-9] string = getDriverDate() year = string[0:4] month = string[4:6] day = string[6:8] driversdate = '-'.join((year, month, day)) AboutText += _('Drivers:\t%s') % driversdate + '\n' fp_version = getFPVersion() if fp_version is None: fp_version = '' elif fp_version != 0: fp_version = _('Front panel:\t%s') % str(fp_version) AboutText += fp_version + '\n' AboutText += _('Python:\t%s\n') % about.getPythonVersionString() AboutText += _('GStreamer:\t%s') % about.getGStreamerVersionString( ).replace('GStreamer', '') + '\n' AboutText += _('MoDerator:\tRedouane\n') + '\n' tempinfo = '' if path.exists('/proc/stb/sensors/temp0/value') and getBoxType( ) not in 'gbquad': f = open('/proc/stb/sensors/temp0/value', 'r') tempinfo = f.read() f.close() elif path.exists( '/proc/stb/fp/temp_sensor') and getBoxType() not in 'gbquad': f = open('/proc/stb/fp/temp_sensor', 'r') tempinfo = f.read() f.close() if tempinfo and int(tempinfo.replace('\n', '')) > 0: mark = str('\xc2\xb0') AboutText += _('System temperature: %s') % tempinfo.replace( '\n', '') + mark + 'C\n\n' AboutText += _('Installed:\t%s\n') % about.getFlashDateString() AboutText += _('Last update:\t%s') % getEnigmaVersionString() + '\n\n' AboutText += _('WWW:\t%s') % about.getImageUrlString() self['AboutScrollLabel'] = ScrollLabel(AboutText)
def setMode(self, port, mode, rate, force=None): # config.av.videoport.setValue(port) # we can ignore "port" self.current_mode = mode self.current_port = port modes = self.rates[mode][rate] mode_50 = modes.get(50) mode_60 = modes.get(60) if mode_50 is None or force == 60: mode_50 = mode_60 if mode_60 is None or force == 50: mode_60 = mode_50 if os.path.exists('/proc/stb/video/videomode_50hz') and getBoxType() not in ('gb800solo', 'gb800se', 'gb800ue'): try: f = open("/proc/stb/video/videomode_50hz", "w") f.write(mode_50) f.close() except: print "[AVSwitch] failed to set videomode_50hz to", mode_50 if os.path.exists('/proc/stb/video/videomode_60hz') and getBoxType() not in ('gb800solo', 'gb800se', 'gb800ue'): try: f = open("/proc/stb/video/videomode_60hz", "w") f.write(mode_60) f.close() except: print "[AVSwitch] failed to set videomode_60hz to", mode_60 try: if rate == "multi": mode_etc = mode_50 else: mode_etc = modes.get(int(rate[:2])) f = open("/proc/stb/video/videomode", "w") f.write(mode_etc) f.close() except: # not support 50Hz, 60Hz for 1080p try: # fallback if no possibility to setup 50/60 hz mode f = open("/proc/stb/video/videomode", "w") f.write(mode_50) f.close() except IOError as err: print "[AVSwitch] setting videomode failed:", err self.setColorFormat({"cvbs": 0, "rgb": 1, "svideo": 2, "yuv": 3}[config.av.colorformat.value]) if about.getCPUString().startswith('STx'): #call setResolution() with -1,-1 to read the new scrren dimesions without changing the framebuffer resolution from enigma import gMainDC gMainDC.getInstance().setResolution(-1, -1)
def setMode(self, port, mode, rate, force = None): print "setMode - port:", port, "mode:", mode, "rate:", rate # we can ignore "port" self.current_mode = mode self.current_port = port modes = self.rates[mode][rate] mode_50 = modes.get(50) mode_60 = modes.get(60) if mode_50 is None or force == 60: mode_50 = mode_60 if mode_60 is None or force == 50: mode_60 = mode_50 try: open("/proc/stb/video/videomode_50hz", "w").write(mode_50) open("/proc/stb/video/videomode_60hz", "w").write(mode_60) except IOError: try: # fallback if no possibility to setup 50/60 hz mode open("/proc/stb/video/videomode", "w").write(mode_50) except IOError: print "setting videomode failed." try: open("/etc/videomode", "w").write(mode_50) # use 50Hz mode (if available) for booting except IOError: print "writing initial videomode to /etc/videomode failed." if not about.getCPUString().startswith('BCM'): #call setResolution() with -1,-1 to read the new scrren dimesions without changing the framebuffer resolution from enigma import gMainDC gMainDC.getInstance().setResolution(-1, -1) self.updateAspect(None) if not about.getCPUString().startswith('BCM'): self.updateColor(port)
def setMode(self, port, mode, rate, force=None): print "[VideoMode] setMode - port: %s, mode: %s, rate: %s" % ( port, mode, rate) # config.av.videoport.setValue(port) # we can ignore "port" self.current_mode = mode self.current_port = port modes = self.rates[mode][rate] mode_50 = modes.get(50) mode_60 = modes.get(60) if mode_50 is None or force == 60: mode_50 = mode_60 if mode_60 is None or force == 50: mode_60 = mode_50 mode_etc = None if os.path.exists('/proc/stb/video/videomode_50hz') and getBoxType( ) not in ('gb800solo', 'gb800se', 'gb800ue'): f = open("/proc/stb/video/videomode_50hz", "w") f.write(mode_50) f.close() if os.path.exists('/proc/stb/video/videomode_60hz') and getBoxType( ) not in ('gb800solo', 'gb800se', 'gb800ue'): try: f = open("/proc/stb/video/videomode_60hz", "w") f.write(mode_60) f.close() except IOError: print "setting videomode failed." try: mode_etc = modes.get(int(rate[:2])) f = open("/proc/stb/video/videomode", "w") f.write(mode_etc) f.close() except: # not support 50Hz, 60Hz for 1080p try: # fallback if no possibility to setup 50/60 hz mode f = open("/proc/stb/video/videomode", "w") f.write(mode_50) f.close() except IOError: print "setting videomode failed." # self.updateAspect(None) if about.getCPUString().startswith('STx'): #call setResolution() with -1,-1 to read the new scrren dimensions without changing the framebuffer resolution from enigma import gMainDC gMainDC.getInstance().setResolution(-1, -1)
def populate(self): self["lab1"] = StaticText(_("openSWF")) self["lab2"] = StaticText(_("Mod Sodo")) model = None AboutText = "" self["lab3"] = StaticText(_("Support at") + " www.star7arab.com") AboutText += _("Model:\t%s %s\n") % (getMachineBrand(), getMachineName()) if path.exists('/proc/stb/info/chipset'): AboutText += _("Chipset:\tBCM%s") % about.getChipSetString().lower().replace('\n','').replace('bcm','') + "\n" AboutText += _("CPU:\t%s") % about.getCPUString() + "\n" AboutText += _("Cores:\t%s") % about.getCpuCoresString() + "\n" AboutText += _("Version:\t%s") % getImageVersionString() + "\n" AboutText += _("Build:\t%s") % getBuildVersionString() + "\n" AboutText += _("Kernel:\t%s") % about.getKernelVersionString() + "\n" AboutText += _("OpenGL : BroadCom 2.0") + "\n" string = getDriverDateString() year = string[0:4] month = string[4:6] day = string[6:8] driversdate = '-'.join((year, month, day)) AboutText += _("Drivers:\t%s") % driversdate + "\n" AboutText += _("Last update:\t%s") % getEnigmaVersionString() + "\n\n" fp_version = getFPVersion() if fp_version is None: fp_version = "" elif fp_version != 0: fp_version = _("Frontprocessor version: %d") % fp_version AboutText += fp_version + "\n" tempinfo = "" if path.exists('/proc/stb/sensors/temp0/value'): f = open('/proc/stb/sensors/temp0/value', 'r') tempinfo = f.read() f.close() elif path.exists('/proc/stb/fp/temp_sensor'): f = open('/proc/stb/fp/temp_sensor', 'r') tempinfo = f.read() f.close() if tempinfo and int(tempinfo.replace('\n','')) > 0: mark = str('\xc2\xb0') AboutText += _("System temperature: %s") % tempinfo.replace('\n','') + mark + "C\n\n" self["AboutScrollLabel"] = ScrollLabel(AboutText)
def setMode(self, port, mode, rate, force=None): print "[VideoHardware] setMode - port:", port, "mode:", mode, "rate:", rate # we can ignore "port" self.current_mode = mode self.current_port = port modes = self.rates[mode][rate] mode_50 = modes.get(50) mode_60 = modes.get(60) mode_24 = modes.get(24) if mode_50 is None or force == 60: mode_50 = mode_60 if mode_60 is None or force == 50: mode_60 = mode_50 if mode_24 is None or force: mode_24 = mode_60 if force == 50: mode_24 = mode_50 try: open("/proc/stb/video/videomode_50hz", "w").write(mode_50) open("/proc/stb/video/videomode_60hz", "w").write(mode_60) except IOError: try: # fallback if no possibility to setup 50/60 hz mode open("/proc/stb/video/videomode", "w").write(mode_50) except IOError: print "[VideoHardware] setting videomode failed." try: open("/etc/videomode", "w").write( mode_50) # use 50Hz mode (if available) for booting except IOError: print "[VideoHardware] writing initial videomode to /etc/videomode failed." if self.has24pAvailable: try: open("/proc/stb/video/videomode_24hz", "w").write(mode_24) except IOError: print "[VideoHardware] cannot open /proc/stb/video/videomode_24hz" if about.getCPUString().startswith('STx'): #call setResolution() with -1,-1 to read the new scrren dimesions without changing the framebuffer resolution from enigma import gMainDC gMainDC.getInstance().setResolution(-1, -1) self.updateAspect(None)
def populate(self): EGAMIVersion = _('EGAMI %s') % about.getImageVersionString() self['lab1'] = Label(EGAMIVersion) model = None AboutText = '' AboutText += _('Model:\t%s %s\n') % (getMachineBrand(), getMachineName()) if path.exists('/proc/stb/info/chipset'): AboutText += _('Chipset:\tBCM%s\n') % about.getChipSetString() AboutText += _('CPU:\t%s\n') % about.getCPUString() AboutText += _('CPU speed:\t%s\n') % about.getCPUSpeedString() AboutText += _('Cores:\t%s\n') % about.getCpuCoresString() AboutText += _('Version:\t%s') % EGAMIVersion + '\n' AboutText += _('Kernel:\t%s') % about.getKernelVersionString() + '\n' AboutText += _('Oe-Core:\tOe-Alliance 3.4') + '\n' AboutText += _('Moderator:\tRedouane') + '\n' AboutText += _('Image Type:\t%s\n') % getImageType().title() AboutText += _('Skin name:\t%s\n') % config.skin.primary_skin.value[0:-9] string = getDriverDate() year = string[0:4] month = string[4:6] day = string[6:8] driversdate = '-'.join((year, month, day)) AboutText += _('Drivers:\t%s') % driversdate + '\n' fp_version = getFPVersion() if fp_version is None: fp_version = '' elif fp_version != 0: fp_version = _('Front panel:\t%s') % str(fp_version) AboutText += fp_version + '\n' AboutText += _('Python:\t%s\n') % about.getPythonVersionString() AboutText += _('GStreamer:\t%s') % about.getGStreamerVersionString().replace('GStreamer', '') + '\n\n' tempinfo = '' if path.exists('/proc/stb/sensors/temp0/value') and getBoxType() not in 'gbquad': f = open('/proc/stb/sensors/temp0/value', 'r') tempinfo = f.read() f.close() elif path.exists('/proc/stb/fp/temp_sensor') and getBoxType() not in 'gbquad': f = open('/proc/stb/fp/temp_sensor', 'r') tempinfo = f.read() f.close() if tempinfo and int(tempinfo.replace('\n', '')) > 0: mark = str('\xc2\xb0') AboutText += _('System temperature: %s') % tempinfo.replace('\n', '') + mark + 'C\n\n' AboutText += _('Installed:\t%s\n') % about.getFlashDateString() AboutText += _('Last update:\t%s') % getEnigmaVersionString() + '\n\n' AboutText += _('WWW:\t%s') % about.getImageUrlString() self['AboutScrollLabel'] = ScrollLabel(AboutText) return
def setMode(self, port, mode, rate, force = None): print "[VideoMode] setMode - port: %s, mode: %s, rate: %s" % (port, mode, rate) # config.av.videoport.setValue(port) # we can ignore "port" self.current_mode = mode self.current_port = port modes = self.rates[mode][rate] mode_50 = modes.get(50) mode_60 = modes.get(60) if mode_50 is None or force == 60: mode_50 = mode_60 if mode_60 is None or force == 50: mode_60 = mode_50 try: f = open("/proc/stb/video/videomode_50hz", "w") f.write(mode_50) f.close() f = open("/proc/stb/video/videomode_60hz", "w") f.write(mode_60) f.close() except IOError: try: # fallback if no possibility to setup 50/60 hz mode f = open("/proc/stb/video/videomode", "w") f.write(mode_50) f.close() except IOError: print "[AVSwitch] setting videomode failed." # try: # # use 50Hz mode (if available) for booting # f = open("/etc/videomode", "w") # f.write(mode_50) # f.close() # except IOError: # print "[AVSwitch] writing initial videomode to /etc/videomode failed." map = {"cvbs": 0, "rgb": 1, "svideo": 2, "yuv": 3} self.setColorFormat(map[config.av.colorformat.value]) if about.getCPUString().startswith('STx'): #call setResolution() with -1,-1 to read the new scrren dimensions without changing the framebuffer resolution from enigma import gMainDC gMainDC.getInstance().setResolution(-1, -1)
def populate(self, bootLoaderInfo): self.list = [] self.list.append(self.makeHeadingInfoEntry(_("Model:"), "%s %s" % (getMachineBrand(), getMachineName()))) self.list.append(self.makeEmptyEntry()) if path.exists('/proc/stb/info/chipset'): self.list.append(self.makeInfoEntry(_("Chipset:"), "BCM%s" % about.getChipSetString())) self.list.append(self.makeInfoEntry(_("CPU:"), about.getCPUString())) self.list.append(self.makeInfoEntry(_("CPU Speed:"), about.getCPUSpeedString())) self.list.append(self.makeInfoEntry(_("Cores:"), str(about.getCpuCoresString()))) string = getDriverDate() year = string[0:4] month = string[4:6] day = string[6:8] driversdate = '-'.join((year, month, day)) self.list.append(self.makeInfoEntry(_("Drivers:"), driversdate)) self.list.append(self.makeInfoEntry(_("Image:"), about.getImageVersionString())) self.list.append(self.makeInfoEntry(_("Kernel:"), about.getKernelVersionString())) self.list.append(self.makeInfoEntry(_("Oe-Core:"), about.getEnigmaVersionString())) self.list.append(self.makeInfoEntry(_("Bootloader:"), bootLoaderInfo)) fp_version = getFPVersion() if fp_version is not None: self.list.append(self.makeInfoEntry(_("Front Panel:"), "%d" % fp_version)) self.list.append(self.makeEmptyEntry()) self.list.append(self.makeInfoEntry(_("Last Upgrade:"), about.getLastUpdateString())) self.list.append(self.makeEmptyEntry()) self.list.append(self.makeInfoEntry(_("WWW:"), about.getImageUrlString())) tempinfo = "" if path.exists('/proc/stb/sensors/temp0/value'): tempinfo = file('/proc/stb/sensors/temp0/value').read() elif path.exists('/proc/stb/fp/temp_sensor'): tempinfo = file('/proc/stb/fp/temp_sensor').read() if tempinfo and int(tempinfo.replace('\n', '')) > 0: mark = str('\xc2\xb0') self.list.append(self.makeInfoEntry(_("System temperature:"), tempinfo.replace('\n', '') + mark + "C")) self.list.append(self.makeInfoEntry(_("GStreamer:"), about.getGStreamerVersionString().replace("GStreamer", "").strip())) self.list.append(self.makeInfoEntry(_("Python:"), about.getPythonVersionString())) self["list"].updateList(self.list)
def populate(self): EGAMIVersion = _("EGAMI %s") % about.getImageVersionString() self["lab1"] = Label(EGAMIVersion) model = None AboutText = "" AboutText += _("Model:\t%s %s\n") % (getMachineBrand(), getMachineName()) if path.exists("/proc/stb/info/chipset"): AboutText += _("Chipset:\tBCM%s\n") % about.getChipSetString() AboutText += _("CPU:\t%s\n") % about.getCPUString() AboutText += _("CPU Speed:\t%s\n") % about.getCPUSpeedString() AboutText += _("Cores:\t%s\n") % about.getCpuCoresString() AboutText += _("Version:\t%s") % EGAMIVersion + "\n" AboutText += _("Kernel:\t%s") % about.getKernelVersionString() + "\n" AboutText += _("Oe-Core:\t%s") % about.getEnigmaVersionString() + "\n" AboutText += _("Image Type:\t%s\n") % getImageType().title() AboutText += _("Image Coder:\tSODO\n") string = getDriverDate() year = string[0:4] month = string[4:6] day = string[6:8] driversdate = "-".join((year, month, day)) AboutText += _("Drivers:\t%s") % driversdate + "\n" fp_version = getFPVersion() if fp_version is None: fp_version = "" elif fp_version != 0: fp_version = _("Front panel:\t%s") % str(fp_version) AboutText += fp_version + "\n" AboutText += _("Python:\t%s\n") % about.getPythonVersionString() AboutText += _("GStreamer:\t%s") % about.getGStreamerVersionString().replace("GStreamer", "") + "\n\n" tempinfo = "" if path.exists("/proc/stb/sensors/temp0/value") and getBoxType() not in "gbquad": f = open("/proc/stb/sensors/temp0/value", "r") tempinfo = f.read() f.close() elif path.exists("/proc/stb/fp/temp_sensor") and getBoxType() not in "gbquad": f = open("/proc/stb/fp/temp_sensor", "r") tempinfo = f.read() f.close() if tempinfo and int(tempinfo.replace("\n", "")) > 0: mark = str("\xc2\xb0") AboutText += _("System temperature: %s") % tempinfo.replace("\n", "") + mark + "C\n\n" AboutText += _("Installed:\t%s\n") % about.getFlashDateString() AboutText += _("Last update:\t%s") % getEnigmaVersionString() + "\n\n" AboutText += _("WWW:\t%s") % about.getImageUrlString() self["AboutScrollLabel"] = ScrollLabel(AboutText)
def setMode(self, port, mode, rate, force = None): print '[VideoMode] setMode - port: %s, mode: %s, rate: %s' % (port, mode, rate) self.current_mode = mode self.current_port = port modes = self.rates[mode][rate] mode_50 = modes.get(50) mode_60 = modes.get(60) if mode_50 is None or force == 60: mode_50 = mode_60 if mode_60 is None or force == 50: mode_60 = mode_50 mode_etc = None if os.path.exists('/proc/stb/video/videomode_50hz') and getBoxType() not in ('gb800solo', 'gb800se', 'gb800ue'): f = open('/proc/stb/video/videomode_50hz', 'w') f.write(mode_50) f.close() try: if os.path.exists('/proc/stb/video/videomode_60hz') and getBoxType() not in ('gb800solo', 'gb800se', 'gb800ue'): if getBrandOEM() not in 'ini': f = open('/proc/stb/video/videomode_60hz', 'w') f.write(mode_60) f.close() except: print 'Problems with RW /proc/stb/video/videomode_60hz' try: mode_etc = modes.get(int(rate[:2])) f = open('/proc/stb/video/videomode', 'w') f.write(mode_etc) f.close() except: try: f = open('/proc/stb/video/videomode', 'w') f.write(mode_50) f.close() except IOError: print 'setting videomode failed.' map = {'cvbs': 0, 'rgb': 1, 'svideo': 2, 'yuv': 3} self.setColorFormat(map[config.av.colorformat.value]) if about.getCPUString().startswith('STx'): from enigma import gMainDC gMainDC.getInstance().setResolution(-1, -1)
def populate(self): self['lab1'] = StaticText( _('Version:\t%s') % getImageVersion() + _(' %s') % getImageBuild()) self['lab2'] = StaticText(_('By REDOUANE')) model = None AboutText = '' self['lab3'] = StaticText(_('Support at') + ' www.pkteam.pl') AboutText += _('Model:\t%s %s\n') % (getMachineBrand(), getMachineName()) if path.exists('/proc/stb/info/chipset'): AboutText += _('Chipset:\tBCM%s') % about.getChipSetString() + '\n' AboutText += _('CPU:\t%s') % about.getCPUString() + '\n' AboutText += _('Cores:\t%s') % about.getCpuCoresString() + '\n' AboutText += _('Version:\t%s') % getImageVersion() + '\n' AboutText += _('Build:\t%s') % getImageBuild() + '\n' AboutText += _('Kernel:\t%s') % about.getKernelVersionString() + '\n' AboutText += _('OPENGL:\tGLS BroadCom V2.0') + '\n' string = getDriverDate() year = string[0:4] month = string[4:6] day = string[6:8] driversdate = '-'.join((year, month, day)) AboutText += _('Drivers:\t%s') % driversdate + '\n' AboutText += _('Last update:\t%s') % getEnigmaVersionString() + '\n\n' fp_version = getFPVersion() if fp_version is None: fp_version = '' elif fp_version != 0: fp_version = _('Frontprocessor version: %d') % fp_version AboutText += fp_version + '\n' tempinfo = '' if path.exists('/proc/stb/sensors/temp0/value'): f = open('/proc/stb/sensors/temp0/value', 'r') tempinfo = f.read() f.close() elif path.exists('/proc/stb/fp/temp_sensor'): f = open('/proc/stb/fp/temp_sensor', 'r') tempinfo = f.read() f.close() if tempinfo and int(tempinfo.replace('\n', '')) > 0: mark = str('\xc2\xb0') AboutText += _('System temperature: %s') % tempinfo.replace( '\n', '') + mark + 'C\n\n' self['AboutScrollLabel'] = ScrollLabel(AboutText)
def setMode(self, port, mode, rate, force=None): print "[VideoHardware] setMode - port: %s, mode: %s, rate: %s" % ( port, mode, rate) # config.av.videoport.setValue(port) # we can ignore "port" self.current_mode = mode self.current_port = port modes = self.rates[mode][rate] mode_50 = modes.get(50) mode_60 = modes.get(60) if mode_50 is None or force == 60: mode_50 = mode_60 if mode_60 is None or force == 50: mode_60 = mode_50 if os.path.exists('/proc/stb/video/videomode_50hz') and getBoxType( ) not in ('gbquadplus', 'gb800solo', 'gb800se', 'gb800ue', 'gb800ueplus'): f = open("/proc/stb/video/videomode_50hz", "w") f.write(mode_50) f.close() if os.path.exists('/proc/stb/video/videomode_60hz') and getBoxType( ) not in ('gbquadplus', 'gb800solo', 'gb800se', 'gb800ue', 'gb800ueplus'): f = open("/proc/stb/video/videomode_60hz", "w") f.write(mode_60) f.close() try: set_mode = modes.get(int(rate[:2])) except: # not support 50Hz, 60Hz for 1080p set_mode = mode_50 f = open("/proc/stb/video/videomode", "w") f.write(set_mode) f.close() map = {"cvbs": 0, "rgb": 1, "svideo": 2, "yuv": 3} self.setColorFormat(map[config.av.colorformat.value]) if about.getCPUString().startswith('STx'): #call setResolution() with -1,-1 to read the new scrren dimesions without changing the framebuffer resolution from enigma import gMainDC gMainDC.getInstance().setResolution(-1, -1)
def populate(self): self['lab1'] = StaticText(_('Version:\t%s') % getImageVersion() + _(' %s') % getImageBuild()) self['lab2'] = StaticText(_('By REDOUANE')) model = None AboutText = '' self['lab3'] = StaticText(_('Support at') + ' www.pkteam.pl') AboutText += _('Model:\t%s %s\n') % (getMachineBrand(), getMachineName()) if path.exists('/proc/stb/info/chipset'): AboutText += _('Chipset:\tBCM%s') % about.getChipSetString() + '\n' AboutText += _('CPU:\t%s') % about.getCPUString() + '\n' AboutText += _('Cores:\t%s') % about.getCpuCoresString() + '\n' AboutText += _('Version:\t%s') % getImageVersion() + '\n' AboutText += _('Build:\t%s') % getImageBuild() + '\n' AboutText += _('Kernel:\t%s') % about.getKernelVersionString() + '\n' AboutText += _('OPENGL:\tGLS BroadCom V2.0') + '\n' string = getDriverDate() year = string[0:4] month = string[4:6] day = string[6:8] driversdate = '-'.join((year, month, day)) AboutText += _('Drivers:\t%s') % driversdate + '\n' AboutText += _('Last update:\t%s') % getEnigmaVersionString() + '\n\n' fp_version = getFPVersion() if fp_version is None: fp_version = '' elif fp_version != 0: fp_version = _('Frontprocessor version: %d') % fp_version AboutText += fp_version + '\n' tempinfo = '' if path.exists('/proc/stb/sensors/temp0/value'): f = open('/proc/stb/sensors/temp0/value', 'r') tempinfo = f.read() f.close() elif path.exists('/proc/stb/fp/temp_sensor'): f = open('/proc/stb/fp/temp_sensor', 'r') tempinfo = f.read() f.close() if tempinfo and int(tempinfo.replace('\n', '')) > 0: mark = str('\xc2\xb0') AboutText += _('System temperature: %s') % tempinfo.replace('\n', '') + mark + 'C\n\n' self['AboutScrollLabel'] = ScrollLabel(AboutText)
def setMode(self, port, mode, rate, force=None): print "[VideoMode] setMode - port: %s, mode: %s, rate: %s" % ( port, mode, rate) # config.av.videoport.setValue(port) # we can ignore "port" self.current_mode = mode self.current_port = port modes = self.rates[mode][rate] mode_50 = modes.get(50) mode_60 = modes.get(60) if mode_50 is None or force == 60: mode_50 = mode_60 if mode_60 is None or force == 50: mode_60 = mode_50 try: f = open("/proc/stb/video/videomode_50hz", "w") f.write(mode_50) f.close() f = open("/proc/stb/video/videomode_60hz", "w") f.write(mode_60) f.close() except IOError: try: # fallback if no possibility to setup 50/60 hz mode f = open("/proc/stb/video/videomode", "w") f.write(mode_50) f.close() except IOError: print "[AVSwitch] setting videomode failed." map = {"cvbs": 0, "rgb": 1, "svideo": 2, "yuv": 3} self.setColorFormat(map[config.av.colorformat.value]) if about.getCPUString().startswith('STx'): #call setResolution() with -1,-1 to read the new scrren dimensions without changing the framebuffer resolution from enigma import gMainDC gMainDC.getInstance().setResolution(-1, -1)
def setMode(self, port, mode, rate, force = None): print "[VideoHardware] setMode - port: %s, mode: %s, rate: %s" % (port, mode, rate) # config.av.videoport.setValue(port) # we can ignore "port" self.current_mode = mode self.current_port = port modes = self.rates[mode][rate] mode_50 = modes.get(50) mode_60 = modes.get(60) if mode_50 is None or force == 60: mode_50 = mode_60 if mode_60 is None or force == 50: mode_60 = mode_50 if os.path.exists('/proc/stb/video/videomode_50hz') and getBoxType() not in ('gb800solo', 'gb800se', 'gb800ue'): f = open("/proc/stb/video/videomode_50hz", "w") f.write(mode_50) f.close() if os.path.exists('/proc/stb/video/videomode_60hz') and getBoxType() not in ('gb800solo', 'gb800se', 'gb800ue'): f = open("/proc/stb/video/videomode_60hz", "w") f.write(mode_60) f.close() try: set_mode = modes.get(int(rate[:2])) except: # not support 50Hz, 60Hz for 1080p set_mode = mode_50 f = open("/proc/stb/video/videomode", "w") f.write(set_mode) f.close() map = {"cvbs": 0, "rgb": 1, "svideo": 2, "yuv": 3} self.setColorFormat(map[config.av.colorformat.value]) if about.getCPUString().startswith('STx'): #call setResolution() with -1,-1 to read the new scrren dimesions without changing the framebuffer resolution from enigma import gMainDC gMainDC.getInstance().setResolution(-1, -1)
def getAboutText(): AboutText = "" AboutText += _("Model:\t%s %s\n") % (getMachineBrand(), getMachineName()) if path.exists('/proc/stb/info/chipset'): AboutText += _("Chipset:\t%s") % about.getChipSetString() + "\n" cpuMHz = "" if getMachineBuild() in ('vusolo4k', 'hd51'): cpuMHz = " (1,5 GHz)" elif getMachineBuild() in ('hd52'): cpuMHz = " (1,7 GHz)" else: if path.exists('/proc/cpuinfo'): f = open('/proc/cpuinfo', 'r') temp = f.readlines() f.close() try: for lines in temp: lisp = lines.split(': ') if lisp[0].startswith('cpu MHz'): #cpuMHz = " (" + lisp[1].replace('\n', '') + " MHz)" cpuMHz = " (" + str(int(float(lisp[1].replace('\n', '')))) + " MHz)" break except: pass AboutText += _("CPU:\t%s") % about.getCPUString() + cpuMHz + "\n" AboutText += _("Cores:\t%s") % about.getCpuCoresString() + "\n" AboutText += _("Version:\t%s") % getImageVersion() + "\n" AboutText += _("Build:\t%s") % getImageBuild() + "\n" AboutText += _("Kernel:\t%s") % about.getKernelVersionString() + "\n" string = getDriverDate() year = string[0:4] month = string[4:6] day = string[6:8] driversdate = '-'.join((year, month, day)) AboutText += _("Drivers:\t%s") % driversdate + "\n" AboutText += _("GStreamer:\t%s") % about.getGStreamerVersionString() + "\n" AboutText += _("Python:\t%s") % about.getPythonVersionString() + "\n" AboutText += _("Installed:\t%s") % about.getFlashDateString() + "\n" AboutText += _("Last update:\t%s") % getEnigmaVersionString() + "\n" fp_version = getFPVersion() if fp_version is None: fp_version = "" elif fp_version != 0: fp_version = _("Frontprocessor version: %s") % fp_version AboutText += fp_version + "\n" tempinfo = "" if path.exists('/proc/stb/sensors/temp0/value'): f = open('/proc/stb/sensors/temp0/value', 'r') tempinfo = f.read() f.close() elif path.exists('/proc/stb/fp/temp_sensor'): f = open('/proc/stb/fp/temp_sensor', 'r') tempinfo = f.read() f.close() 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() if tempinfo and int(tempinfo.replace('\n', '')) > 0: mark = str('\xc2\xb0') AboutText += _("Processor temperature:\t%s") % tempinfo.replace('\n', '').replace(' ','') + mark + "C\n" AboutLcdText = AboutText.replace('\t', ' ') return AboutText, AboutLcdText
def VideoChangeDetect(self): config_port = config.av.videoport.getValue() config_mode = str(config.av.videomode[config_port].getValue()).replace('\n','') config_res = str(config.av.videomode[config_port].getValue()[:-1]).replace('\n','') config_pol = str(config.av.videomode[config_port].getValue()[-1:]).replace('\n','') config_rate = str(config.av.videorate[config_mode].getValue()).replace('Hz','').replace('\n','') f = open("/proc/stb/video/videomode") current_mode = f.read()[:-1].replace('\n','') f.close() if current_mode.upper() in ('PAL', 'NTSC'): current_mode = current_mode.upper() current_pol = '' if 'i' in current_mode: current_pol = 'i' elif 'p' in current_mode: current_pol = 'p' current_res = current_pol and current_mode.split(current_pol)[0].replace('\n','') or "" current_rate = current_pol and current_mode.split(current_pol)[0].replace('\n','') and current_mode.split(current_pol)[1].replace('\n','') or "" video_height = None video_width = None video_pol = None video_rate = None if path.exists("/proc/stb/vmpeg/0/yres"): f = open("/proc/stb/vmpeg/0/yres", "r") video_height = int(f.read(),16) f.close() if path.exists("/proc/stb/vmpeg/0/xres"): f = open("/proc/stb/vmpeg/0/xres", "r") video_width = int(f.read(),16) f.close() if path.exists("/proc/stb/vmpeg/0/progressive"): f = open("/proc/stb/vmpeg/0/progressive", "r") video_pol = "p" if int(f.read(),16) else "i" f.close() if path.exists("/proc/stb/vmpeg/0/framerate"): f = open("/proc/stb/vmpeg/0/framerate", "r") try: video_rate = int(f.read()) except: video_rate = 50 f.close() if not video_height or not video_width or not video_pol or not video_rate: service = self.session.nav.getCurrentService() if service is not None: info = service.info() else: info = None if info: video_height = int(info.getInfo(iServiceInformation.sVideoHeight)) video_width = int(info.getInfo(iServiceInformation.sVideoWidth)) video_pol = ("i", "p")[info.getInfo(iServiceInformation.sProgressive)] video_rate = int(info.getInfo(iServiceInformation.sFrameRate)) if video_height and video_width and video_pol and video_rate: resolutionlabel["content"].setText(_("Video content: %ix%i%s %iHz") % (video_width, video_height, video_pol, (video_rate + 500) / 1000)) if video_height != -1: if video_height > 720 or video_width > 1280: new_res = "1080" elif (576 < video_height <= 720) or video_width > 1024: new_res = "720" elif (480 < video_height <= 576) or video_width > 720 or video_rate in (25000, 23976, 24000): new_res = "576" else: new_res = "480" else: new_res = config_res if video_rate != -1: if video_rate == 25000 and video_pol == 'i': new_rate = 50000 elif video_rate == 59940 or (video_rate == 29970 and video_pol == 'i') or (video_rate == 29970 and video_pol == 'p' and config.av.autores.getValue() == 'disabled'): new_rate = 60000 elif video_rate == 23976: new_rate = 24000 elif video_rate == 29970: new_rate = 30000 else: new_rate = video_rate new_rate = str((new_rate + 500) / 1000) else: new_rate = config_rate if video_pol != -1: new_pol = str(video_pol) else: new_pol = config_pol write_mode = None new_mode = None if config_mode in ('PAL', 'NTSC'): write_mode = config_mode elif config.av.autores.getValue() == 'all' or (config.av.autores.getValue() == 'hd' and int(new_res) >= 720): if (config.av.autores_deinterlace.getValue() and about.getCPUString() in 'BCM7346B2, BCM7425B2') or config.av.autores_deinterlace.getValue() and about.getCPUString() not in 'BCM7346B2, BCM7425B2' and int(new_res) <= 720: new_pol = new_pol.replace('i','p') if new_res+new_pol+new_rate in iAVSwitch.modes_available: new_mode = new_res+new_pol+new_rate if new_mode == '720p24': new_mode = config.av.autores_720p24.getValue() if new_mode == '1080p24': new_mode = config.av.autores_1080p24.getValue() if new_mode == '1080p25': new_mode = config.av.autores_1080p25.getValue() if new_mode == '1080p30': new_mode = config.av.autores_1080p30.getValue() elif new_res+new_pol in iAVSwitch.modes_available: new_mode = new_res+new_pol else: write_mode = config_mode+new_rate write_mode = new_mode elif config.av.autores.getValue() == 'hd' and int(new_res) <= 576: if (config.av.autores_deinterlace.getValue() and about.getCPUString() in 'BCM7346B2, BCM7425B2') or config.av.autores_deinterlace.getValue() and about.getCPUString() not in 'BCM7346B2, BCM7425B2' and not config.av.autores_sd.getValue() in '1080i': new_mode = config.av.autores_sd.getValue().replace('i','p')+new_rate else: if new_pol in 'p': new_mode = config.av.autores_sd.getValue().replace('i','p')+new_rate else: new_mode = config.av.autores_sd.getValue()+new_rate if new_mode == '720p24': new_mode = config.av.autores_720p24.getValue() if new_mode == '1080p24': new_mode = config.av.autores_1080p24.getValue() if new_mode == '1080p25': new_mode = config.av.autores_1080p25.getValue() if new_mode == '1080p30': new_mode = config.av.autores_1080p30.getValue() write_mode = new_mode else: if path.exists('/proc/stb/video/videomode_%shz' % new_rate) and config_rate == 'multi': f = open("/proc/stb/video/videomode_%shz" % new_rate, "r") multi_videomode = f.read().replace('\n','') f.close() if multi_videomode and (current_mode != multi_videomode): write_mode = multi_videomode else: write_mode = config_mode+new_rate if write_mode and current_mode != write_mode and self.bufferfull: resolutionlabel["restxt"].setText(_("Video mode: %s") % write_mode) if config.av.autores_label_timeout.getValue() != '0': resolutionlabel.show() print "[VideoMode] setMode - port: %s, mode: %s" % (config_port, write_mode) f = open("/proc/stb/video/videomode", "w") f.write(write_mode) f.close() iAVSwitch.setAspect(config.av.aspect) iAVSwitch.setWss(config.av.wss) iAVSwitch.setPolicy43(config.av.policy_43) iAVSwitch.setPolicy169(config.av.policy_169) self.delay = False self.detecttimer.stop()
def populate(self): model = None AboutText = "" AboutText += _("Model:\t%s %s\n") % (getMachineBrand(), getMachineName()) if path.exists('/proc/stb/info/chipset'): AboutText += _("Chipset:\t%s") % about.getChipSetString() + "\n" cpuMHz = "" if path.exists('/proc/cpuinfo'): f = open('/proc/cpuinfo', 'r') temp = f.readlines() f.close() try: for lines in temp: lisp = lines.split(': ') if lisp[0].startswith('cpu MHz'): #cpuMHz = " (" + lisp[1].replace('\n', '') + " MHz)" cpuMHz = " (" + str(int(float(lisp[1].replace('\n', '')))) + " MHz)" break except: pass AboutText += _("CPU:\t%s") % about.getCPUString() + cpuMHz + "\n" AboutText += _("Cores:\t%s") % about.getCpuCoresString() + "\n" AboutText += _("Version:\t%s") % getImageVersion() + "\n" AboutText += _("Front Panel:\t%s") % getMicomVersion() + "\n" #AboutText += _("Build:\t%s") % getImageBuild() + "\n" AboutText += _("Kernel:\t%s") % about.getKernelVersionString() + "\n" AboutText += _("Drivers:\t%s") % about.getDriverBuildDateString() + "\n" AboutText += _("Bootloader:\t%s") % self.loader + "\n" AboutText += _("GStreamer:\t%s") % about.getGStreamerVersionString() + "\n" AboutText += _("Last update:\t%s") % getEnigmaVersionString() + "\n\n" fp_version = getFPVersion() if fp_version is None: fp_version = "" elif fp_version != 0: fp_version = _("Frontprocessor version: %s") % fp_version #AboutText += fp_version + "\n" tempinfo = "" if path.exists('/proc/stb/sensors/temp0/value'): f = open('/proc/stb/sensors/temp0/value', 'r') tempinfo = f.read() f.close() elif path.exists('/proc/stb/fp/temp_sensor'): f = open('/proc/stb/fp/temp_sensor', 'r') tempinfo = f.read() f.close() if tempinfo and int(tempinfo.replace('\n', '')) > 0: mark = str('\xc2\xb0') AboutText += _("System temperature:\t%s") % tempinfo.replace('\n', '') + mark + "C\n" tempinfo = "" if path.exists('/proc/stb/fp/temp_sensor_avs'): f = open('/proc/stb/fp/temp_sensor_avs', 'r') tempinfo = f.read() f.close() if tempinfo and int(tempinfo.replace('\n', '')) > 0: mark = str('\xc2\xb0') AboutText += _("Processor temperature:\t%s") % tempinfo.replace('\n', '') + mark + "C\n" self["AboutScrollLabel"].setText(AboutText)
def populate(self): self["lab1"] = StaticText(_("openHDF by HDF Image Team")) self["lab2"] = StaticText(_("Support at") + " www.HDFreaks.cc") model = None AboutText = "" self["lab2"] = StaticText(_("Support @") + " www.hdfreaks.cc") AboutText += _("Model:\t%s %s - OEM Model: %s\n") % (getMachineBrand(), getMachineName(), getBrandOEM()) if path.exists('/proc/stb/info/chipset'): AboutText += _("Chipset:\tBCM%s") % about.getChipSetString() + "\n" cmd = 'cat /proc/cpuinfo | grep "cpu MHz" -m 1 | awk -F ": " ' + "'{print $2}'" cmd2 = 'cat /proc/cpuinfo | grep "BogoMIPS" -m 1 | awk -F ": " ' + "'{print $2}'" try: res = popen(cmd).read() res2 = popen(cmd2).read() except: res = "" res2 = "" cpuMHz = "" bootloader = "" if path.exists('/sys/firmware/devicetree/base/bolt/tag'): f = open('/sys/firmware/devicetree/base/bolt/tag', 'r') bootloader = f.readline().replace('\x00', '').replace('\n', '') f.close() BootLoaderVersion = 0 try: if bootloader: AboutText += _("Bootloader:\t%s\n") % (bootloader) BootLoaderVersion = int(bootloader[1:]) except: BootLoaderVersion = 0 if getMachineBuild() in ('vusolo4k'): cpuMHz = " (1,5 GHz)" elif getMachineBuild() in ('vuuno4k','dm900','gb7252','dags7252'): cpuMHz = " (1,7 GHz)" elif getMachineBuild() in ('formuler1tc','formuler1','triplex'): cpuMHz = " (1,3 GHz)" elif getMachineBuild() in ('u5','u51','u52','u53','u5pvr','h9','sf8008'): cpuMHz = " (1,6 GHz)" elif getMachineBuild() in ('et1x000','hd52','hd51','sf4008','vs1500','h7','8100s'): try: import binascii f = open('/sys/firmware/devicetree/base/cpus/cpu@0/clock-frequency', 'rb') clockfrequency = f.read() f.close() cpuMHz = "%s MHz" % str(round(int(binascii.hexlify(clockfrequency), 16)/1000000,1)) except: cpuMHz = "1,7 GHz" else: if path.exists('/proc/cpuinfo'): f = open('/proc/cpuinfo', 'r') temp = f.readlines() f.close() try: for lines in temp: lisp = lines.split(': ') if lisp[0].startswith('cpu MHz'): #cpuMHz = " (" + lisp[1].replace('\n', '') + " MHz)" cpuMHz = " (" + str(int(float(lisp[1].replace('\n', '')))) + " MHz)" break except: pass bogoMIPS = "" if res: cpuMHz = "" + res.replace("\n", "") + " MHz" if res2: bogoMIPS = "" + res2.replace("\n", "") if getMachineBuild() in ('vusolo4k','hd51','hd52','sf4008','dm900','h7','gb7252','8100s'): AboutText += _("CPU:\t%s") % about.getCPUString() + cpuMHz + "\n" else: AboutText += _("CPU:\t%s") % about.getCPUString() + " " + cpuMHz + "\n" dMIPS = 0 if getMachineBuild() in ('vusolo4k'): dMIPS = "10.500" elif getMachineBuild() in ('hd52','hd51','sf4008','dm900','h7','gb7252','8100s'): dMIPS = "12.000" if getMachineBuild() in ('vusolo4k','hd51','hd52','sf4008','dm900','h7','gb7252','8100s'): AboutText += _("DMIPS:\t") + dMIPS + "\n" else: AboutText += _("BogoMIPS:\t%s") % bogoMIPS + "\n" AboutText += _("Cores:\t%s") % about.getCpuCoresString() + "\n" AboutText += _("HDF Version:\tV%s") % getImageVersion() + " Build #" + getImageBuild() + " based on " + getOEVersion() + "\n" AboutText += _("Kernel (Box):\t%s") % about.getKernelVersionString() + " (" + getBoxType() + ")" + "\n" imagestarted = "" bootname = '' if path.exists('/boot/bootname'): f = open('/boot/bootname', 'r') bootname = f.readline().split('=')[1] f.close() if 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" string = getDriverDate() year = string[0:4] month = string[4:6] day = string[6:8] driversdate = '-'.join((year, month, day)) gstcmd = 'opkg list-installed | grep "gstreamer1.0 -" | cut -c 16-32' gstcmd2 = os.system(gstcmd) #return (gstcmd2) AboutText += _("Drivers:\t%s") % driversdate + "\n" #AboutText += _("GStreamer:\t%s") % gstcmd2 + "\n" AboutText += _("GStreamer:\t%s") % about.getGStreamerVersionString() + "\n" AboutText += _("Last update:\t%s") % getEnigmaVersionString() + " to Build #" + getImageBuild() + "\n" AboutText += _("Flashed:\t%s\n") % about.getFlashDateString() AboutText += _("Python:\t%s\n") % about.getPythonVersionString() AboutText += _("E2 (re)starts:\t%s\n") % config.misc.startCounter.value AboutText += _("Network:") for x in about.GetIPsFromNetworkInterfaces(): AboutText += "\t" + x[0] + ": " + x[1] + "\n" fp_version = getFPVersion() if fp_version is None: fp_version = "" elif fp_version != 0: fp_version = _("Frontprocessor:\tVersion %s") % fp_version AboutText += fp_version + "\n" tempinfo = "" if path.exists('/proc/stb/sensors/temp0/value'): f = open('/proc/stb/sensors/temp0/value', 'r') tempinfo = f.read() f.close() elif path.exists('/proc/stb/fp/temp_sensor'): f = open('/proc/stb/fp/temp_sensor', 'r') tempinfo = f.read() f.close() elif path.exists('/proc/stb/sensors/temp/value'): f = open('/proc/stb/sensors/temp/value', 'r') tempinfo = f.read() f.close() elif path.exists('/sys/devices/virtual/thermal/thermal_zone0/temp'): if getBoxType() in ('mutant51', 'ax51', 'zgemmah7', 'e4hdultra'): tempinfo = "" else: f = open('/sys/devices/virtual/thermal/thermal_zone0/temp', 'r') tempinfo = f.read() tempinfo = tempinfo[:-4] f.close() if tempinfo and int(tempinfo.replace('\n', '')) > 0: mark = str('\xc2\xb0') AboutText += _("System Temp:\t%s") % tempinfo.replace('\n', '').replace(' ','') + mark + "C\n" tempinfo = "" if path.exists('/proc/stb/fp/temp_sensor_avs'): f = open('/proc/stb/fp/temp_sensor_avs', 'r') tempinfo = f.read() f.close() elif path.exists('/sys/devices/virtual/thermal/thermal_zone0/temp'): try: f = open('/sys/devices/virtual/thermal/thermal_zone0/temp', 'r') tempinfo = f.read() tempinfo = tempinfo[:-4] f.close() except: tempinfo = "" 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', ' ') self["AboutScrollLabel"] = ScrollLabel(AboutText)
def is_nextgen(self): if about.getCPUString() in ('BCM7346B2', 'BCM7425B2', 'BCM7429B0'): return True return False
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)") else: if path.exists('/proc/cpuinfo'): f = open('/proc/cpuinfo', 'r') temp = f.readlines() f.close() try: for lines in temp: lisp = lines.split(': ') if lisp[0].startswith('cpu MHz'): #cpuMHz = " (" + lisp[1].replace('\n', '') + " MHz)" cpuMHz = " (" + str(int(float(lisp[1].replace('\n', '')))) + " MHz)" break except: pass AboutText += _("CPU:\t\t%s") % about.getCPUString() + cpuMHz + "\n" AboutText += _("Cores:\t\t%s") % about.getCpuCoresString() + "\n" imagestarted = "" bootname = '' if path.exists('/boot/bootname'): f = open('/boot/bootname', 'r') bootname = f.readline().split('=')[1] f.close() if SystemInfo["HasRootSubdir"]: image = find_rootfssubdir("STARTUP") AboutText += _("Selected Image:\t\t%s") % _("STARTUP_") + image[-1:] + bootname + "\n" elif getMachineBuild() in ('gbmv200','cc1','sf8008','sf8008m','ustym4kpro','beyonwizv2',"viper4k"): if path.exists('/boot/STARTUP'): f = open('/boot/STARTUP', 'r') f.seek(5) image = f.read(4) if image == "emmc": image = "1" elif image == "usb0": f.seek(13) image = f.read(1) if image == "1": image = "2" elif image == "3": image = "3" elif image == "5": image = "4" elif image == "7": image = "5" f.close() if bootname: bootname = " (%s)" %bootname AboutText += _("Selected Image:\t\t%s") % _("STARTUP_") + image + bootname + "\n" elif getMachineBuild() in ('osmio4k','osmio4kplus','osmini4k'): if path.exists('/boot/STARTUP'): f = open('/boot/STARTUP', 'r') f.seek(38) image = f.read(1) f.close() if bootname: bootname = " (%s)" %bootname AboutText += _("Selected Image:\t\t%s") % _("STARTUP_") + image + bootname + "\n" elif path.exists('/boot/STARTUP'): f = open('/boot/STARTUP', 'r') f.seek(22) image = f.read(1) f.close() if bootname: bootname = " (%s)" %bootname AboutText += _("Selected Image:\t\t%s") % _("STARTUP_") + image + bootname + "\n" elif path.exists('/boot/cmdline.txt'): f = open('/boot/cmdline.txt', 'r') f.seek(38) image = f.read(1) f.close() if bootname: bootname = " (%s)" %bootname AboutText += _("Selected Image:\t\t%s") % _("STARTUP_") + image + bootname + "\n" AboutText += _("Version:\t\t%s") % getImageVersion() + "\n" AboutText += _("Build:\t\t%s") % getImageBuild() + "\n" AboutText += _("Kernel:\t\t%s") % about.getKernelVersionString() + "\n" string = getDriverDate() year = string[0:4] month = string[4:6] day = string[6:8] driversdate = '-'.join((year, month, day)) AboutText += _("Drivers:\t\t%s") % MyDateConverter(driversdate) + "\n" AboutText += _("GStreamer:\t\t%s") % about.getGStreamerVersionString() + "\n" AboutText += _("Python:\t\t%s") % about.getPythonVersionString() + "\n" 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
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'): 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 += _("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 'addr' in eth0: for x in about.GetIPsFromNetworkInterfaces(): AboutText += "\t" + str(x[0]) + ": " + str( x[1]) + " (" + netspeed() + ")\n" elif 'addr' in eth1: for x in about.GetIPsFromNetworkInterfaces(): AboutText += "\t" + str(x[0]) + ": " + str( x[1]) + " (" + netspeed_eth1() + ")\n" elif 'addr' in ra0: for x in about.GetIPsFromNetworkInterfaces(): AboutText += "\t" + str(x[0]) + ": " + str( x[1]) + " (~" + netspeed_ra0() + ")\n" elif 'addr' in wlan0: for x in about.GetIPsFromNetworkInterfaces(): AboutText += "\t" + str(x[0]) + ": " + str( x[1]) + " (~" + netspeed_wlan0() + ")\n" elif 'addr' in wlan1: for x in about.GetIPsFromNetworkInterfaces(): AboutText += "\t" + str(x[0]) + ": " + str( x[1]) + " (~" + netspeed_wlan1() + ")\n" else: for x in about.GetIPsFromNetworkInterfaces(): AboutText += "\t" + str(x[0]) + ": " + str(x[1]) + "\n" fp_version = getFPVersion() if fp_version is None: fp_version = "" elif fp_version != 0: fp_version = _("Frontprocessor:\tVersion %s") % fp_version AboutText += fp_version + "\n" AboutLcdText = AboutText.replace('\t', ' ') self["AboutScrollLabel"] = ScrollLabel(AboutText)
def getAboutText(): AboutText = "" AboutText += _("Model:\t %s %s\n") % (getMachineBrand(), getMachineName()) bootloader = "" if path.exists('/sys/firmware/devicetree/base/bolt/tag'): f = open('/sys/firmware/devicetree/base/bolt/tag', 'r') bootloader = f.readline().replace('\x00', '').replace('\n', '') f.close() AboutText += _("Bootloader:\t\t%s\n") % (bootloader) if about.getChipSetString() != _("unavailable"): if about.getIsBroadcom(): AboutText += _("Chipset:\t BCM%s\n") % str( about.getChipSetString().upper()) else: AboutText += _("Chipset:\t %s\n") % str( about.getChipSetString().upper()) bogoMIPS = "" 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('BogoMIPS'): bogoMIPS = "" + str(int(float(lisp[1].replace('\n', '')))) + "" #bogoMIPS = "" + lisp[1].replace('\n','') + "" break except: pass cpuMHz = "" if getMachineBuild() in ('vusolo4k', 'vuultimo4k', 'vuzero4k'): cpuMHz = " (1,5 GHz)" elif getMachineBuild() in ('formuler1tc', 'formuler1', 'triplex', 'tiviaraplus'): cpuMHz = " (1,3 GHz)" elif getMachineBuild() in ('u51', 'u5', 'u53', 'u52', 'u5pvr', 'h9'): 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 ('sf5008', 'et13000', 'et1x000', 'hd52', 'hd51', 'sf4008', 'vs1500', 'h7'): try: import binascii f = open( '/sys/firmware/devicetree/base/cpus/cpu@0/clock-frequency', 'rb') clockfrequency = f.read() f.close() cpuMHz = " (%s MHz)" % str( round(int(binascii.hexlify(clockfrequency), 16) / 1000000, 1)) except: cpuMHz = " (1,7 GHz)" else: if path.exists('/proc/cpuinfo'): f = open('/proc/cpuinfo', 'r') temp = f.readlines() f.close() try: for lines in temp: lisp = lines.split(': ') if lisp[0].startswith('cpu MHz'): #cpuMHz = " (" + lisp[1].replace('\n', '') + " MHz)" cpuMHz = " (" + str( int(float(lisp[1].replace('\n', '')))) + " MHz)" break except: pass openLD = "OpenLD " AboutText += _("CPU:\t %s") % str( about.getCPUString()) + cpuMHz + " " + str( about.getCpuCoresString2()) + "\n" AboutText += _("Cores:\t %s") % str(about.getCpuCoresString()) + "\n" imagestarted = "" bootname = '' if path.exists('/boot/bootname'): f = open('/boot/bootname', 'r') bootname = f.readline().split('=')[1] f.close() if path.exists('/boot/STARTUP'): f = open('/boot/STARTUP', 'r') f.seek(22) image = f.read(1) f.close() if bootname: bootname = " (%s)" % bootname AboutText += _( "Selected Image:\t%s") % "STARTUP_" + image + bootname + "\n" elif path.exists('/boot/cmdline.txt'): f = open('/boot/cmdline.txt', 'r') f.seek(38) image = f.read(1) f.close() if bootname: bootname = " (%s)" % bootname AboutText += _( "Selected Image:\t%s") % "STARTUP_" + image + bootname + "\n" AboutText += _("Architecture:\t %s") % str(about.getCPUArch()) + "\n" AboutText += _("BogoMIPS:\t %s") % bogoMIPS + "\n" AboutText += _("Firmware:\t %s") % openLD + str(getImageVersion()) + "\n" #AboutText += _("Build:\t %s") % getImageBuild() + "\n" #AboutText += _("Image Type:\t%s\n") % getImageType() + "\n" AboutText += _("CodeName:\t %s") % getImageCodeName() + "\n" AboutText += _("Kernel:\t %s") % str(about.getKernelVersionString()) + "\n" AboutText += _("DVB drivers:\t %s") % str( about.getDriverInstalledDate()) + "\n" AboutText += _("Last update:\t %s") % MyDateConverter( str(getEnigmaVersionString())) + "\n" AboutText += _("Restarts:\t %d ") % config.misc.startCounter.value + "\n" AboutText += _("Uptime:\t %s") % str(about.getUptimeString()) + "\n" AboutText += _("GStreamer:\t %s") % str( about.getGStreamerVersionString().replace('GStreamer', '')) + "\n" if path.exists('/usr/bin/ffmpeg'): try: AboutText += _("FFmpeg:\t %s") % str( about.getFFmpegVersionString()) + "\n" except: pass AboutText += _("Python:\t %s") % str( about.getPythonVersionString()) + "\n\n" #AboutText += _("CPU Load:\t %s") % str(about.getLoadCPUString()) + "\n" #AboutText += _("Installed:\t ") + about.getFlashDateString() + "\n" #AboutText += _("Restarts:\t %d ") % config.misc.startCounter.value + "\n\n" fp_version = getFPVersion() if fp_version is None: fp_version = "" elif fp_version != 0: fp_version = _("Frontprocessor version: %s") % fp_version else: fp_version = _("Frontprocessor version: %d") % fp_version AboutText += fp_version + "\n" tempinfo = "" if path.exists('/proc/stb/sensors/temp0/value'): f = open('/proc/stb/sensors/temp0/value', 'r') tempinfo = f.read() f.close() elif path.exists('/proc/stb/fp/temp_sensor'): f = open('/proc/stb/fp/temp_sensor', 'r') tempinfo = f.read() f.close() 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'): try: f = open('/proc/stb/power/avs', 'r') temp = f.read() celsius = temp[0:-1] tempinfo = celsius f.close() except: tempinfo = "" elif path.exists('/sys/devices/virtual/thermal/thermal_zone0/temp'): try: f = open('/sys/devices/virtual/thermal/thermal_zone0/temp', 'r') temp = f.read() tempinfo = temp[:-4] f.close() except: tempinfo = "" if tempinfo and str(round(int(tempinfo.replace('\n', '')))) > 0: mark = str('\xc2\xb0') AboutText += _("Processor temperature:\t%s") % tempinfo.replace( '\n', '').replace(' ', '') + mark + "C\n" AboutLcdText = AboutText.replace('\t', ' ') return AboutText, AboutLcdText
def populate(self): self["lab1"] = StaticText(_("Virtuosso Image Xtreme")) self["lab2"] = StaticText(_("By Team ViX")) model = None AboutText = "" self["lab3"] = StaticText(_("Support at") + " www.world-of-satellite.com") AboutText += _("Model:\t%s %s\n") % (getMachineBrand(), getMachineName()) if path.exists('/proc/stb/info/chipset'): AboutText += _("Chipset:\tBCM%s\n") % about.getChipSetString() AboutText += _("CPU:\t%s\n") % about.getCPUString().replace('bcm', 'BCM') AboutText += _("CPU speed:\t%s\n") % about.getCPUSpeedString() AboutText += _("Cores:\t%s\n") % 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() 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\t%s\n") % (bootloader) self["AboutScrollLabel"] = ScrollLabel(AboutText)
def getAboutText(): AboutText = '' AboutText += _('Model:\t\t%s %s\n') % (getMachineBrand(), getMachineName()) AboutText += _('OEM Model:\t\t%s\n') % getMachineBuild() bootloader = '' if path.exists('/sys/firmware/devicetree/base/bolt/tag'): f = open('/sys/firmware/devicetree/base/bolt/tag', 'r') bootloader = f.readline().replace('\x00', '').replace('\n', '') f.close() AboutText += _('Bootloader:\t\t%s\n') % bootloader if path.exists('/proc/stb/info/chipset'): AboutText += _('Chipset:\t\t%s') % about.getChipSetString() + '\n' cpuMHz = '' if getMachineBuild() in ('u41', 'u42', 'u43'): cpuMHz = _(' (1.0 GHz)') elif getMachineBuild() in ('dags72604', 'vusolo4k', 'vuultimo4k', 'vuzero4k', 'gb72604'): cpuMHz = _(' (1.5 GHz)') elif getMachineBuild() in ('formuler1tc', 'formuler1', 'triplex', 'tiviaraplus'): cpuMHz = _(' (1.3 GHz)') elif getMachineBuild() in ('gbmv200', 'u51', 'u5', 'u53', 'u532', 'u533', 'u52', 'u54', 'u55', 'u56', 'u5pvr', 'h9', 'h9combo', 'h10', 'cc1', 'sf8008', '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)
def imageInfo(self): AboutText = _("Full Image Backup ") AboutText += _("By openATV Image Team") + "\n" AboutText += _("Support at") + " www.opena.tv\n\n" AboutText += _("[Image Info]\n") AboutText += _("Model: %s %s\n") % (getMachineBrand(), getMachineName()) AboutText += _("Backup Date: %s\n") % strftime("%Y-%m-%d", localtime(self.START)) if path.exists('/proc/stb/info/chipset'): AboutText += _("Chipset: BCM%s") % about.getChipSetString().lower( ).replace('\n', '').replace('bcm', '') + "\n" AboutText += _("CPU: %s") % about.getCPUString() + "\n" AboutText += _("Cores: %s") % about.getCpuCoresString() + "\n" AboutText += _("Version: %s") % getImageVersionString() + "\n" AboutText += _("Build: %s") % getBuildVersionString() + "\n" AboutText += _("Kernel: %s") % about.getKernelVersionString() + "\n" string = getDriverDateString() year = string[0:4] month = string[4:6] day = string[6:8] driversdate = '-'.join((year, month, day)) AboutText += _("Drivers:\t%s") % driversdate + "\n" AboutText += _("Last update:\t%s") % getEnigmaVersionString() + "\n\n" AboutText += _("[Enigma2 Settings]\n") AboutText += commands.getoutput("cat /etc/enigma2/settings") AboutText += _("\n\n[User - bouquets (TV)]\n") try: f = open("/etc/enigma2/bouquets.tv", "r") lines = f.readlines() f.close() for line in lines: if line.startswith("#SERVICE:"): bouqet = line.split() if len(bouqet) > 3: bouqet[3] = bouqet[3].replace('"', '') f = open("/etc/enigma2/" + bouqet[3], "r") userbouqet = f.readline() AboutText += userbouqet.replace('#NAME ', '') f.close() except: AboutText += "Error reading bouquets.tv" AboutText += _("\n[User - bouquets (RADIO)]\n") try: f = open("/etc/enigma2/bouquets.radio", "r") lines = f.readlines() f.close() for line in lines: if line.startswith("#SERVICE:"): bouqet = line.split() if len(bouqet) > 3: bouqet[3] = bouqet[3].replace('"', '') f = open("/etc/enigma2/" + bouqet[3], "r") userbouqet = f.readline() AboutText += userbouqet.replace('#NAME ', '') f.close() except: AboutText += "Error reading bouquets.radio" AboutText += _("\n[Installed Plugins]\n") AboutText += commands.getoutput( "opkg list_installed | grep enigma2-plugin-") return AboutText
def populate(self): self["lab1"] = StaticText(_("openHDF by HDF Image Team")) self["lab2"] = StaticText(_("Support at") + " www.HDFreaks.cc") model = None AboutText = "" self["lab2"] = StaticText(_("Support @") + " www.hdfreaks.cc") AboutText += _("Model:\t%s %s\n") % (getMachineBrand(), getMachineName()) if path.exists('/proc/stb/info/chipset'): AboutText += _("Chipset:\tBCM%s") % about.getChipSetString() + "\n" cmd = 'cat /proc/cpuinfo | grep "cpu MHz" -m 1 | awk -F ": " ' + "'{print $2}'" cmd2 = 'cat /proc/cpuinfo | grep "BogoMIPS" -m 1 | awk -F ": " ' + "'{print $2}'" try: res = popen(cmd).read() res2 = popen(cmd2).read() except: res = "" res2 = "" cpuMHz = "" bogoMIPS = "" if res: cpuMHz = "" + res.replace("\n", "") + " MHz" if res2: bogoMIPS = "" + res2.replace("\n", "") AboutText += _("CPU:\t%s") % about.getCPUString() + "\n" AboutText += _("Clock Speed:\t%s") % cpuMHz + "\n" AboutText += _("BogoMIPS:\t%s") % bogoMIPS + "\n" AboutText += _("Cores:\t%s") % about.getCpuCoresString() + "\n" AboutText += _("HDF Version:\t%s") % getImageVersion() + "\n" AboutText += _("HDF Build:\t%s") % getImageBuild() + "\n" AboutText += _("Kernel:\t%s") % about.getKernelVersionString() + "\n" string = getDriverDate() year = string[0:4] month = string[4:6] day = string[6:8] driversdate = '-'.join((year, month, day)) AboutText += _("Drivers:\t%s") % driversdate + "\n" AboutText += _("Last update:\t%s") % getEnigmaVersionString() + "\n" AboutText += _("GStreamer:\t%s") % about.getGStreamerVersionString() + "\n" fp_version = getFPVersion() if fp_version is None: fp_version = "" elif fp_version != 0: fp_version = _("Frontprocessor version: %s") % fp_version AboutText += fp_version + "\n" tempinfo = "" if path.exists('/proc/stb/sensors/temp0/value'): f = open('/proc/stb/sensors/temp0/value', 'r') tempinfo = f.read() f.close() elif path.exists('/proc/stb/fp/temp_sensor'): f = open('/proc/stb/fp/temp_sensor', 'r') tempinfo = f.read() f.close() if tempinfo and int(tempinfo.replace('\n', '')) > 0: mark = str('\xc2\xb0') AboutText += _("System Temp:\t%s") % tempinfo.replace('\n', '') + mark + "C\n" tempinfo = "" if path.exists('/proc/stb/fp/temp_sensor_avs'): f = open('/proc/stb/fp/temp_sensor_avs', 'r') tempinfo = f.read() f.close() if tempinfo and int(tempinfo.replace('\n', '')) > 0: mark = str('\xc2\xb0') AboutText += _("Processor Temp:\t%s") % tempinfo.replace('\n', '') + mark + "C\n" AboutLcdText = AboutText.replace('\t', ' ') self["AboutScrollLabel"] = ScrollLabel(AboutText)
def VideoChangeDetect(self): config_port = config.av.videoport.getValue() config_mode = str(config.av.videomode[config_port].getValue()).replace( '\n', '') config_res = str( config.av.videomode[config_port].getValue()[:-1]).replace( '\n', '') config_pol = str( config.av.videomode[config_port].getValue()[-1:]).replace( '\n', '') config_rate = str(config.av.videorate[config_mode].getValue()).replace( 'Hz', '').replace('\n', '') f = open("/proc/stb/video/videomode") current_mode = f.read()[:-1].replace('\n', '') f.close() if current_mode.upper() in ('PAL', 'NTSC'): current_mode = current_mode.upper() current_pol = '' if 'i' in current_mode: current_pol = 'i' elif 'p' in current_mode: current_pol = 'p' current_res = current_pol and current_mode.split( current_pol)[0].replace('\n', '') or "" current_rate = current_pol and current_mode.split( current_pol)[0].replace( '\n', '') and current_mode.split(current_pol)[1].replace( '\n', '') or "" video_height = None video_width = None video_pol = None video_rate = None if path.exists("/proc/stb/vmpeg/0/yres"): f = open("/proc/stb/vmpeg/0/yres", "r") video_height = int(f.read(), 16) f.close() if path.exists("/proc/stb/vmpeg/0/xres"): f = open("/proc/stb/vmpeg/0/xres", "r") video_width = int(f.read(), 16) f.close() if path.exists("/proc/stb/vmpeg/0/progressive"): f = open("/proc/stb/vmpeg/0/progressive", "r") video_pol = "p" if int(f.read(), 16) else "i" f.close() if path.exists("/proc/stb/vmpeg/0/framerate"): f = open("/proc/stb/vmpeg/0/framerate", "r") try: video_rate = int(f.read()) except: video_rate = 50 f.close() if not video_height or not video_width or not video_pol or not video_rate: service = self.session.nav.getCurrentService() if service is not None: info = service.info() else: info = None if info: video_height = int( info.getInfo(iServiceInformation.sVideoHeight)) video_width = int(info.getInfo( iServiceInformation.sVideoWidth)) video_pol = ("i", "p")[info.getInfo( iServiceInformation.sProgressive)] video_rate = int(info.getInfo(iServiceInformation.sFrameRate)) if video_height and video_width and video_pol and video_rate: resolutionlabel["content"].setText( _("Video content: %ix%i%s %iHz") % (video_width, video_height, video_pol, (video_rate + 500) / 1000)) if video_height != -1: if video_height > 720 or video_width > 1280: new_res = "1080" elif (576 < video_height <= 720) or video_width > 1024: new_res = "720" elif (480 < video_height <= 576) or video_width > 720 or video_rate in (25000, 23976, 24000): new_res = "576" else: new_res = "480" else: new_res = config_res if video_rate != -1: if video_rate == 25000 and video_pol == 'i': new_rate = 50000 elif video_rate == 59940 or ( video_rate == 29970 and video_pol == 'i') or ( video_rate == 29970 and video_pol == 'p' and config.av.autores.getValue() == 'disabled'): new_rate = 60000 elif video_rate == 23976: new_rate = 24000 elif video_rate == 29970: new_rate = 30000 else: new_rate = video_rate new_rate = str((new_rate + 500) / 1000) else: new_rate = config_rate if video_pol != -1: new_pol = str(video_pol) else: new_pol = config_pol write_mode = None new_mode = None if config_mode in ('PAL', 'NTSC'): write_mode = config_mode elif config.av.autores.getValue() == 'all' or ( config.av.autores.getValue() == 'hd' and int(new_res) >= 720): if (config.av.autores_deinterlace.getValue() and about.getCPUString() in 'BCM7346B2, BCM7425B2' ) or config.av.autores_deinterlace.getValue( ) and about.getCPUString( ) not in 'BCM7346B2, BCM7425B2' and int(new_res) <= 720: new_pol = new_pol.replace('i', 'p') if new_res + new_pol + new_rate in iAVSwitch.modes_available: new_mode = new_res + new_pol + new_rate if new_mode == '720p24': new_mode = config.av.autores_720p24.getValue() if new_mode == '1080p24': new_mode = config.av.autores_1080p24.getValue() if new_mode == '1080p25': new_mode = config.av.autores_1080p25.getValue() if new_mode == '1080p30': new_mode = config.av.autores_1080p30.getValue() elif new_res + new_pol in iAVSwitch.modes_available: new_mode = new_res + new_pol else: write_mode = config_mode + new_rate write_mode = new_mode elif config.av.autores.getValue() == 'hd' and int(new_res) <= 576: if ( config.av.autores_deinterlace.getValue() and about.getCPUString() in 'BCM7346B2, BCM7425B2' ) or config.av.autores_deinterlace.getValue( ) and about.getCPUString( ) not in 'BCM7346B2, BCM7425B2' and not config.av.autores_sd.getValue( ) in '1080i': new_mode = config.av.autores_sd.getValue().replace( 'i', 'p') + new_rate else: if new_pol in 'p': new_mode = config.av.autores_sd.getValue().replace( 'i', 'p') + new_rate else: new_mode = config.av.autores_sd.getValue() + new_rate if new_mode == '720p24': new_mode = config.av.autores_720p24.getValue() if new_mode == '1080p24': new_mode = config.av.autores_1080p24.getValue() if new_mode == '1080p25': new_mode = config.av.autores_1080p25.getValue() if new_mode == '1080p30': new_mode = config.av.autores_1080p30.getValue() write_mode = new_mode else: if path.exists('/proc/stb/video/videomode_%shz' % new_rate) and config_rate == 'multi': f = open("/proc/stb/video/videomode_%shz" % new_rate, "r") multi_videomode = f.read().replace('\n', '') f.close() if multi_videomode and (current_mode != multi_videomode): write_mode = multi_videomode else: write_mode = config_mode + new_rate # workaround for bug, see http://www.opena.tv/forum/showthread.php?1642-Autoresolution-Plugin&p=38836&viewfull=1#post38836 # always use 1080p50 for TV or .ts files # always use 1080p24/p50/p60 for all other videos if config.av.smart1080p.getValue(): print "DEBUG VIDEOMODE/ smart1080p enabled" if new_rate == 'multi': write_mode = '1080p' else: new_rate = new_rate.replace('25', '50') new_rate = new_rate.replace('30', '60') write_mode = '1080p' + new_rate print "DEBUG VIDEOMODE/ new_rate:" print new_rate ref = self.session.nav.getCurrentlyPlayingServiceReference() if ref is not None: try: mypath = ref.getPath() except: mypath = '' if mypath != '': if mypath.endswith('.ts'): print "DEBUG VIDEOMODE/ playing .ts file" write_mode = '1080p50' # for .ts files else: print "DEBUG VIDEOMODE/ playing other (non .ts) file" # write_mode from above for all other videos else: print "DEBUG VIDEOMODE/ no path, presumably live TV" write_mode = '1080p50' # for for TV else: print "DEBUG VIDEOMODE/ no service reference" write_mode = '1080p50' # no service reference, stay at 1080p50 if write_mode and current_mode != write_mode and self.bufferfull: resolutionlabel["restxt"].setText( _("Video mode: %s") % write_mode) if config.av.autores_label_timeout.getValue() != '0': resolutionlabel.show() print "[VideoMode] setMode - port: %s, mode: %s" % ( config_port, write_mode) f = open("/proc/stb/video/videomode", "w") f.write(write_mode) f.close() iAVSwitch.setAspect(config.av.aspect) iAVSwitch.setWss(config.av.wss) iAVSwitch.setPolicy43(config.av.policy_43) iAVSwitch.setPolicy169(config.av.policy_169) self.delay = False self.detecttimer.stop()
def LayoutFinish(self): if about.getCPUString() != 'BCM7346B2' and about.getCPUString() != 'BCM7425B2': self.createTimer.start(800) else: self.createTimer.start(1600)
def populate(self): self["lab1"] = StaticText(_("openHDF by HDF Image Team")) self["lab2"] = StaticText(_("Support at") + " www.HDFreaks.cc") model = None AboutText = "" self["lab2"] = StaticText(_("Support @") + " www.hdfreaks.cc") AboutText += _("Model:\t%s %s\n") % (getMachineBrand(), getMachineName()) #AboutText += _("Boxtype:\t%s\n") % getBoxType() if path.exists('/proc/stb/info/chipset'): AboutText += _("Chipset:\tBCM%s") % about.getChipSetString() + "\n" cmd = 'cat /proc/cpuinfo | grep "cpu MHz" -m 1 | awk -F ": " ' + "'{print $2}'" cmd2 = 'cat /proc/cpuinfo | grep "BogoMIPS" -m 1 | awk -F ": " ' + "'{print $2}'" try: res = popen(cmd).read() res2 = popen(cmd2).read() except: res = "" res2 = "" cpuMHz = "" bootloader = "" if path.exists('/sys/firmware/devicetree/base/bolt/tag'): f = open('/sys/firmware/devicetree/base/bolt/tag', 'r') bootloader = f.readline().replace('\x00', '').replace('\n', '') f.close() BootLoaderVersion = 0 try: if bootloader: AboutText += _("Bootloader:\t%s\n") % (bootloader) BootLoaderVersion = int(bootloader[1:]) except: BootLoaderVersion = 0 if getMachineBuild() in ('vusolo4k'): cpuMHz = "1,5 GHz" elif getMachineBuild() in ('hd52', 'hd51', 'sf4008'): 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'): AboutText += _( "CPU:\t") + "ARM Dual core " + " (" + 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'): dMIPS = "12.000" if getMachineBuild() in ('vusolo4k', 'hd51', 'hd52', 'sf4008'): AboutText += _("DMIPS:\t") + dMIPS + "\n" else: AboutText += _("BogoMIPS:\t%s") % bogoMIPS + "\n" AboutText += _("Cores:\t%s") % about.getCpuCoresString() + "\n" AboutText += _("HDF Version:\tV%s") % getImageVersion( ) + " - Build # " + getImageBuild() + "\n" AboutText += _("Kernel (Box):\t%s") % about.getKernelVersionString( ) + " (" + getBoxType() + ")" + "\n" imagestarted = "" bootname = '' if path.exists('/boot/bootname'): f = open('/boot/bootname', 'r') bootname = f.readline().split('=')[1] f.close() if path.exists('/boot/STARTUP'): f = open('/boot/STARTUP', 'r') f.seek(22) image = f.read(1) f.close() if bootname: bootname = " (%s)" % bootname AboutText += _( "Image started:\t%s") % "STARTUP_" + image + bootname + "\n" string = getDriverDate() year = string[0:4] month = string[4:6] day = string[6:8] driversdate = '-'.join((year, month, day)) AboutText += _("Drivers:\t%s") % driversdate + "\n" AboutText += _( "GStreamer:\t%s") % about.getGStreamerVersionString() + "\n" AboutText += _("Last update:\t%s") % getEnigmaVersionString() + "\n" AboutText += _("Flashed:\t%s\n") % about.getFlashDateString() AboutText += _("Python:\t%s\n") % about.getPythonVersionString() AboutText += _("E2 (re)starts:\t%s\n") % config.misc.startCounter.value AboutText += _("Network:") for x in about.GetIPsFromNetworkInterfaces(): AboutText += "\t" + x[0] + ": " + x[1] + "\n" fp_version = getFPVersion() if fp_version is None: fp_version = "" elif fp_version != 0: fp_version = _("Frontprocessor 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 Temp:\t%s") % tempinfo.replace( '\n', '').replace(' ', '') + mark + "C\n" tempinfo = "" if path.exists('/proc/stb/fp/temp_sensor_avs'): f = open('/proc/stb/fp/temp_sensor_avs', 'r') tempinfo = f.read() f.close() if tempinfo and int(tempinfo.replace('\n', '')) > 0: mark = str('\xc2\xb0') AboutText += _("CPU Temp:\t%s") % tempinfo.replace( '\n', '').replace(' ', '') + mark + "C\n" AboutLcdText = AboutText.replace('\t', ' ') self["AboutScrollLabel"] = ScrollLabel(AboutText)
def updateInfo(self): self.DynamicTimer.start(1000) rc = system("df -h > /tmp/syinfo.tmp") if config.osd.language.value == 'es_ES': self.text = "RECEPTOR\n" else: self.text = "BOX\n" f = open("/proc/stb/info/model",'r') if config.osd.language.value == 'es_ES': self.text += "Modelo:\t" + about.getBoxType() + "\n" else: self.text += "Model:\t" + about.getBoxType() + "\n" f.close() #f = open("/proc/stb/info/chipset",'r') #self.text += "Chipset:\t" + about.getChipSetString() + "\n" #f.close() cmd = 'cat /proc/cpuinfo | grep "cpu MHz" -m 1 | awk -F ": " ' + "'{print $2}'" cmd2 = 'cat /proc/cpuinfo | grep "BogoMIPS" -m 1 | awk -F ": " ' + "'{print $2}'" try: res = popen(cmd).read() res2 = popen(cmd2).read() except: res = "" res2 = "" cpuMHz = "" bogoMIPS = "" if res: cpuMHz = " \t(" + res.replace("\n", "") + " MHz)" if res2: bogoMIPS = "" + res2.replace("\n", "") f = open('/proc/cpuinfo', 'r') self.text += "CPU: \t" + about.getCPUString() + cpuMHz + "\n" self.text += _("Cores:\t %s") % str(about.getCpuCoresString()) + "\n" self.text += "BogoMIPS \t" + bogoMIPS + "\n" f.close() if config.osd.language.value == 'es_ES': self.text += "\nMEMORIA\n" else: self.text += "\nMEMORY\n" memTotal = memFree = swapTotal = swapFree = 0 for line in open("/proc/meminfo",'r'): parts = line.split(':') key = parts[0].strip() if key == "MemTotal": memTotal = parts[1].strip() elif key in ("MemFree"): memFree = parts[1].strip() elif key == "SwapTotal": swapTotal = parts[1].strip() elif key == "SwapFree": swapFree = parts[1].strip() if config.osd.language.value == 'es_ES': self.text += "Memoria Total:\t%s\n" % memTotal else: self.text += "Total memory:\t%s\n" % memTotal if config.osd.language.value == 'es_ES': self.text += "Memoria Libre:\t%s \n" % memFree else: self.text += "Free memory:\t%s \n" % memFree if config.osd.language.value == 'es_ES': self.text += "Memoria Usada:\t%s" % str(about.getRAMusageString()) + "\n" else: self.text += "Memory Usage:\t%s" % str(about.getRAMusageString()) + "\n" out_lines = file("/proc/meminfo").readlines() for lidx in range(len(out_lines) - 1): tstLine = out_lines[lidx].split() if "Buffers:" in tstLine: Buffers = out_lines[lidx].split() self.text += _("Buffers:") + "\t" + Buffers[1] + ' kB'"\n" if "Cached:" in tstLine: Cached = out_lines[lidx].split() self.text += _("Cached:") + "\t" + Cached[1] + ' kB'"\n" if config.osd.language.value == 'es_ES': self.text += "Swap total:\t%s \n" % swapTotal else: self.text += "Swap total:\t%s \n" % swapTotal if config.osd.language.value == 'es_ES': self.text += "Swap libre:\t%s \n" % swapFree else: self.text += "Swap free:\t%s \n" % swapFree if config.osd.language.value == 'es_ES': self.text += "\nALMACENAMIENTO\n" else: self.text += "\nSTORAGE\n" f = open("/tmp/syinfo.tmp",'r') line = f.readline() parts = line.split() self.text += parts[0] + "\t" + parts[1].strip() + " " + parts[2].strip() + " " + parts[3].strip() + " " + parts[4] + "\n" line = f.readline() parts = line.split() self.text += "Flash" + "\t" + parts[1].strip() + " " + parts[2].strip() + " " + parts[3].strip() + " " + parts[4] + "\n" for line in f.readlines(): if line.find('/media/') != -1: line = line.replace('/media/', ' ') parts = line.split() if len(parts) == 6: self.text += parts[5] + "\t" + parts[1].strip() + " " + parts[2].strip() + " " + parts[3].strip() + " " + parts[4] + "\n" f.close() os_remove("/tmp/syinfo.tmp") self.text += "\nSOFTWARE\n" openLD = "OpenLD " self.text += "Firmware:\t %s" % openLD + str(about.getImageVersion()) + "\n" self.text += "Kernel: \t " + about.getKernelVersionString() + "\n" self.text += _("DVB drivers:\t %s") % str(about.getDriverInstalledDate()) + "\n" self.text += _("Last update:\t %s") % str(getEnigmaVersionString()) + "\n" self.text += _("GStreamer:\t%s") % str(about.getGStreamerVersionString().replace('GStreamer','')) + "\n" #self.text += _("FFmpeg:\t%s") % str((' 3.1.4')) + "\n" self.text += _("Python:\t %s") % about.getPythonVersionString() + "\n\n" self["lab1"].setText(self.text)
def InitUsageConfig(): config.NFRTelnet = ConfigSubsection() config.NFRTelnet.command = ConfigText(visible_width = 200) config.NFRSoftcam = ConfigSubsection() config.NFRSoftcam.actcam = ConfigText(visible_width = 200) config.NFRSoftcam.actCam2 = ConfigText(visible_width = 200) config.NFRSoftcam.waittime = ConfigSelection([('0',_("dont wait")),('1',_("1 second")), ('5',_("5 seconds")),('10',_("10 seconds")),('15',_("15 seconds")),('20',_("20 seconds")),('30',_("30 seconds"))], default='15') config.plugins.infopanel_usermenus= ConfigText(visible_width = 200) config.plugins.infopanel_redkey = ConfigSubsection() config.plugins.infopanel_redkey.list = ConfigSelection([('0',_("Default (Softcam Panel")),('1',_("Quickmenu)")),('2',_("Infopanel"))]) config.plugins.infopanel_bluekey = ConfigSubsection() config.plugins.infopanel_bluekey.list = ConfigSelection([('1',_("Default (Quickmenu)")),('0',_("Softcam Panel")),('2',_("Infopanel"))]) config.plugins.showinfopanelextensions = ConfigYesNo(default=False) config.plugins.infopanel_frozencheck = ConfigSubsection() config.plugins.infopanel_frozencheck.list = ConfigSelection([('0',_("Off")),('1',_("1 min.")), ('5',_("5 min.")),('10',_("10 min.")),('15',_("15 min.")),('30',_("30 min."))]) config.plugins.configurationbackup = ConfigSubsection() config.plugins.configurationbackup.backuplocation = ConfigText(default = '/media/hdd/', visible_width = 50, fixed_size = False) config.plugins.configurationbackup.backupdirs = ConfigLocations(default=[eEnv.resolve('${sysconfdir}/enigma2/'), '/etc/network/interfaces', '/etc/wpa_supplicant.conf', '/etc/wpa_supplicant.ath0.conf', '/etc/wpa_supplicant.wlan0.conf', '/etc/resolv.conf', '/etc/default_gw', '/etc/hostname']) config.misc.useNTPminutes = ConfigSelection(default = "30", choices = [("30", "30" + " " +_("minutes")), ("60", _("Hour")), ("1440", _("Once per day"))]) config.misc.remotecontrol_text_support = ConfigYesNo(default = True) config.usage = ConfigSubsection() config.usage.showdish = ConfigSelection(default = "flashing", choices = [("flashing", _("Flashing")), ("normal", _("Not Flashing")), ("off", _("Off"))]) config.usage.multibouquet = ConfigYesNo(default = True) config.usage.alternative_number_mode = ConfigYesNo(default = False) def alternativeNumberModeChange(configElement): enigma.eDVBDB.getInstance().setNumberingMode(configElement.value) refreshServiceList() config.usage.alternative_number_mode.addNotifier(alternativeNumberModeChange) config.usage.servicetype_icon_mode = ConfigSelection(default = "0", choices = [("0", _("None")), ("1", _("Left from servicename")), ("2", _("Right from servicename"))]) config.usage.servicetype_icon_mode.addNotifier(refreshServiceList) config.usage.panicbutton = ConfigYesNo(default = False) # just merge note, config.usage.servicelist_column was allready there choicelist = [("-1", _("Disable")), ("0", _("Eventname only"))] for i in range(100,1300,100): choicelist.append(("%d" % i, ngettext("%d pixel wide", "%d pixels wide", i) % i)) config.usage.servicelist_column = ConfigSelection(default="-1", choices=choicelist) config.usage.servicelist_column.addNotifier(refreshServiceList) config.usage.service_icon_enable = ConfigYesNo(default = False) config.usage.service_icon_enable.addNotifier(refreshServiceList) config.usage.servicelist_cursor_behavior = ConfigSelection(default = "keep", choices = [ ("standard", _("Standard")), ("keep", _("Keep service")), ("reverseB", _("Reverse bouquet buttons")), ("keep reverseB", _("Keep service") + " + " + _("Reverse bouquet buttons"))]) config.usage.multiepg_ask_bouquet = ConfigYesNo(default = False) config.usage.panicbutton = ConfigYesNo(default = False) config.usage.quickzap_bouquet_change = ConfigYesNo(default = False) config.usage.e1like_radio_mode = ConfigYesNo(default = True) choicelist = [] for i in range(1, 11): choicelist.append(("%d" % i, ngettext("%d second", "%d seconds", i) % i)) config.usage.infobar_timeout = ConfigSelection(default = "5", choices = [("0", _("no timeout"))] + choicelist) config.usage.show_infobar_do_dimming = ConfigYesNo(default = False) config.usage.show_infobar_dimming_speed = ConfigSelectionNumber(min = 1, max = 40, stepwidth = 1, default = 25, wraparound = True) config.usage.show_infobar_on_zap = ConfigYesNo(default = True) config.usage.show_infobar_on_skip = ConfigYesNo(default = True) config.usage.show_infobar_on_event_change = ConfigYesNo(default = False) config.usage.show_infobar_channel_number = ConfigYesNo(default = False) config.usage.show_second_infobar = ConfigYesNo(default = True) config.usage.infobar_frontend_source = ConfigSelection(default = "tuner", choices = [("settings", _("Settings")), ("tuner", _("Tuner"))]) def showsecondinfobarChanged(configElement): if config.usage.show_second_infobar.value != "INFOBAREPG": SystemInfo["InfoBarEpg"] = True else: SystemInfo["InfoBarEpg"] = False config.usage.second_infobar_timeout = ConfigSelection(default = "5", choices = [("0", _("no timeout"))] + choicelist) config.usage.show_picon_bkgrn = ConfigSelection(default = "transparent", choices = [("none", _("Disabled")), ("transparent", _("Transparent")), ("blue", _("Blue")), ("red", _("Red")), ("black", _("Black")), ("white", _("White")), ("lightgrey", _("Light Grey")), ("grey", _("Grey"))]) config.usage.show_spinner = ConfigYesNo(default = True) config.usage.enable_tt_caching = ConfigYesNo(default = True) config.usage.sort_settings = ConfigYesNo(default = False) config.usage.sort_menus = ConfigYesNo(default = False) config.usage.sort_pluginlist = ConfigYesNo(default = True) config.usage.sort_extensionslist = ConfigYesNo(default = False) config.usage.movieplayer_pvrstate = ConfigYesNo(default = True) choicelist = [] for i in (10, 30): choicelist.append(("%d" % i, ngettext("%d second", "%d seconds", i) % i)) for i in (60, 120, 300, 600, 1200, 1800): m = i / 60 choicelist.append(("%d" % i, ngettext("%d minute", "%d minutes", m) % m)) for i in (3600, 7200, 14400): h = i / 3600 choicelist.append(("%d" % i, ngettext("%d hour", "%d hours", h) % h)) config.usage.hdd_standby = ConfigSelection(default = "300", choices = [("0", _("No standby"))] + choicelist) config.usage.output_12V = ConfigSelection(default = "do not change", choices = [ ("do not change", _("Do not change")), ("off", _("Off")), ("on", _("On")) ]) config.usage.pip_zero_button = ConfigSelection(default = "standard", choices = [ ("standard", _("Standard")), ("swap", _("Swap PiP and main picture")), ("swapstop", _("Move PiP to main picture")), ("stop", _("Stop PiP")) ]) config.usage.pip_hideOnExit = ConfigSelection(default = "no", choices = [ ("no", _("No")), ("popup", _("With popup")), ("without popup", _("Without popup")) ]) if not os.path.exists(resolveFilename(SCOPE_HDD)): try: os.mkdir(resolveFilename(SCOPE_HDD),0755) except: pass config.usage.default_path = ConfigText(default = resolveFilename(SCOPE_HDD)) if not config.usage.default_path.value.endswith('/'): tmpvalue = config.usage.default_path.value config.usage.default_path.setValue(tmpvalue + '/') config.usage.default_path.save() def defaultpathChanged(configElement): if not config.usage.default_path.value.endswith('/'): tmpvalue = config.usage.default_path.value config.usage.default_path.setValue(tmpvalue + '/') config.usage.default_path.save() config.usage.default_path.addNotifier(defaultpathChanged, immediate_feedback = False) config.usage.timer_path = ConfigText(default = "<default>") config.usage.instantrec_path = ConfigText(default = "<default>") if not os.path.exists(resolveFilename(SCOPE_TIMESHIFT)): try: os.mkdir(resolveFilename(SCOPE_TIMESHIFT),0755) except: pass config.usage.timeshift_path = ConfigText(default = resolveFilename(SCOPE_TIMESHIFT)) if not config.usage.default_path.value.endswith('/'): tmpvalue = config.usage.timeshift_path.value config.usage.timeshift_path.setValue(tmpvalue + '/') config.usage.timeshift_path.save() def timeshiftpathChanged(configElement): if not config.usage.timeshift_path.value.endswith('/'): tmpvalue = config.usage.timeshift_path.value config.usage.timeshift_path.setValue(tmpvalue + '/') config.usage.timeshift_path.save() config.usage.timeshift_path.addNotifier(timeshiftpathChanged, immediate_feedback = False) config.usage.allowed_timeshift_paths = ConfigLocations(default = [resolveFilename(SCOPE_TIMESHIFT)]) config.usage.movielist_trashcan = ConfigYesNo(default=False) config.usage.movielist_trashcan_network_clean = ConfigYesNo(default=False) config.usage.movielist_trashcan_days = ConfigSelectionNumber(min = 1, max = 31, stepwidth = 1, default = 8, wraparound = True) config.usage.movielist_trashcan_reserve = ConfigNumber(default = 40) config.usage.on_movie_start = ConfigSelection(default = "ask", choices = [ ("ask", _("Ask user")), ("resume", _("Resume from last position")), ("beginning", _("Start from the beginning")) ]) config.usage.on_movie_stop = ConfigSelection(default = "movielist", choices = [ ("ask", _("Ask user")), ("movielist", _("Return to movie list")), ("quit", _("Return to previous service")) ]) config.usage.on_movie_eof = ConfigSelection(default = "movielist", choices = [ ("ask", _("Ask user")), ("movielist", _("Return to movie list")), ("quit", _("Return to previous service")), ("pause", _("Pause movie at end")), ("playlist", _("Play next (return to movie list)")), ("playlistquit", _("Play next (return to previous service)")), ("loop", _("Continues play (loop)")), ("repeatcurrent", _("Repeat"))]) config.usage.next_movie_msg = ConfigYesNo(default = True) config.usage.leave_movieplayer_onExit = ConfigSelection(default = "no", choices = [ ("no", _("No")), ("popup", _("With popup")), ("without popup", _("Without popup")) ]) config.usage.setup_level = ConfigSelection(default = "expert", choices = [ ("simple", _("Simple")), ("intermediate", _("Intermediate")), ("expert", _("Expert")) ]) config.usage.on_long_powerpress = ConfigSelection(default = "show_menu", choices = [ ("show_menu", _("Show shutdown menu")), ("shutdown", _("Immediate shutdown")), ("standby", _("Standby")) ] ) config.usage.on_short_powerpress = ConfigSelection(default = "standby", choices = [ ("show_menu", _("Show shutdown menu")), ("shutdown", _("Immediate shutdown")), ("standby", _("Standby")) ] ) choicelist = [] for i in range(-21600, 21601, 3600): h = abs(i / 3600) h = ngettext("%d hour", "%d hours", h) % h if i < 0: choicelist.append(("%d" % i, _("Shutdown in ") + h)) elif i > 0: choicelist.append(("%d" % i, _("Standby in ") + h)) else: choicelist.append(("0", "Do nothing")) config.usage.inactivity_timer = ConfigSelection(default = "0", choices = choicelist) config.usage.inactivity_timer_blocktime = ConfigYesNo(default = True) config.usage.inactivity_timer_blocktime_begin = ConfigClock(default = mktime((0, 0, 0, 6, 0, 0, 0, 0, 0))) config.usage.inactivity_timer_blocktime_end = ConfigClock(default = mktime((0, 0, 0, 23, 0, 0, 0, 0, 0))) choicelist = [] for i in range(-7200, 7201, 900): m = abs(i / 60) m = ngettext("%d minute", "%d minutes", m) % m if i < 0: choicelist.append(("%d" % i, _("Shutdown in ") + m)) elif i > 0: choicelist.append(("%d" % i, _("Standby in ") + m)) else: choicelist.append(("event_shutdown", _("Shutdown after current event"))) choicelist.append(("0", "Disabled")) choicelist.append(("event_standby", _("Standby after current event"))) config.usage.sleep_timer = ConfigSelection(default = "0", choices = choicelist) choicelist = [("0", "Disabled")] for i in range(900, 7201, 900): m = abs(i / 60) m = ngettext("%d minute", "%d minutes", m) % m choicelist.append(("%d" % i, _("after ") + m)) config.usage.standby_to_shutdown_timer = ConfigSelection(default = "0", choices = choicelist) choicelist = [("0", "Disabled")] for i in (5, 30, 60, 300, 600, 900, 1200, 1800, 2700, 3600): if i < 60: m = ngettext("%d second", "%d seconds", i) % i else: m = abs(i / 60) m = ngettext("%d minute", "%d minutes", m) % m choicelist.append(("%d" % i, m)) config.usage.screen_saver = ConfigSelection(default = "0", choices = choicelist) config.usage.check_timeshift = ConfigYesNo(default = True) config.usage.alternatives_priority = ConfigSelection(default = "0", choices = [ ("0", "DVB-S/-C/-T"), ("1", "DVB-S/-T/-C"), ("2", "DVB-C/-S/-T"), ("3", "DVB-C/-T/-S"), ("4", "DVB-T/-C/-S"), ("5", "DVB-T/-S/-C") ]) nims = [("-1", _("auto"))] for x in nimmanager.nim_slots: nims.append((str(x.slot), x.getSlotName())) config.usage.frontend_priority = ConfigSelection(default = "-1", choices = nims) config.misc.disable_background_scan = ConfigYesNo(default = False) config.usage.jobtaksextensions = ConfigYesNo(default = True) config.usage.servicenum_fontsize = ConfigSelectionNumber(default = 2, stepwidth = 1, min = -8, max = 10, wraparound = True) config.usage.servicename_fontsize = ConfigSelectionNumber(default = 0, stepwidth = 1, min = -8, max = 10, wraparound = True) config.usage.serviceinfo_fontsize = ConfigSelectionNumber(default = 0, stepwidth = 1, min = -8, max = 10, wraparound = True) config.usage.serviceitems_per_page = ConfigSelectionNumber(default = 10, stepwidth = 1, min = 3, max = 40, wraparound = True) config.usage.show_servicelist = ConfigYesNo(default = True) config.usage.servicelist_mode = ConfigSelection(default = "standard", choices = [ ("standard", _("Standard")), ("simple", _("Simple")) ] ) config.usage.servicelistpreview_mode = ConfigYesNo(default = False) config.usage.tvradiobutton_mode = ConfigSelection(default="BouquetList", choices = [ ("ChannelList", _("Channel List")), ("BouquetList", _("Bouquet List")), ("MovieList", _("Movie List"))]) config.usage.channelbutton_mode = ConfigSelection(default="0", choices = [ ("0", _("Just change channels")), ("1", _("Channel List")), ("2", _("Bouquet List"))]) config.usage.show_bouquetalways = ConfigYesNo(default = False) config.usage.show_event_progress_in_servicelist = ConfigSelection(default = 'barright', choices = [ ('barleft', _("Progress bar left")), ('barright', _("Progress bar right")), ('percleft', _("Percentage left")), ('percright', _("Percentage right")), ('no', _("No")) ]) config.usage.show_channel_numbers_in_servicelist = ConfigYesNo(default = True) config.usage.show_channel_jump_in_servicelist = ConfigSelection(default="alpha", choices = [ ("alpha", _("Alpha")), ("number", _("Number"))]) config.usage.show_event_progress_in_servicelist.addNotifier(refreshServiceList) config.usage.show_channel_numbers_in_servicelist.addNotifier(refreshServiceList) config.usage.blinking_display_clock_during_recording = ConfigYesNo(default = False) config.usage.blinking_rec_symbol_during_recording = ConfigYesNo(default = False) config.usage.show_message_when_recording_starts = ConfigYesNo(default = True) config.usage.load_length_of_movies_in_moviellist = ConfigYesNo(default = True) config.usage.show_icons_in_movielist = ConfigSelection(default = 'i', choices = [ ('o', _("Off")), ('p', _("Progress")), ('s', _("Small progress")), ('i', _("Icons")), ]) config.usage.movielist_unseen = ConfigYesNo(default = True) config.usage.movielist_show_cover = ConfigYesNo(default = True) config.usage.swap_snr_on_osd = ConfigYesNo(default = False) config.usage.swap_time_display_on_osd = ConfigSelection(default = "0", choices = [("0", _("Skin Setting")), ("1", _("Mins")), ("2", _("Mins Secs")), ("3", _("Hours Mins")), ("4", _("Hours Mins Secs")), ("5", _("Percentage"))]) config.usage.swap_media_time_display_on_osd = ConfigSelection(default = "0", choices = [("0", _("Skin Setting")), ("1", _("Mins")), ("2", _("Mins Secs")), ("3", _("Hours Mins")), ("4", _("Hours Mins Secs")), ("5", _("Percentage"))]) config.usage.swap_time_remaining_on_osd = ConfigSelection(default = "0", choices = [("0", _("Remaining")), ("1", _("Elapsed")), ("2", _("Elapsed & Remaining")), ("3", _("Remaining & Elapsed"))]) config.usage.elapsed_time_positive_osd = ConfigYesNo(default = False) config.usage.swap_time_display_on_vfd = ConfigSelection(default = "0", choices = [("0", _("Skin Setting")), ("1", _("Mins")), ("2", _("Mins Secs")), ("3", _("Hours Mins")), ("4", _("Hours Mins Secs")), ("5", _("Percentage"))]) config.usage.swap_media_time_display_on_vfd = ConfigSelection(default = "2", choices = [("0", _("Skin Setting")), ("1", _("Mins")), ("2", _("Mins Secs")), ("3", _("Hours Mins")), ("4", _("Hours Mins Secs")), ("5", _("Percentage"))]) config.usage.swap_time_remaining_on_vfd = ConfigSelection(default = "0", choices = [("0", _("Remaining")), ("1", _("Elapsed")), ("2", _("Elapsed & Remaining")), ("3", _("Remaining & Elapsed"))]) config.usage.elapsed_time_positive_vfd = ConfigYesNo(default = False) config.usage.lcd_scroll_delay = ConfigSelection(default = "10000", choices = [ ("10000", "10 " + _("seconds")), ("20000", "20 " + _("seconds")), ("30000", "30 " + _("seconds")), ("60000", "1 " + _("minute")), ("300000", "5 " + _("minutes")), ("noscrolling", _("off"))]) config.usage.lcd_scroll_speed = ConfigSelection(default = "300", choices = [ ("500", _("slow")), ("300", _("normal")), ("100", _("fast"))]) def SpinnerOnOffChanged(configElement): setSpinnerOnOff(int(configElement.value)) config.usage.show_spinner.addNotifier(SpinnerOnOffChanged) def EnableTtCachingChanged(configElement): setEnableTtCachingOnOff(int(configElement.value)) config.usage.enable_tt_caching.addNotifier(EnableTtCachingChanged) def TunerTypePriorityOrderChanged(configElement): setTunerTypePriorityOrder(int(configElement.value)) config.usage.alternatives_priority.addNotifier(TunerTypePriorityOrderChanged, immediate_feedback=False) def PreferredTunerChanged(configElement): setPreferredTuner(int(configElement.value)) config.usage.frontend_priority.addNotifier(PreferredTunerChanged) config.usage.hide_zap_errors = ConfigYesNo(default = False) config.usage.hide_ci_messages = ConfigYesNo(default = False) config.usage.show_cryptoinfo = ConfigSelection([("0", _("Off")),("1", _("One line")),("2", _("Two lines"))], "2") config.usage.show_eit_nownext = ConfigYesNo(default = True) config.usage.show_vcr_scart = ConfigYesNo(default = False) config.epg = ConfigSubsection() config.epg.eit = ConfigYesNo(default = True) config.epg.mhw = ConfigYesNo(default = False) config.epg.freesat = ConfigYesNo(default = True) config.epg.viasat = ConfigYesNo(default = True) config.epg.netmed = ConfigYesNo(default = True) config.epg.saveepg = ConfigYesNo(default = True) config.misc.bootvideo = ConfigYesNo(default = True) def EpgSettingsChanged(configElement): from enigma import eEPGCache mask = 0xffffffff if not config.epg.eit.value: mask &= ~(eEPGCache.NOWNEXT | eEPGCache.SCHEDULE | eEPGCache.SCHEDULE_OTHER) if not config.epg.mhw.value: mask &= ~eEPGCache.MHW if not config.epg.freesat.value: mask &= ~(eEPGCache.FREESAT_NOWNEXT | eEPGCache.FREESAT_SCHEDULE | eEPGCache.FREESAT_SCHEDULE_OTHER) if not config.epg.viasat.value: mask &= ~eEPGCache.VIASAT if not config.epg.netmed.value: mask &= ~(eEPGCache.NETMED_SCHEDULE | eEPGCache.NETMED_SCHEDULE_OTHER) eEPGCache.getInstance().setEpgSources(mask) config.epg.eit.addNotifier(EpgSettingsChanged) config.epg.mhw.addNotifier(EpgSettingsChanged) config.epg.freesat.addNotifier(EpgSettingsChanged) config.epg.viasat.addNotifier(EpgSettingsChanged) config.epg.netmed.addNotifier(EpgSettingsChanged) config.epg.histminutes = ConfigSelectionNumber(min = 0, max = 120, stepwidth = 15, default = 0, wraparound = True) def EpgHistorySecondsChanged(configElement): from enigma import eEPGCache eEPGCache.getInstance().setEpgHistorySeconds(config.epg.histminutes.value*60) config.epg.histminutes.addNotifier(EpgHistorySecondsChanged) config.epg.cacheloadsched = ConfigYesNo(default = False) config.epg.cachesavesched = ConfigYesNo(default = False) def EpgCacheLoadSchedChanged(configElement): import EpgLoadSave EpgLoadSave.EpgCacheLoadCheck() def EpgCacheSaveSchedChanged(configElement): import EpgLoadSave EpgLoadSave.EpgCacheSaveCheck() config.epg.cacheloadsched.addNotifier(EpgCacheLoadSchedChanged, immediate_feedback = False) config.epg.cachesavesched.addNotifier(EpgCacheSaveSchedChanged, immediate_feedback = False) config.epg.cacheloadtimer = ConfigSelectionNumber(default = 24, stepwidth = 1, min = 1, max = 24, wraparound = True) config.epg.cachesavetimer = ConfigSelectionNumber(default = 24, stepwidth = 1, min = 1, max = 24, wraparound = True) config.osd.dst_left = ConfigSelectionNumber(default = 0, stepwidth = 1, min = 0, max = 720, wraparound = False) config.osd.dst_width = ConfigSelectionNumber(default = 720, stepwidth = 1, min = 0, max = 720, wraparound = False) config.osd.dst_top = ConfigSelectionNumber(default = 0, stepwidth = 1, min = 0, max = 576, wraparound = False) config.osd.dst_height = ConfigSelectionNumber(default = 576, stepwidth = 1, min = 0, max = 576, wraparound = False) config.osd.alpha = ConfigSelectionNumber(default = 255, stepwidth = 1, min = 0, max = 255, wraparound = False) config.av.osd_alpha = NoSave(ConfigNumber(default = 255)) config.osd.threeDmode = ConfigSelection([("off", _("Off")), ("auto", _("Auto")), ("sidebyside", _("Side by Side")),("topandbottom", _("Top and Bottom"))], "auto") config.osd.threeDznorm = ConfigSlider(default = 50, increment = 1, limits = (0, 100)) config.osd.show3dextensions = ConfigYesNo(default = False) choiceoptions = [("mode1", _("Mode 1")), ("mode2", _("Mode 2"))] config.osd.threeDsetmode = ConfigSelection(default = 'mode1' , choices = choiceoptions ) hddchoises = [('/etc/enigma2/', 'Internal Flash')] for p in harddiskmanager.getMountedPartitions(): if os.path.exists(p.mountpoint): d = os.path.normpath(p.mountpoint) if p.mountpoint != '/': hddchoises.append((p.mountpoint, d)) config.misc.epgcachepath = ConfigSelection(default = '/etc/enigma2/', choices = hddchoises) config.misc.epgcachefilename = ConfigText(default='epg', fixed_size=False) config.misc.epgcache_filename = ConfigText(default = (config.misc.epgcachepath.value + config.misc.epgcachefilename.value.replace('.dat','') + '.dat')) def EpgCacheChanged(configElement): config.misc.epgcache_filename.setValue(os.path.join(config.misc.epgcachepath.value, config.misc.epgcachefilename.value.replace('.dat','') + '.dat')) config.misc.epgcache_filename.save() enigma.eEPGCache.getInstance().setCacheFile(config.misc.epgcache_filename.value) from enigma import eEPGCache epgcache = eEPGCache.getInstance() epgcache.save() if not config.misc.epgcache_filename.value.startswith("/etc/enigma2/"): if os.path.exists('/etc/enigma2/' + config.misc.epgcachefilename.value.replace('.dat','') + '.dat'): os.remove('/etc/enigma2/' + config.misc.epgcachefilename.value.replace('.dat','') + '.dat') config.misc.epgcachepath.addNotifier(EpgCacheChanged, immediate_feedback = False) config.misc.epgcachefilename.addNotifier(EpgCacheChanged, immediate_feedback = False) config.misc.showradiopic = ConfigYesNo(default = True) def setHDDStandby(configElement): for hdd in harddiskmanager.HDDList(): hdd[1].setIdleTime(int(configElement.value)) config.usage.hdd_standby.addNotifier(setHDDStandby, immediate_feedback=False) def set12VOutput(configElement): if configElement.value == "on": enigma.Misc_Options.getInstance().set_12V_output(1) elif configElement.value == "off": enigma.Misc_Options.getInstance().set_12V_output(0) config.usage.output_12V.addNotifier(set12VOutput, immediate_feedback=False) SystemInfo["12V_Output"] = enigma.Misc_Options.getInstance().detected_12V_output() config.usage.keymap = ConfigText(default = eEnv.resolve("${datadir}/enigma2/keymap.xml")) config.network = ConfigSubsection() config.network.AFP_autostart = ConfigYesNo(default = True) config.network.NFS_autostart = ConfigYesNo(default = True) config.network.OpenVPN_autostart = ConfigYesNo(default = True) config.network.Samba_autostart = ConfigYesNo(default = True) config.network.Inadyn_autostart = ConfigYesNo(default = True) config.network.uShare_autostart = ConfigYesNo(default = True) config.softwareupdate = ConfigSubsection() config.softwareupdate.autosettingsbackup = ConfigYesNo(default = False) config.softwareupdate.autoimagebackup = ConfigYesNo(default = False) config.softwareupdate.check = ConfigYesNo(default = False) config.softwareupdate.checktimer = ConfigSelectionNumber(min = 1, max = 120, stepwidth = 1, default = 120, wraparound = True) config.softwareupdate.updatelastcheck = ConfigInteger(default=0) config.softwareupdate.updatefound = NoSave(ConfigBoolean(default = False)) config.softwareupdate.updatebeta = ConfigYesNo(default = False) config.softwareupdate.updateisunstable = ConfigInteger(default=0) config.timeshift = ConfigSubsection() choicelist = [("0", "Disabled")] for i in (2, 3, 4, 5, 10, 20, 30): choicelist.append(("%d" % i, ngettext("%d second", "%d seconds", i) % i)) for i in (60, 120, 300): m = i / 60 choicelist.append(("%d" % i, ngettext("%d minute", "%d minutes", m) % m)) config.timeshift.startdelay = ConfigSelection(default = "0", choices = choicelist) config.timeshift.showinfobar = ConfigYesNo(default = True) config.timeshift.stopwhilerecording = ConfigYesNo(default = False) config.timeshift.favoriteSaveAction = ConfigSelection([("askuser", _("Ask user")),("savetimeshift", _("Save and stop")),("savetimeshiftandrecord", _("Save and record")),("noSave", _("Don't save"))], "askuser") config.timeshift.permanentrecording = ConfigYesNo(default = False) config.timeshift.isRecording = NoSave(ConfigYesNo(default = False)) config.seek = ConfigSubsection() config.seek.baractivation = ConfigSelection([("leftright", _("Long Left/Right")),("ffrw", _("Long << / >>"))], "leftright") config.seek.sensibility = ConfigSelectionNumber(min = 1, max = 10, stepwidth = 1, default = 10, wraparound = True) config.seek.selfdefined_13 = ConfigSelectionNumber(min = 1, max = 300, stepwidth = 1, default = 15, wraparound = True) config.seek.selfdefined_46 = ConfigSelectionNumber(min = 1, max = 600, stepwidth = 1, default = 60, wraparound = True) config.seek.selfdefined_79 = ConfigSelectionNumber(min = 1, max = 1200, stepwidth = 10, default = 300, wraparound = True) config.seek.speeds_forward = ConfigSet(default=[2, 4, 8, 16, 32, 64, 128], choices=[2, 4, 6, 8, 12, 16, 24, 32, 48, 64, 96, 128]) config.seek.speeds_backward = ConfigSet(default=[2, 4, 8, 16, 32, 64, 128], choices=[1, 2, 4, 6, 8, 12, 16, 24, 32, 48, 64, 96, 128]) config.seek.speeds_slowmotion = ConfigSet(default=[2, 4, 8], choices=[2, 4, 6, 8, 12, 16, 25]) config.seek.enter_forward = ConfigSelection(default = "2", choices = ["2", "4", "6", "8", "12", "16", "24", "32", "48", "64", "96", "128"]) config.seek.enter_backward = ConfigSelection(default = "1", choices = ["1", "2", "4", "6", "8", "12", "16", "24", "32", "48", "64", "96", "128"]) config.seek.on_pause = ConfigSelection(default = "play", choices = [ ("play", _("Play")), ("step", _("Single step (GOP)")), ("last", _("Last speed")) ]) config.crash = ConfigSubsection() config.crash.details = ConfigYesNo(default = True) config.crash.enabledebug = ConfigYesNo(default = False) config.crash.debugloglimit = ConfigSelectionNumber(min = 1, max = 10, stepwidth = 1, default = 4, wraparound = True) config.crash.daysloglimit = ConfigSelectionNumber(min = 1, max = 30, stepwidth = 1, default = 8, wraparound = True) config.crash.sizeloglimit = ConfigSelectionNumber(min = 1, max = 20, stepwidth = 1, default = 10, wraparound = True) debugpath = [('/home/root/logs/', '/home/root/')] for p in harddiskmanager.getMountedPartitions(): if os.path.exists(p.mountpoint): d = os.path.normpath(p.mountpoint) if p.mountpoint != '/': debugpath.append((p.mountpoint + 'logs/', d)) config.crash.debug_path = ConfigSelection(default = "/home/root/logs/", choices = debugpath) def updatedebug_path(configElement): if not os.path.exists(config.crash.debug_path.value): os.mkdir(config.crash.debug_path.value,0755) config.crash.debug_path.addNotifier(updatedebug_path, immediate_feedback = False) config.usage.timerlist_finished_timer_position = ConfigSelection(default = "end", choices = [("beginning", _("at beginning")), ("end", _("at end"))]) def updateEnterForward(configElement): if not configElement.value: configElement.value = [2] updateChoices(config.seek.enter_forward, configElement.value) config.seek.speeds_forward.addNotifier(updateEnterForward, immediate_feedback = False) def updateEnterBackward(configElement): if not configElement.value: configElement.value = [2] updateChoices(config.seek.enter_backward, configElement.value) config.seek.speeds_backward.addNotifier(updateEnterBackward, immediate_feedback = False) def updateEraseSpeed(el): enigma.eBackgroundFileEraser.getInstance().setEraseSpeed(int(el.value)) def updateEraseFlags(el): enigma.eBackgroundFileEraser.getInstance().setEraseFlags(int(el.value)) config.misc.erase_speed = ConfigSelection(default="20", choices = [ ("10", "10 MB/s"), ("20", "20 MB/s"), ("50", "50 MB/s"), ("100", "100 MB/s")]) config.misc.erase_speed.addNotifier(updateEraseSpeed, immediate_feedback = False) config.misc.erase_flags = ConfigSelection(default="0", choices = [ ("0", _("Disable")), ("1", _("Internal hdd only")), ("3", _("Everywhere"))]) config.misc.erase_flags.addNotifier(updateEraseFlags, immediate_feedback = False) SystemInfo["ZapMode"] = os.path.exists("/proc/stb/video/zapmode") or os.path.exists("/proc/stb/video/zapping_mode") if SystemInfo["ZapMode"]: try: if os.path.exists("/proc/stb/video/zapping_mode"): zapoptions = [("mute", _("Black screen")), ("hold", _("Hold screen"))] zapfile = "/proc/stb/video/zapping_mode" else: zapoptions = [("mute", _("Black screen")), ("hold", _("Hold screen")), ("mutetilllock", _("Black screen till locked")), ("holdtilllock", _("Hold till locked"))] zapfile = "/proc/stb/video/zapmode" except: zapoptions = [("mute", _("Black screen")), ("hold", _("Hold screen")), ("mutetilllock", _("Black screen till locked")), ("holdtilllock", _("Hold till locked"))] zapfile = "/proc/stb/video/zapmode" def setZapmode(el): try: file = open(zapfile, "w") file.write(el.value) file.close() except: pass config.misc.zapmode = ConfigSelection(default = "mute", choices = zapoptions ) config.misc.zapmode.addNotifier(setZapmode, immediate_feedback = False) config.usage.historymode = ConfigSelection(default = "1", choices = [("0", _("Just zap")), ("1", _("Show menu"))]) config.subtitles = ConfigSubsection() config.subtitles.ttx_subtitle_colors = ConfigSelection(default = "1", choices = [ ("0", _("original")), ("1", _("white")), ("2", _("yellow")) ]) config.subtitles.ttx_subtitle_original_position = ConfigYesNo(default = False) config.subtitles.subtitle_position = ConfigSelection( choices = ["0", "10", "20", "30", "40", "50", "60", "70", "80", "90", "100", "150", "200", "250", "300", "350", "400", "450"], default = "50") config.subtitles.subtitle_alignment = ConfigSelection(choices = [("left", _("left")), ("center", _("center")), ("right", _("right"))], default = "center") config.subtitles.subtitle_rewrap = ConfigYesNo(default = False) config.subtitles.subtitle_borderwidth = ConfigSelection(choices = ["1", "2", "3", "4", "5"], default = "3") config.subtitles.subtitle_fontsize = ConfigSelection(choices = ["16", "18", "20", "22", "24", "26", "28", "30", "32", "34", "36", "38", "40", "42", "44", "46", "48", "50", "52", "54"], default = "34") subtitle_delay_choicelist = [] for i in range(-900000, 1845000, 45000): if i == 0: subtitle_delay_choicelist.append(("0", _("No delay"))) else: subtitle_delay_choicelist.append(("%d" % i, "%2.1f sec" % (i / 90000.))) config.subtitles.subtitle_noPTSrecordingdelay = ConfigSelection(default = "315000", choices = subtitle_delay_choicelist) config.subtitles.dvb_subtitles_yellow = ConfigYesNo(default = False) config.subtitles.dvb_subtitles_original_position = ConfigSelection(default = "0", choices = [("0", _("Original")), ("1", _("Fixed")), ("2", _("Relative"))]) config.subtitles.dvb_subtitles_centered = ConfigYesNo(default = False) config.subtitles.subtitle_bad_timing_delay = ConfigSelection(default = "0", choices = subtitle_delay_choicelist) config.subtitles.dvb_subtitles_backtrans = ConfigSelection(default = "0", choices = [ ("0", _("No transparency")), ("25", "10%"), ("50", "20%"), ("75", "30%"), ("100", "40%"), ("125", "50%"), ("150", "60%"), ("175", "70%"), ("200", "80%"), ("225", "90%"), ("255", _("Full transparency"))]) config.subtitles.pango_subtitle_colors = ConfigSelection(default = "0", choices = [ ("0", _("alternative")), ("1", _("white")), ("2", _("yellow")) ]) config.subtitles.pango_subtitles_delay = ConfigSelection(default = "0", choices = subtitle_delay_choicelist) config.subtitles.pango_subtitles_fps = ConfigSelection(default = "1", choices = [ ("1", _("Original")), ("23976", _("23.976")), ("24000", _("24")), ("25000", _("25")), ("29970", _("29.97")), ("30000", _("30"))]) config.subtitles.pango_autoturnon = ConfigYesNo(default = True) config.autolanguage = ConfigSubsection() audio_language_choices=[ ("---", _("None")), ("und", _("Undetermined")), ("orj dos ory org esl qaa und mis mul ORY ORJ Audio_ORJ", _("Original")), ("ara", _("Arabic")), ("eus baq", _("Basque")), ("bul", _("Bulgarian")), ("hrv", _("Croatian")), ("ces cze", _("Czech")), ("dan", _("Danish")), ("dut ndl Dutch", _("Dutch")), ("eng qaa Englisch", _("English")), ("est", _("Estonian")), ("fin", _("Finnish")), ("fra fre", _("French")), ("deu ger", _("German")), ("ell gre", _("Greek")), ("heb", _("Hebrew")), ("hun", _("Hungarian")), ("ita", _("Italian")), ("lav", _("Latvian")), ("lit", _("Lithuanian")), ("ltz", _("Luxembourgish")), ("nor", _("Norwegian")), ("pol", _("Polish")), ("por", _("Portuguese")), ("fas per", _("Persian")), ("ron rum", _("Romanian")), ("rus", _("Russian")), ("srp", _("Serbian")), ("slk slo", _("Slovak")), ("slv", _("Slovenian")), ("spa", _("Spanish")), ("swe", _("Swedish")), ("tha", _("Thai")), ("tur Audio_TUR", _("Turkish"))] def setEpgLanguage(configElement): enigma.eServiceEvent.setEPGLanguage(configElement.value) config.autolanguage.audio_epglanguage = ConfigSelection(audio_language_choices[:1] + audio_language_choices [2:], default="---") config.autolanguage.audio_epglanguage.addNotifier(setEpgLanguage) def setEpgLanguageAlternative(configElement): enigma.eServiceEvent.setEPGLanguageAlternative(configElement.value) config.autolanguage.audio_epglanguage_alternative = ConfigSelection(audio_language_choices[:1] + audio_language_choices [2:], default="---") config.autolanguage.audio_epglanguage_alternative.addNotifier(setEpgLanguageAlternative) config.autolanguage.audio_autoselect1 = ConfigSelection(choices=audio_language_choices, default="---") config.autolanguage.audio_autoselect2 = ConfigSelection(choices=audio_language_choices, default="---") config.autolanguage.audio_autoselect3 = ConfigSelection(choices=audio_language_choices, default="---") config.autolanguage.audio_autoselect4 = ConfigSelection(choices=audio_language_choices, default="---") config.autolanguage.audio_defaultac3 = ConfigYesNo(default = True) config.autolanguage.audio_usecache = ConfigYesNo(default = True) subtitle_language_choices = audio_language_choices[:1] + audio_language_choices [2:] config.autolanguage.subtitle_autoselect1 = ConfigSelection(choices=subtitle_language_choices, default="---") config.autolanguage.subtitle_autoselect2 = ConfigSelection(choices=subtitle_language_choices, default="---") config.autolanguage.subtitle_autoselect3 = ConfigSelection(choices=subtitle_language_choices, default="---") config.autolanguage.subtitle_autoselect4 = ConfigSelection(choices=subtitle_language_choices, default="---") config.autolanguage.subtitle_hearingimpaired = ConfigYesNo(default = False) config.autolanguage.subtitle_defaultimpaired = ConfigYesNo(default = False) config.autolanguage.subtitle_defaultdvb = ConfigYesNo(default = False) config.autolanguage.subtitle_usecache = ConfigYesNo(default = True) config.autolanguage.equal_languages = ConfigSelection(default = "15", choices = [ ("0", "None"),("1", "1"),("2", "2"),("3", "1,2"), ("4", "3"),("5", "1,3"),("6", "2,3"),("7", "1,2,3"), ("8", "4"),("9", "1,4"),("10", "2,4"),("11", "1,2,4"), ("12", "3,4"),("13", "1,3,4"),("14", "2,3,4"),("15", "All")]) config.logmanager = ConfigSubsection() config.logmanager.showinextensions = ConfigYesNo(default = False) config.logmanager.user = ConfigText(default='', fixed_size=False) config.logmanager.useremail = ConfigText(default='', fixed_size=False) config.logmanager.usersendcopy = ConfigYesNo(default = True) config.logmanager.path = ConfigText(default = "/") config.logmanager.additionalinfo = NoSave(ConfigText(default = "")) config.logmanager.sentfiles = ConfigLocations(default='') config.vixsettings = ConfigSubsection() config.vixsettings.Subservice = ConfigYesNo(default = True) config.vixsettings.ColouredButtons = ConfigYesNo(default = True) config.vixsettings.InfoBarEpg_mode = ConfigSelection(default="3", choices = [ ("0", _("as plugin in extended bar")), ("1", _("with long OK press")), ("2", _("with exit button")), ("3", _("with left/right buttons"))]) config.epgselection = ConfigSubsection() config.epgselection.sort = ConfigSelection(default="0", choices = [("0", _("Time")),("1", _("Alphanumeric"))]) config.epgselection.overjump = ConfigYesNo(default = False) config.epgselection.infobar_type_mode = ConfigSelection(choices = [("graphics",_("Multi EPG")), ("single", _("Single EPG"))], default = "graphics") if SystemInfo.get("NumVideoDecoders", 1) > 1: config.epgselection.infobar_preview_mode = ConfigSelection(choices = [("0",_("Disabled")), ("1", _("Full screen")), ("2", _("PiP"))], default = "1") else: config.epgselection.infobar_preview_mode = ConfigSelection(choices = [("0",_("Disabled")), ("1", _("Full screen"))], default = "1") config.epgselection.infobar_ok = ConfigSelection(choices = [("Zap",_("Zap")), ("Zap + Exit", _("Zap + Exit"))], default = "Zap") config.epgselection.infobar_oklong = ConfigSelection(choices = [("Zap",_("Zap")), ("Zap + Exit", _("Zap + Exit"))], default = "Zap + Exit") config.epgselection.infobar_itemsperpage = ConfigSelectionNumber(default = 2, stepwidth = 1, min = 2, max = 4, wraparound = True) if SystemInfo.get("NumVideoDecoders", 1) > 1: if about.getCPUString() in ('BCM7346B2', 'BCM7425B2'): previewdefault = "2" else: previewdefault = "1" config.epgselection.infobar_preview_mode = ConfigSelection(choices = [("0",_("Disabled")), ("1", _("Full screen")), ("2", _("PiP"))], default = previewdefault) else: config.epgselection.infobar_preview_mode = ConfigSelection(choices = [("0",_("Disabled")), ("1", _("Full screen"))], default = "1") config.epgselection.infobar_roundto = ConfigSelection(default = "15", choices = [("15", _("%d minutes") % 15), ("30", _("%d minutes") % 30), ("60", _("%d minutes") % 60)]) config.epgselection.infobar_prevtime = ConfigClock(default = time()) config.epgselection.infobar_prevtimeperiod = ConfigSelection(default = "180", choices = [("60", _("%d minutes") % 60), ("90", _("%d minutes") % 90), ("120", _("%d minutes") % 120), ("150", _("%d minutes") % 150), ("180", _("%d minutes") % 180), ("210", _("%d minutes") % 210), ("240", _("%d minutes") % 240), ("270", _("%d minutes") % 270), ("300", _("%d minutes") % 300)]) config.epgselection.infobar_primetimehour = ConfigSelectionNumber(default = 20, stepwidth = 1, min = 00, max = 23, wraparound = True) config.epgselection.infobar_primetimemins = ConfigSelectionNumber(default = 00, stepwidth = 1, min = 00, max = 59, wraparound = True) config.epgselection.infobar_servicetitle_mode = ConfigSelection(default = "servicename", choices = [("servicename", _("Service Name")),("picon", _("Picon")),("picon+servicename", _("Picon and Service Name")) ]) config.epgselection.infobar_servfs = ConfigSelectionNumber(default = 0, stepwidth = 1, min = -8, max = 10, wraparound = True) config.epgselection.infobar_eventfs = ConfigSelectionNumber(default = 0, stepwidth = 1, min = -8, max = 10, wraparound = True) config.epgselection.infobar_timelinefs = ConfigSelectionNumber(default = 0, stepwidth = 1, min = -8, max = 10, wraparound = True) config.epgselection.infobar_servicewidth = ConfigSelectionNumber(default = 250, stepwidth = 1, min = 70, max = 500, wraparound = True) config.epgselection.infobar_piconwidth = ConfigSelectionNumber(default = 100, stepwidth = 1, min = 70, max = 500, wraparound = True) config.epgselection.enhanced_preview_mode = ConfigYesNo(default = True) config.epgselection.enhanced_ok = ConfigSelection(choices = [("Zap",_("Zap")), ("Zap + Exit", _("Zap + Exit"))], default = "Zap") config.epgselection.enhanced_oklong = ConfigSelection(choices = [("Zap",_("Zap")), ("Zap + Exit", _("Zap + Exit"))], default = "Zap + Exit") config.epgselection.enhanced_eventfs = ConfigSelectionNumber(default = 0, stepwidth = 1, min = -8, max = 10, wraparound = True) config.epgselection.enhanced_itemsperpage = ConfigSelectionNumber(default = 18, stepwidth = 1, min = 12, max = 40, wraparound = True) config.epgselection.multi_showbouquet = ConfigYesNo(default = False) config.epgselection.multi_preview_mode = ConfigYesNo(default = True) config.epgselection.multi_ok = ConfigSelection(choices = [("Zap",_("Zap")), ("Zap + Exit", _("Zap + Exit"))], default = "Zap") config.epgselection.multi_oklong = ConfigSelection(choices = [("Zap",_("Zap")), ("Zap + Exit", _("Zap + Exit"))], default = "Zap + Exit") config.epgselection.multi_eventfs = ConfigSelectionNumber(default = 0, stepwidth = 1, min = -8, max = 10, wraparound = True) config.epgselection.multi_itemsperpage = ConfigSelectionNumber(default = 18, stepwidth = 1, min = 12, max = 40, wraparound = True) config.epgselection.graph_showbouquet = ConfigYesNo(default = False) config.epgselection.graph_preview_mode = ConfigYesNo(default = True) config.epgselection.graph_type_mode = ConfigSelection(choices = [("graphics",_("Graphics")), ("text", _("Text"))], default = "graphics") config.epgselection.graph_ok = ConfigSelection(choices = [("Zap",_("Zap")), ("Zap + Exit", _("Zap + Exit"))], default = "Zap") config.epgselection.graph_oklong = ConfigSelection(choices = [("Zap",_("Zap")), ("Zap + Exit", _("Zap + Exit"))], default = "Zap + Exit") config.epgselection.graph_info = ConfigSelection(choices = [("Channel Info", _("Channel Info")), ("Single EPG", _("Single EPG"))], default = "Channel Info") config.epgselection.graph_infolong = ConfigSelection(choices = [("Channel Info", _("Channel Info")), ("Single EPG", _("Single EPG"))], default = "Single EPG") config.epgselection.graph_roundto = ConfigSelection(default = "15", choices = [("15", _("%d minutes") % 15), ("30", _("%d minutes") % 30), ("60", _("%d minutes") % 60)]) config.epgselection.graph_prevtime = ConfigClock(default = time()) config.epgselection.graph_prevtimeperiod = ConfigSelection(default = "180", choices = [("60", _("%d minutes") % 60), ("90", _("%d minutes") % 90), ("120", _("%d minutes") % 120), ("150", _("%d minutes") % 150), ("180", _("%d minutes") % 180), ("210", _("%d minutes") % 210), ("240", _("%d minutes") % 240), ("270", _("%d minutes") % 270), ("300", _("%d minutes") % 300)]) config.epgselection.graph_primetimehour = ConfigSelectionNumber(default = 20, stepwidth = 1, min = 00, max = 23, wraparound = True) config.epgselection.graph_primetimemins = ConfigSelectionNumber(default = 00, stepwidth = 1, min = 00, max = 59, wraparound = True) config.epgselection.graph_servicetitle_mode = ConfigSelection(default = "picon+servicename", choices = [("servicename", _("Service Name")),("picon", _("Picon")),("picon+servicename", _("Picon and Service Name")) ]) config.epgselection.graph_channel1 = ConfigYesNo(default = False) config.epgselection.graph_servfs = ConfigSelectionNumber(default = 0, stepwidth = 1, min = -8, max = 10, wraparound = True) config.epgselection.graph_eventfs = ConfigSelectionNumber(default = 0, stepwidth = 1, min = -8, max = 10, wraparound = True) config.epgselection.graph_timelinefs = ConfigSelectionNumber(default = 0, stepwidth = 1, min = -8, max = 10, wraparound = True) config.epgselection.graph_itemsperpage = ConfigSelectionNumber(default = 8, stepwidth = 1, min = 3, max = 16, wraparound = True) config.epgselection.graph_pig = ConfigYesNo(default = True) config.epgselection.graph_heightswitch = NoSave(ConfigYesNo(default = False)) config.epgselection.graph_servicewidth = ConfigSelectionNumber(default = 250, stepwidth = 1, min = 70, max = 500, wraparound = True) config.epgselection.graph_piconwidth = ConfigSelectionNumber(default = 100, stepwidth = 1, min = 70, max = 500, wraparound = True) if not os.path.exists('/usr/emu/'): os.mkdir('/usr/emu/',0755) softcams = os.listdir('/usr/emu/') config.oscaminfo = ConfigSubsection() config.oscaminfo.showInExtensions = ConfigYesNo(default=False) config.oscaminfo.userdatafromconf = ConfigYesNo(default = False) config.oscaminfo.autoupdate = ConfigYesNo(default = False) config.oscaminfo.username = ConfigText(default = "username", fixed_size = False, visible_width=12) config.oscaminfo.password = ConfigPassword(default = "password", fixed_size = False) config.oscaminfo.ip = ConfigIP( default = [ 127,0,0,1 ], auto_jump=True) config.oscaminfo.port = ConfigInteger(default = 16002, limits=(0,65536) ) config.oscaminfo.intervall = ConfigSelectionNumber(min = 1, max = 600, stepwidth = 1, default = 10, wraparound = True) SystemInfo["OScamInstalled"] = False config.cccaminfo = ConfigSubsection() config.cccaminfo.showInExtensions = ConfigYesNo(default=False) config.cccaminfo.serverNameLength = ConfigSelectionNumber(min = 10, max = 100, stepwidth = 1, default = 22, wraparound = True) config.cccaminfo.name = ConfigText(default="Profile", fixed_size=False) config.cccaminfo.ip = ConfigText(default="192.168.2.12", fixed_size=False) config.cccaminfo.username = ConfigText(default="", fixed_size=False) config.cccaminfo.password = ConfigText(default="", fixed_size=False) config.cccaminfo.port = ConfigInteger(default=16001, limits=(1, 65535)) config.cccaminfo.profile = ConfigText(default="", fixed_size=False) config.cccaminfo.ecmInfoEnabled = ConfigYesNo(default=True) config.cccaminfo.ecmInfoTime = ConfigSelectionNumber(min = 1, max = 10, stepwidth = 1, default = 5, wraparound = True) config.cccaminfo.ecmInfoForceHide = ConfigYesNo(default=True) config.cccaminfo.ecmInfoPositionX = ConfigInteger(default=50) config.cccaminfo.ecmInfoPositionY = ConfigInteger(default=50) config.cccaminfo.blacklist = ConfigText(default="/media/cf/CCcamInfo.blacklisted", fixed_size=False) config.cccaminfo.profiles = ConfigText(default="/media/cf/CCcamInfo.profiles", fixed_size=False) SystemInfo["CCcamInstalled"] = False for softcam in softcams: if softcam.lower().startswith('cccam'): config.cccaminfo.showInExtensions = ConfigYesNo(default=True) SystemInfo["CCcamInstalled"] = True elif softcam.lower().startswith('oscam'): config.oscaminfo.showInExtensions = ConfigYesNo(default=True) SystemInfo["OScamInstalled"] = True config.streaming = ConfigSubsection() config.streaming.stream_ecm = ConfigYesNo(default = False) config.streaming.descramble = ConfigYesNo(default = True) config.streaming.stream_eit = ConfigYesNo(default = True) config.streaming.stream_ait = ConfigYesNo(default = True) config.pluginbrowser = ConfigSubsection() config.pluginbrowser.po = ConfigYesNo(default = False) config.pluginbrowser.src = ConfigYesNo(default = False)
def getAboutText(): AboutText = '' AboutText += _('Model:\t%s %s\n') % (getMachineBrand(), getMachineName()) if path.exists('/proc/stb/info/chipset'): AboutText += _('Chipset:\t%s') % about.getChipSetString() + '\n' cpuMHz = '' if getBoxType() in 'vusolo4k': cpuMHz = ' (1,5 GHz)' elif path.exists('/proc/cpuinfo'): f = open('/proc/cpuinfo', 'r') temp = f.readlines() f.close() try: for lines in temp: lisp = lines.split(': ') if lisp[0].startswith('cpu MHz'): cpuMHz = ' (' + str(int(float(lisp[1].replace('\n', '')))) + ' MHz)' break except: pass AboutText += _('CPU:\t%s') % about.getCPUString() + cpuMHz + '\n' AboutText += _('Cores:\t%s') % about.getCpuCoresString() + '\n' AboutText += _('Version:\t%s') % getImageVersion() + '\n' AboutText += _('Build:\t%s') % getImageBuild() + '\n' AboutText += _('Kernel:\t%s') % about.getKernelVersionString() + '\n' string = getDriverDate() year = string[0:4] month = string[4:6] day = string[6:8] driversdate = '-'.join((year, month, day)) AboutText += _('Drivers:\t%s') % driversdate + '\n' AboutText += _('GStreamer:\t%s') % about.getGStreamerVersionString() + '\n' AboutText += _('Python:\t%s') % about.getPythonVersionString() + '\n' AboutText += _('Skin name:\t%s\n') % config.skin.primary_skin.value[0:-9] AboutText += _('Installed:\t%s') % about.getFlashDateString() + '\n' AboutText += _('Last update:\t%s') % getEnigmaVersionString() + '\n' fp_version = getFPVersion() if fp_version is None: fp_version = '' elif fp_version != 0: fp_version = _('Frontprocessor version: %s') % fp_version AboutText += fp_version + '\n' tempinfo = '' if path.exists('/proc/stb/sensors/temp0/value'): f = open('/proc/stb/sensors/temp0/value', 'r') tempinfo = f.read() f.close() elif path.exists('/proc/stb/fp/temp_sensor'): f = open('/proc/stb/fp/temp_sensor', 'r') tempinfo = f.read() f.close() if tempinfo and int(tempinfo.replace('\n', '')) > 0: mark = str('\xc2\xb0') AboutText += _('System temperature:\t%s') % tempinfo.replace('\n', '').replace(' ', '') + mark + 'C\n' tempinfo = '' if path.exists('/proc/stb/fp/temp_sensor_avs'): f = open('/proc/stb/fp/temp_sensor_avs', 'r') tempinfo = f.read() f.close() if tempinfo and int(tempinfo.replace('\n', '')) > 0: mark = str('\xc2\xb0') AboutText += _('Processor temperature:\t%s') % tempinfo.replace('\n', '').replace(' ', '') + mark + 'C\n' AboutLcdText = AboutText.replace('\t', ' ') return (AboutText, AboutLcdText)
def getAboutText(): AboutText = "" AboutText += _("Model:\t%s %s\n") % (getMachineBrand(), getMachineName()) if path.exists('/proc/stb/info/chipset'): AboutText += _("Chipset:\t%s") % about.getChipSetString() + "\n" cpuMHz = "" if path.exists('/proc/cpuinfo'): f = open('/proc/cpuinfo', 'r') temp = f.readlines() f.close() try: for lines in temp: lisp = lines.split(': ') if lisp[0].startswith('cpu MHz'): #cpuMHz = " (" + lisp[1].replace('\n', '') + " MHz)" cpuMHz = " (" + str(int(float(lisp[1].replace( '\n', '')))) + " MHz)" break except: pass AboutText += _("CPU:\t%s") % about.getCPUString() + cpuMHz + "\n" AboutText += _("Cores:\t%s") % about.getCpuCoresString() + "\n" AboutText += _("Version:\t%s") % 'SpecialEdition' + "\n" AboutText += _("Moderator:\t%s") % 'Sodo' + "\n" AboutText += _("Build:\t%s") % '3.0' + "\n" AboutText += _("Kernel:\t%s") % about.getKernelVersionString() + "\n" string = getDriverDate() year = string[0:4] month = string[4:6] day = string[6:8] driversdate = '-'.join((year, month, day)) AboutText += _("Drivers:\t%s") % driversdate + "\n" AboutText += _("Last update:\t%s") % getEnigmaVersionString() + "\n\n" AboutText += _("GStreamer:\t%s") % about.getGStreamerVersionString() + "\n" fp_version = getFPVersion() if fp_version is None: fp_version = "" elif fp_version != 0: fp_version = _("Frontprocessor version: %s") % fp_version AboutText += fp_version + "\n" tempinfo = "" if path.exists('/proc/stb/sensors/temp0/value'): f = open('/proc/stb/sensors/temp0/value', 'r') tempinfo = f.read() f.close() elif path.exists('/proc/stb/fp/temp_sensor'): f = open('/proc/stb/fp/temp_sensor', 'r') tempinfo = f.read() f.close() if tempinfo and int(tempinfo.replace('\n', '')) > 0: mark = str('\xc2\xb0') AboutText += _("System temperature:\t%s") % tempinfo.replace( '\n', '').replace(' ', '') + mark + "C\n" tempinfo = "" if path.exists('/proc/stb/fp/temp_sensor_avs'): f = open('/proc/stb/fp/temp_sensor_avs', 'r') tempinfo = f.read() f.close() if tempinfo and int(tempinfo.replace('\n', '')) > 0: mark = str('\xc2\xb0') AboutText += _("Processor temperature:\t%s") % tempinfo.replace( '\n', '').replace(' ', '') + mark + "C\n" AboutLcdText = AboutText.replace('\t', ' ') return AboutText, AboutLcdText
def getAboutText(): AboutText = "" AboutText += _("Model:\t%s %s\n") % (getMachineBrand(), getMachineName()) bootloader = "" if path.exists('/sys/firmware/devicetree/base/bolt/tag'): f = open('/sys/firmware/devicetree/base/bolt/tag', 'r') bootloader = f.readline().replace('\x00', '').replace('\n', '') f.close() AboutText += _("Bootloader:\t\t%s\n") % (bootloader) if path.exists('/proc/stb/info/chipset'): AboutText += _("Chipset:\t%s") % about.getChipSetString() + "\n" cpuMHz = "" if getMachineBuild() in ('vusolo4k'): cpuMHz = " (1,5 GHz)" elif getMachineBuild() in ('hd52','hd51'): try: import binascii f = open('/sys/firmware/devicetree/base/cpus/cpu@0/clock-frequency', 'rb') clockfrequency = f.read() f.close() cpuMHz = " (%s MHz)" % str(round(int(binascii.hexlify(clockfrequency), 16)/1000000,1)) except: cpuMHz = " (1,7 GHz)" else: if path.exists('/proc/cpuinfo'): f = open('/proc/cpuinfo', 'r') temp = f.readlines() f.close() try: for lines in temp: lisp = lines.split(': ') if lisp[0].startswith('cpu MHz'): #cpuMHz = " (" + lisp[1].replace('\n', '') + " MHz)" cpuMHz = " (" + str(int(float(lisp[1].replace('\n', '')))) + " MHz)" break except: pass AboutText += _("CPU:\t%s") % about.getCPUString() + cpuMHz + "\n" AboutText += _("Cores:\t%s") % about.getCpuCoresString() + "\n" imagestarted = "" bootname = '' if path.exists('/boot/bootname'): f = open('/boot/bootname', 'r') bootname = f.readline().split('=')[1] f.close() if path.exists('/boot/STARTUP'): f = open('/boot/STARTUP', 'r') f.seek(22) image = f.read(1) f.close() if bootname: bootname = " (%s)" %bootname AboutText += _("Selected Image:\t%s") % "STARTUP_" + image + bootname + "\n" AboutText += _("Version:\t%s") % getImageVersion() + "\n" AboutText += _("Build:\t%s") % getImageBuild() + "\n" AboutText += _("Kernel:\t%s") % about.getKernelVersionString() + "\n" string = getDriverDate() year = string[0:4] month = string[4:6] day = string[6:8] driversdate = '-'.join((year, month, day)) AboutText += _("Drivers:\t%s") % driversdate + "\n" AboutText += _("GStreamer:\t%s") % about.getGStreamerVersionString() + "\n" AboutText += _("Python:\t%s") % about.getPythonVersionString() + "\n" AboutText += _("Installed:\t%s") % about.getFlashDateString() + "\n" AboutText += _("Last update:\t%s") % getEnigmaVersionString() + "\n" fp_version = getFPVersion() if fp_version is None: fp_version = "" elif fp_version != 0: fp_version = _("Frontprocessor version: %s") % fp_version AboutText += fp_version + "\n" tempinfo = "" if path.exists('/proc/stb/sensors/temp0/value'): f = open('/proc/stb/sensors/temp0/value', 'r') tempinfo = f.read() f.close() elif path.exists('/proc/stb/fp/temp_sensor'): f = open('/proc/stb/fp/temp_sensor', 'r') tempinfo = f.read() f.close() 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() if tempinfo and int(tempinfo.replace('\n', '')) > 0: mark = str('\xc2\xb0') AboutText += _("Processor temperature:\t%s") % tempinfo.replace('\n', '').replace(' ','') + mark + "C\n" AboutLcdText = AboutText.replace('\t', ' ') return AboutText, AboutLcdText
def updateInfo(self): #self.DynamicTimer.start(6000) rc = system("df -h > /tmp/syinfo.tmp") self.text = _("BOX\n") f = open("/proc/stb/info/model",'r') self.text += _("Model:\t%s") % str(getMachineBrand()) + " " + str(getMachineName()) + "\n" f.close() #f = open("/proc/stb/info/chipset",'r') #self.text += "Chipset:\t" + about.getChipSetString() + "\n" #f.close() cmd = 'cat /proc/cpuinfo | grep "cpu MHz" -m 1 | awk -F ": " ' + "'{print $2}'" cmd2 = 'cat /proc/cpuinfo | grep "BogoMIPS" -m 1 | awk -F ": " ' + "'{print $2}'" try: res = popen(cmd).read() res2 = popen(cmd2).read() except: res = "" res2 = "" cpuMHz = "" bogoMIPS = "" if getMachineBuild() in ('vusolo4k','vuultimo4k','vuzero4k'): cpuMHz = " \t(1,5 GHz)" elif getMachineBuild() in ('formuler1tc','formuler1','triplex','tiviaraplus'): cpuMHz = " \t(1,3 GHz)" elif getMachineBuild() in ('u51','u5','u53','u52','u5pvr','h9'): cpuMHz = " \t(1,6 GHz)" elif getMachineBuild() in ('vuuno4kse','vuuno4k','gbquad4k','dm900','dm920','gb7252','dags7252','xc7439','8100s'): cpuMHz = " \t(1,7 GHz)" elif getMachineBuild() in ('alien5'): cpuMHz = " \t(2,0 GHz)" elif getMachineBuild() in ('sf5008','et13000','et1x000','hd52','hd51','sf4008','vs1500','h7'): try: import binascii f = open('/sys/firmware/devicetree/base/cpus/cpu@0/clock-frequency', 'rb') clockfrequency = f.read() f.close() cpuMHz = " \t(%s MHz)" % str(round(int(binascii.hexlify(clockfrequency), 16)/1000000,1)) except: cpuMHz = " \t(1,7 GHz)" elif res: cpuMHz = " \t(" + res.replace("\n", "") + " MHz)" if res2: bogoMIPS = "" + res2.replace("\n", "") f = open('/proc/cpuinfo', 'r') self.text += "CPU: \t" + str(about.getCPUString()) + cpuMHz + " " + str(about.getCpuCoresString2()) + "\n" self.text += _("Cores:\t %s") % str(about.getCpuCoresString()) + "\n" self.text += _("Architecture:\t %s") % str(about.getCPUArch()) + "\n" #self.text += _("CPU Load:\t %s") % str(about.getLoadCPUString()) + "\n" self.text += "BogoMIPS: \t" + bogoMIPS + "\n" f.close() #self.text += _("\nMEMORY\n") #self.text += _("Total:\t%s") % str(about.getRAMTotalString()) + " MB\n" #self.text += _("Free:\t%s ") % str(about.getRAMFreeString()) + " MB (" + str(about.getRAMFreePorcString()) + ")\n" #self.text += _("Usage:\t%s") % str(about.getRAMUsedString()) + " MB (" + str(about.getRAMusageString()) + ")\n" #self.text += _("Shared:\t%s") % str(about.getRAMSharingString()) + " MB" + "\n" #self.text += _("Stored:\t%s") % str(about.getRAMStoredString()) + " MB" + "\n" #self.text += _("Cached:\t%s") % str(about.getRAMCachedString()) + " MB" + "\n" #out_lines = file("/proc/meminfo").readlines() #for lidx in range(len(out_lines) - 1): # tstLine = out_lines[lidx].split() # if "Buffers:" in tstLine: # Buffers = out_lines[lidx].split() # self.text += _("Buffers:") + "\t" + Buffers[1] + ' kB'"\n" # if "Cached:" in tstLine: # Cached = out_lines[lidx].split() # self.text += _("Cached:") + "\t" + Cached[1] + ' kB'"\n" #self.text += _("Swap total:\t%s") % str(about.getRAMSwapTotalString()) + " MB\n" #self.text += _("Swap free:\t%s") % str(about.getRAMSwapFreeString()) + " MB\n" #self.text += _("\nSTORAGE\n") #if os.path.exists('/tmp/syinfo.tmp'): # try: # f = open("/tmp/syinfo.tmp",'r') # line = f.readline() # parts = line.split() # self.text += parts[0] + "\t" + parts[1].strip() + " " + parts[2].strip() + " " + parts[3].strip() + " " + parts[4] + "\n" # line = f.readline() # parts = line.split() # self.text += "Flash" + "\t" + parts[1].strip() + " " + parts[2].strip() + " " + parts[3].strip() + " " + parts[4] + "\n" # for line in f.readlines(): # if line.find('/media/') != -1: # line = line.replace('/media/', ' ') # parts = line.split() # if len(parts) == 6: # self.text += parts[5] + "\t" + parts[1].strip() + " " + parts[2].strip() + " " + parts[3].strip() + " " + parts[4] + "\n" # f.close() # os_remove("/tmp/syinfo.tmp") # except: # return self.text += "\nSOFTWARE\n" openLD = "OpenLD " self.text += "Firmware:\t %s" % openLD + str(about.getImageVersion()) + "\n" self.text += _("CodeName:\t %s") % str(getImageCodeName()) + "\n" self.text += "Kernel: \t " + about.getKernelVersionString() + "\n" self.text += _("DVB drivers:\t %s") % MyDateConverter(str(about.getDriverInstalledDate())) + "\n" self.text += _("Last update:\t %s") % MyDateConverter(str(getEnigmaVersionString())) + "\n" self.text += _("Restarts:\t %d ") % config.misc.startCounter.value + "\n" self.text += _("Uptime:\t %s") % str(about.getUptimeString()) + "\n" self.text += _("GStreamer:\t %s") % str(about.getGStreamerVersionString().replace('GStreamer','')) + "\n" if path.exists('/usr/bin/ffmpeg'): try: self.text += _("FFmpeg:\t %s") % str(about.getFFmpegVersionString()) + "\n" except: pass self.text += _("Python:\t %s") % about.getPythonVersionString() + "\n\n" self["lab1"].setText(self.text)
def __init__(self, session): Screen.__init__(self, session) # [ IQON : by knuth model = HardwareInfo().get_device_name() macaddress = about.getMacAddressString("eth0") if model in ("force2solid"): AboutText = _("BRAND: ") + "IQON" + "\n" AboutText += _("Hardware: ") + "FORCE2" + "\n" elif model in ("tmnanose"): AboutText = _("Hardware: ") + "TM-NANO-SE" + "\n" elif model in ("optimussosplus"): AboutText = _("Hardware: ") + "OPTIMUSS OS+" + "\n" elif model in ("force2plus"): AboutText = _("Hardware: ") + "FORCE2+" + "\n" elif model in ("tmnanosecombo"): AboutText = _("Hardware: ") + "TM-NANO-SE Combo" + "\n" elif model in ("tmnanosem2"): AboutText = _("Hardware: ") + "TM-NANO-SE M2" + "\n" elif model in ("optimussos2"): AboutText = _("Hardware: ") + "OPTIMUSS OS2" + "\n" elif model in ("optimussos1"): AboutText = _("Hardware: ") + "OPTIMUSS OS1" + "\n" elif model in ("optimussos2plus"): AboutText = _("Hardware: ") + "OPTIMUSS OS2+" + "\n" elif model in ("optimussos1plus"): AboutText = _("Hardware: ") + "OPTIMUSS OS1+" + "\n" elif model in ("force2eco"): AboutText = _("Hardware: ") + "FORCE2 Eco" + "\n" elif model in ("fusionhd"): AboutText = _("Hardware: ") + "FUSION HD" + "\n" elif model in ("force1plus"): f = open("/etc/.brandtype", 'r') line = f.readline() if "technomate" in line: AboutText = _("Hardware: ") + "TM-NANO-3T COMBO" + "\n" elif "edision" in line: AboutText = _("Hardware: ") + "OPTIMUSS OS3+" + "\n" elif "iqon" in line: AboutText = _("BRAND: ") + "IQON" + "\n" AboutText += _("Hardware: ") + about.getHardwareTypeString() + "\n" else: AboutText = _("Hardware: ") + about.getHardwareModelString() + "\n" f.close() else: AboutText = _("Hardware: ") + about.getHardwareModelString() + "\n" AboutText += _("Mac Address: ") + macaddress + "\n" if HardwareInfo().has_micom(): AboutText += _("Micom Version: ") + about.getMicomVersionString() + "\n" # AboutText = _("Hardware: ") + about.getHardwareTypeString() + "\n" AboutText += _("Image: ") + about.getImageTypeString() + "\n" AboutText += _("Kernel version: ") + about.getKernelVersionString() + "\n" EnigmaVersion = "Enigma: " + about.getEnigmaVersionString() self["EnigmaVersion"] = StaticText(EnigmaVersion) AboutText += EnigmaVersion + "\n" ImageVersion = _("Last upgrade: ") + about.getImageVersionString() self["ImageVersion"] = StaticText(ImageVersion) AboutText += ImageVersion + "\n" fp_version = getFPVersion() if fp_version is None: fp_version = "" else: fp_version = _("Frontprocessor version: %d") % fp_version AboutText += fp_version + "\n" # if path.exists('/proc/stb/info/chipset'): AboutText += _("Chipset: BCM%s\n") % about.getChipSetString() AboutText += _("CPU: %s\n") % about.getCPUString() AboutText += _("CPU Speed: %s\n") % about.getCPUSpeedString() AboutText += _("Cores: %s\n") % about.getCpuCoresString() self["FPVersion"] = StaticText(fp_version) self["TunerHeader"] = StaticText(_("Detected NIMs:")) AboutText += "\n" + _("Detected NIMs:") + "\n" nims = nimmanager.nimList() for count in range(len(nims)): if count < 4: self["Tuner" + str(count)] = StaticText(nims[count]) else: self["Tuner" + str(count)] = StaticText("") AboutText += nims[count] + "\n" self["HDDHeader"] = StaticText(_("Detected HDD:")) AboutText += "\n" + _("Detected HDD:") + "\n" hddlist = harddiskmanager.HDDList() hddinfo = "" if hddlist: for count in range(len(hddlist)): if hddinfo: hddinfo += "\n" hdd = hddlist[count][1] if int(hdd.free()) > 1024: hddinfo += "%s\n(%s, %d GB %s)" % (hdd.model(), hdd.capacity(), hdd.free()/1024, _("free")) else: hddinfo += "%s\n(%s, %d MB %s)" % (hdd.model(), hdd.capacity(), hdd.free(), _("free")) else: hddinfo = _("none") self["hddA"] = StaticText(hddinfo) AboutText += hddinfo self["AboutScrollLabel"] = ScrollLabel(AboutText) self["key_green"] = Button(_("Translations")) self["key_red"] = Button(_("Latest Commits")) self["actions"] = ActionMap(["ColorActions", "SetupActions", "DirectionActions"], { "cancel": self.close, "ok": self.close, "red": self.showCommits, "green": self.showTranslationInfo, "up": self["AboutScrollLabel"].pageUp, "down": self["AboutScrollLabel"].pageDown }) self["hidden_action"] = ActionMap(["ColorActions"], { "red": self.red_action, "blue": self.blue_action, "info": self.info_action, "1": self.first_action, "2": self.second_action, "3": self.third_action, },-1) self.key_status = -1
def getAboutText(): AboutText = '' AboutText += _('Model:\t%s %s\n') % (getMachineBrand(), getMachineName()) if path.exists('/proc/stb/info/chipset'): AboutText += _('Chipset:\t%s') % about.getChipSetString() + '\n' cpuMHz = '' if path.exists('/proc/cpuinfo'): f = open('/proc/cpuinfo', 'r') temp = f.readlines() f.close() try: for lines in temp: lisp = lines.split(': ') if lisp[0].startswith('cpu MHz'): cpuMHz = ' (' + str(int(float(lisp[1].replace( '\n', '')))) + ' MHz)' break except: pass AboutText += _('CPU:\t%s') % about.getCPUString() + cpuMHz + '\n' AboutText += _('Cores:\t%s') % about.getCpuCoresString() + '\n' AboutText += _('Version:\t%s') % getImageVersion() + '\n' AboutText += _('Build:\t%s') % getImageBuild() + '\n' AboutText += _('Kernel:\t%s') % about.getKernelVersionString() + '\n' string = getDriverDate() year = string[0:4] month = string[4:6] day = string[6:8] driversdate = '-'.join((year, month, day)) AboutText += _('Drivers:\t%s') % driversdate + '\n' AboutText += _('GStreamer:\t%s') % about.getGStreamerVersionString() + '\n' AboutText += _('Python:\t%s') % about.getPythonVersionString() + '\n' AboutText += _('Installed:\t%s') % about.getFlashDateString() + '\n' AboutText += _('Last update:\t%s') % getEnigmaVersionString() + '\n' fp_version = getFPVersion() if fp_version is None: fp_version = '' elif fp_version != 0: fp_version = _('Frontprocessor version: %s') % fp_version AboutText += fp_version + '\n' tempinfo = '' if path.exists('/proc/stb/sensors/temp0/value'): f = open('/proc/stb/sensors/temp0/value', 'r') tempinfo = f.read() f.close() elif path.exists('/proc/stb/fp/temp_sensor'): f = open('/proc/stb/fp/temp_sensor', 'r') tempinfo = f.read() f.close() if tempinfo and int(tempinfo.replace('\n', '')) > 0: mark = str('\xc2\xb0') AboutText += _('System temperature:\t%s') % tempinfo.replace( '\n', '').replace(' ', '') + mark + 'C\n' tempinfo = '' if path.exists('/proc/stb/fp/temp_sensor_avs'): f = open('/proc/stb/fp/temp_sensor_avs', 'r') tempinfo = f.read() f.close() if tempinfo and int(tempinfo.replace('\n', '')) > 0: mark = str('\xc2\xb0') AboutText += _('Processor temperature:\t%s') % tempinfo.replace( '\n', '').replace(' ', '') + mark + 'C\n' AboutLcdText = AboutText.replace('\t', ' ') return (AboutText, AboutLcdText)
def imageInfo(self): AboutText = _("Full Image Backup ") AboutText += _("By Bh Team") + "\n" AboutText += _("Support at") + " www.vuplus-community.net\n\n" AboutText += _("[Image Info]\n") AboutText += _("Model: %s %s\n") % (getMachineBrand(), getMachineName()) AboutText += _("Backup Date: %s\n") % strftime("%Y-%m-%d", localtime(self.START)) if path.exists('/proc/stb/info/chipset'): AboutText += _("Chipset: BCM%s") % about.getChipSetString().lower().replace('\n','').replace('bcm','') + "\n" AboutText += _("CPU: %s") % about.getCPUString() + "\n" AboutText += _("Cores: %s") % about.getCpuCoresString() + "\n" AboutText += _("Version: %s") % getImageVersion() + "\n" AboutText += _("Build: %s") % getImageBuild() + "\n" AboutText += _("Kernel: %s") % about.getKernelVersionString() + "\n" string = getDriverDate() year = string[0:4] month = string[4:6] day = string[6:8] driversdate = '-'.join((year, month, day)) AboutText += _("Drivers:\t%s") % driversdate + "\n" AboutText += _("Last update:\t%s") % getEnigmaVersionString() + "\n\n" AboutText += _("[Enigma2 Settings]\n") AboutText += commands.getoutput("cat /etc/enigma2/settings") AboutText += _("\n\n[User - bouquets (TV)]\n") try: f = open("/etc/enigma2/bouquets.tv","r") lines = f.readlines() f.close() for line in lines: if line.startswith("#SERVICE:"): bouqet = line.split() if len(bouqet) > 3: bouqet[3] = bouqet[3].replace('"','') f = open("/etc/enigma2/" + bouqet[3],"r") userbouqet = f.readline() AboutText += userbouqet.replace('#NAME ','') f.close() except: AboutText += "Error reading bouquets.tv" AboutText += _("\n[User - bouquets (RADIO)]\n") try: f = open("/etc/enigma2/bouquets.radio","r") lines = f.readlines() f.close() for line in lines: if line.startswith("#SERVICE:"): bouqet = line.split() if len(bouqet) > 3: bouqet[3] = bouqet[3].replace('"','') f = open("/etc/enigma2/" + bouqet[3],"r") userbouqet = f.readline() AboutText += userbouqet.replace('#NAME ','') f.close() except: AboutText += "Error reading bouquets.radio" AboutText += _("\n[Installed Plugins]\n") AboutText += commands.getoutput("opkg list_installed | grep enigma2-plugin-") return AboutText
def __init__(self, session): Screen.__init__(self, session) self.setTitle(_("About")) OpenNFRVersion = _("OpenNFR %s") % about.getImageVersionString() self["OpenNFRVersion"] = Label(OpenNFRVersion) AboutText = _("Model:\t\t%s %s\n") % (getMachineBrand(), getMachineName()) bootloader = "" if path.exists('/sys/firmware/devicetree/base/bolt/tag'): f = open('/sys/firmware/devicetree/base/bolt/tag', 'r') bootloader = f.readline().replace('\x00', '').replace('\n', '') f.close() AboutText += _("Bootloader:\t\t%s\n") % (bootloader) if path.exists('/proc/stb/info/chipset'): AboutText += _( "Chipset:\t\tBCM%s") % about.getChipSetString() + "\n" cpuMHz = "" if getMachineBuild() in ('u41', 'u42', 'u43'): cpuMHz = _(" (1.0 GHz)") elif getMachineBuild() in ('dags72604', 'vusolo4k', 'vuultimo4k', 'vuzero4k', 'gb72604'): cpuMHz = " (1,5 GHz)" elif getMachineBuild() in ('formuler1', 'triplex'): cpuMHz = " (1,3 GHz)" elif getMachineBuild() in ('gbmv200', 'u51', 'u5', 'u53', 'u52', 'u54', 'u55', 'u56', 'u5pvr', 'h9', 'h9combo', 'cc1', 'sf8008', '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 })