def __init__(self, session, parent): Screen.__init__(self, session, parent=parent) self['selected'] = StaticText('MediaSat:' + getImageVersion()) AboutText = _('Model: %s %s\n') % (getMachineBrand(), getMachineName()) if path.exists('/proc/stb/info/chipset'): chipset = open('/proc/stb/info/chipset', 'r').read() AboutText += _('Chipset: BCM%s') % chipset.replace('\n', '') + '\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: %s') % driversdate + '\n' AboutText += _('Last update: %s') % getEnigmaVersionString() + '\n\n' tempinfo = '' if path.exists('/proc/stb/sensors/temp0/value'): tempinfo = open('/proc/stb/sensors/temp0/value', 'r').read() elif path.exists('/proc/stb/fp/temp_sensor'): tempinfo = open('/proc/stb/fp/temp_sensor', 'r').read() if tempinfo and int(tempinfo.replace('\n', '')) > 0: mark = str('\xc2\xb0') AboutText += _('System temperature: %s') % tempinfo.replace('\n', '') + mark + 'C\n\n' self['AboutText'] = StaticText(AboutText)
def __init__(self, session, parent): Screen.__init__(self, session, parent=parent) self["selected"] = StaticText("ViX:" + getImageVersion()) AboutText = _("Model: %s %s\n") % (getMachineBrand(), getMachineName()) if path.exists('/proc/stb/info/chipset'): chipset = open('/proc/stb/info/chipset', 'r').read() AboutText += _("Chipset: BCM%s") % chipset.replace('\n', '') + "\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: %s") % driversdate + "\n" AboutText += _("Last update: %s") % getEnigmaVersionString() + "\n\n" tempinfo = "" if path.exists('/proc/stb/sensors/temp0/value'): tempinfo = open('/proc/stb/sensors/temp0/value', 'r').read() elif path.exists('/proc/stb/fp/temp_sensor'): tempinfo = open('/proc/stb/fp/temp_sensor', 'r').read() if tempinfo and int(tempinfo.replace('\n', '')) > 0: mark = str('\xc2\xb0') AboutText += _("System temperature: %s") % tempinfo.replace('\n', '') + mark + "C\n\n" self["AboutText"] = StaticText(AboutText)
def startCmd(self, cmd, args = None): if cmd == self.CMD_UPDATE: if getImageVersion() == '4.0': if os.path.exists('/var/lib/opkg/lists'): rmtree('/var/lib/opkg/lists') else: for fn in os.listdir('/var/lib/opkg'): if fn.startswith(getImageDistro()): os.remove('/var/lib/opkg/'+fn) self.runCmdEx("update") elif cmd == self.CMD_UPGRADE: append = "" if args["test_only"]: append = " -test" if len(self.excludeList) > 0: for x in self.excludeList: print"[IPKG] exclude Package (hold): '%s'" % x[0] os.system("opkg flag hold " + x[0]) self.runCmdEx("upgrade" + append) elif cmd == self.CMD_LIST: self.fetchedList = [] self.excludeList = [] if args['installed_only']: self.runCmdEx("list_installed") else: self.runCmd("list") elif cmd == self.CMD_INSTALL: self.runCmd("--force-overwrite install " + args['package']) elif cmd == self.CMD_REMOVE: self.runCmd("remove " + args['package']) elif cmd == self.CMD_UPGRADE_LIST: self.fetchedList = [] self.excludeList = [] self.runCmd("list-upgradable") self.setCurrentCommand(cmd)
def __init__(self, session, request): WebScreen.__init__(self, session, request) from WebComponents.Sources.About import About from WebComponents.Sources.Frontend import Frontend from WebComponents.Sources.Hdd import Hdd from WebComponents.Sources.Network import Network from Components.config import config from Components.About import about from Components.Sources.StaticText import StaticText try: from Tools.StbHardware import getFPVersion except: from Tools.DreamboxHardware import getFPVersion from Tools.HardwareInfo import HardwareInfo hw = HardwareInfo() self["About"] = About(session) self["Network"] = Network() self["Hdd"] = Hdd() self["Frontends"] = Frontend() try: from enigma import getEnigmaVersionString from boxbranding import getImageVersion, getImageBuild self["EnigmaVersion"] = StaticText(getEnigmaVersionString()) self["ImageVersion"] = StaticText(getImageVersion() + '.' + getImageBuild()) except: self["EnigmaVersion"] = StaticText(about.getEnigmaVersionString()) self["ImageVersion"] = StaticText(about.getVersionString()) self["WebIfVersion"] = StaticText(config.plugins.Webinterface.version.value) self["FpVersion"] = StaticText(str(getFPVersion())) self["DeviceName"] = StaticText(hw.get_device_name())
def __init__(self, session, updatebackup=False): Screen.__init__(self, session) self.Console = Console() self.BackupDevice = config.imagemanager.backuplocation.value print "[ImageManager] Device: " + self.BackupDevice self.BackupDirectory = config.imagemanager.backuplocation.value + 'imagebackups/' print "[ImageManager] Directory: " + self.BackupDirectory self.BackupDate = getImageVersion() + '.' + getImageBuild() + '-' + strftime('%Y%m%d_%H%M%S', localtime()) self.WORKDIR = self.BackupDirectory + config.imagemanager.folderprefix.value + '-temp' self.TMPDIR = self.BackupDirectory + config.imagemanager.folderprefix.value + '-mount' if updatebackup: self.MAINDESTROOT = self.BackupDirectory + config.imagemanager.folderprefix.value + '-SoftwareUpdate-' + self.BackupDate else: self.MAINDESTROOT = self.BackupDirectory + config.imagemanager.folderprefix.value + '-' + self.BackupDate self.kernelMTD = getMachineMtdKernel() self.kernelFILE = getMachineKernelFile() self.rootMTD = getMachineMtdRoot() self.rootFILE = getMachineRootFile() self.MAINDEST = self.MAINDESTROOT + '/' + getImageFolder() + '/' print 'MTD: Kernel:',self.kernelMTD print 'MTD: Root:',self.rootMTD if getImageFileSystem() == 'ubi': self.ROOTFSTYPE = 'ubifs' else: self.ROOTFSTYPE= 'jffs2' self.swapdevice = "" self.RamChecked = False self.SwapCreated = False self.Stage1Completed = False self.Stage2Completed = False self.Stage3Completed = False self.Stage4Completed = False self.Stage5Completed = False
def __init__(self, session, distro): Screen.__init__(self, session) self.session = session ImageVersion = getImageVersion() Screen.setTitle(self, _('NFR4XBoot - Download Image')) self['key_green'] = Button(_('Install')) self['key_red'] = Button(_('Exit')) self.filename = None self.imagelist = [] self.simulate = False self.imagePath = '/media/nfr4xboot/NFR4XBootUpload' self.distro = distro if self.distro == 'opennfr': self.feed = 'opennfr' self.feedurl = 'http://dev.nachtfalke.biz/nfr/feeds/%s/images' %ImageVersion elif self.distro == 'openatv-5.1': self.feed = 'openatv' self.feedurl = 'http://images.mynonpublic.com/openatv/5.1' elif self.distro == 'openvix': self.feed = 'openvix' self.feedurl = 'http://www.openvix.co.uk/openvix-builds' else: self.feed = 'opennfr' self.feedurl = 'http://dev.nachtfalke.biz/nfr/feeds/5.1/images' self['imageList'] = MenuList(self.imagelist) self['actions'] = ActionMap(['OkCancelActions', 'ColorActions'], {'green': self.green, 'red': self.quit, 'cancel': self.quit}, -2) self.onLayoutFinish.append(self.layoutFinished) return
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 += _("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 __init__(self, session, parent): Screen.__init__(self, session, parent=parent) self["selected"] = StaticText("Miraclebox:" + getImageVersion()) AboutText = getAboutText()[1] self["AboutText"] = StaticText(AboutText)
def getlog(self): global ocram try: sourcefile = 'http://feeds.italysat.eu/' + getImageVersion() + getBoxType() + '/' + self.logtype + '-git.log' sourcefile,headers = urllib.urlretrieve(sourcefile) rename(sourcefile,'/tmp/' + self.logtype + '-git.log') fd = open('/tmp/' + self.logtype + '-git.log', 'r') releasenotes = fd.read() fd.close() except: releasenotes = '404 Not Found' if '404 Not Found' not in releasenotes: releasenotes = releasenotes.replace('[italysat] 7.0 Release.', 'italysat: build 000') releasenotes = releasenotes.replace('\nitalysat: build',"\n\nitalysat: build") releasenotes = releasenotes.split('\n\n') ver = -1 releasever = "" viewrelease = "" while not releasever.isdigit(): ver += 1 releasever = releasenotes[int(ver)].split('\n') releasever = releasever[0].split(' ') if len(releasever) > 2: releasever = releasever[2].replace(':',"") else: releasever = releasever[0].replace(':',"") if self.logtype == 'oe': if int(getImageBuild()) == 1: imagever = int(getImageBuild())-1 else: imagever = int(getImageBuild()) else: imagever = int(getImageBuild())+905 while int(releasever) > int(imagever): if ocram: viewrelease += releasenotes[int(ver)]+'\n'+ocram+'\n' ocram = "" else: viewrelease += releasenotes[int(ver)]+'\n\n' ver += 1 releasever = releasenotes[int(ver)].split('\n') releasever = releasever[0].split(' ') releasever = releasever[2].replace(':',"") if not viewrelease and ocram: viewrelease = ocram ocram = "" self["text"].setText(viewrelease) summarytext = viewrelease.split(':\n') try: self['title_summary'].setText(summarytext[0]+':') self['text_summary'].setText(summarytext[1]) except: self['title_summary'].setText("") self['text_summary'].setText(viewrelease) else: self['title_summary'].setText("") self['text_summary'].setText(_("Error downloading change log.")) self['text'].setText(_("Error downloading change log."))
def __init__(self, session, distro): Screen.__init__(self, session) self.session = session ImageVersion = getImageVersion() Screen.setTitle(self, _('NFR4XBoot - Download Image')) self['key_green'] = Button(_('Install')) self['key_red'] = Button(_('Exit')) self.filename = None self.imagelist = [] self.simulate = False self.imagePath = '/media/nfr4xboot/NFR4XBootUpload' self.distro = distro if self.distro == 'egami': self.feed = 'egami' self.feedurl = 'http://image.egami-image.com' elif self.distro == 'opennfr': self.feed = 'opennfr' self.feedurl = 'http://dev.nachtfalke.biz/nfr/feeds/%s/images' %ImageVersion elif self.distro == 'openatv': self.feed = 'openatv' self.feedurl = 'http://images.mynonpublic.com/openatv/4.2' elif self.distro == 'openatv-5.0': self.feed = 'openatv' self.feedurl = 'http://images.mynonpublic.com/openatv/5.0' elif self.distro == 'openatv-5.1': self.feed = 'openatv' self.feedurl = 'http://images.mynonpublic.com/openatv/5.1' elif self.distro == 'openvix': self.feed = 'openvix' self.feedurl = 'http://www.openvix.co.uk' elif self.distro == 'opendroid': self.feed = 'opendroid' self.feedurl = 'http://images.opendroid.org/5.0/' elif self.distro == 'openpli': self.feed = 'openpli' self.feedurl = 'http://openpli.org/download' elif self.distro == 'atemio4you': self.feed = 'atemio4you' self.feedurl = 'http://nightly.atemio4you.com/2.3/image' elif self.distro == 'openhdf': self.feed = 'openhdf' self.feedurl1 = 'http://images.hdfreaks.cc' self.feedurl = 'http://images.hdfreaks.cc/menu.html' elif self.distro == 'openmips': self.feed = 'openmips' self.feedurl = 'http://image.openmips.com/4.2' elif self.distro == 'custom': self.feed = 'custom' self.feedurl = 'http://feed.yt/bre2ze/image/' else: self.feed = 'opennfr' self.feedurl = 'http://dev.nachtfalke.biz/nfr/feeds/5.1/images' self['imageList'] = MenuList(self.imagelist) self['actions'] = ActionMap(['OkCancelActions', 'ColorActions'], {'green': self.green, 'red': self.quit, 'cancel': self.quit}, -2) self.onLayoutFinish.append(self.layoutFinished) 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 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 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 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): self["lab1"] = StaticText(_("OpenHDF")) self["lab2"] = StaticText(_("By HDF Image Team")) self["lab3"] = StaticText(_("Support at") + " www.HDFreaks.cc") model = None AboutText = "" self["lab3"] = StaticText(_("Support at") + " 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" AboutText += _("CPU:\t%s") % about.getCPUString() + "\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\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 doBackup4(self): print '[ImageManager] Stage4: Moving from work to backup folders' move('%s/rootfs.%s' % (self.WORKDIR, self.ROOTFSTYPE), '%s/%s' % (self.MAINDEST, self.rootFILE)) if self.ROOTFSTYPE == 'tar.bz2' and path.exists('%s/vmlinux.tar.bz2' % self.WORKDIR): move('%s/vmlinux.tar.bz2' % self.WORKDIR, '%s/%s' % (self.MAINDEST, self.kernelFILE)) else: move('%s/vmlinux.gz' % self.WORKDIR, '%s/%s' % (self.MAINDEST, self.kernelFILE)) fileout = open(self.MAINDEST + '/imageversion', 'w') line = defaultprefix + '-' + getImageType() + '-backup-' + getImageVersion() + '.' + getImageBuild() + '-' + self.BackupDate fileout.write(line) fileout.close() if getBrandOEM() == 'vuplus': if getMachineBuild() == 'vuzero': fileout = open(self.MAINDEST + '/force.update', 'w') line = "This file forces the update." fileout.write(line) fileout.close() else: fileout = open(self.MAINDEST + '/reboot.update', 'w') line = "This file forces a reboot after the update." fileout.write(line) fileout.close() imagecreated = True elif getBrandOEM() in ('xtrend', 'gigablue', 'odin', 'xp', 'ini'): if getBrandOEM() in ('xtrend', 'odin', 'ini'): fileout = open(self.MAINDEST + '/noforce', 'w') line = "rename this file to 'force' to force an update without confirmation" fileout.write(line) fileout.close() if path.exists('/usr/lib/enigma2/python/Plugins/SystemPlugins/ViX/burn.bat'): copy('/usr/lib/enigma2/python/Plugins/SystemPlugins/ViX/burn.bat', self.MAINDESTROOT + '/burn.bat') print '[ImageManager] Stage4: Removing Swap.' if path.exists(self.swapdevice + config.imagemanager.folderprefix.value + '-' + getImageType() + "-swapfile_backup"): system('swapoff ' + self.swapdevice + config.imagemanager.folderprefix.value + '-' + getImageType() + "-swapfile_backup") remove(self.swapdevice + config.imagemanager.folderprefix.value + '-' + getImageType() + "-swapfile_backup") if path.exists(self.WORKDIR): rmtree(self.WORKDIR) if path.exists(self.MAINDEST + '/' + self.rootFILE) and path.exists(self.MAINDEST + '/' + self.kernelFILE): for root, dirs, files in walk(self.MAINDEST): for momo in dirs: chmod(path.join(root, momo), 0644) for momo in files: chmod(path.join(root, momo), 0644) print '[ImageManager] Stage4: Image created in ' + self.MAINDESTROOT self.Stage4Complete() else: print "[ImageManager] Stage4: Image creation failed - e. g. wrong backup destination or no space left on backup device" self.BackupComplete()
def __init__(self): aboutInfo = getImageVersion() if aboutInfo.startswith("dev-"): self.ImageVersion = 'Experimental' else: self.ImageVersion = 'Stable' self.language = language.getLanguage()[:2] # getLanguage returns e.g. "fi_FI" for "language_country" PackageInfoHandler.__init__(self, self.statusCallback, blocking=False, neededTag='ALL_TAGS', neededFlag=self.ImageVersion) self.directory = resolveFilename(SCOPE_METADIR) self.list = List([]) self.NotifierCallback = None self.Console = Console() self.UpdateConsole = Console() self.cmdList = [] self.unwanted_extensions = ('-dbg', '-dev', '-doc', '-staticdev', '-src') self.ipkg = IpkgComponent() self.ipkg.addCallback(self.ipkgCallback)
def getLatestImageTimestamp(self): url = "http://images.teamblue.tech/status/%s-%s/buildtimestamp-%s" % (getImageVersion(), getImageType(), getBoxType()) # print "[SoftwareUpdate] url buildtimestamp: ", url try: # TODO: Use Twisted's URL fetcher, urlopen is evil. And it can # run in parallel to the package update. from time import strftime from datetime import datetime try: latestImageTimestamp = datetime.fromtimestamp(int(urlopen(url, timeout=5).read())).strftime(_("%Y-%m-%d %H:%M")) except: # bypass the certificate check from ssl import _create_unverified_context latestImageTimestamp = datetime.fromtimestamp(int(urlopen(url, timeout=5, context=_create_unverified_context()).read())).strftime(_("%Y-%m-%d %H:%M")) except: latestImageTimestamp = "" print "[SoftwareUpdate] latestImageTimestamp:", latestImageTimestamp return latestImageTimestamp
def __init__(self, session, args = 0): Screen.__init__(self, session) self.session = session self.MODEL = getBoxType() self.OEM = getBrandOEM() self.MACHINEBUILD = getMachineBuild() self.MACHINENAME = getMachineName() self.MACHINEBRAND = getMachineBrand() self.IMAGEFOLDER = getImageFolder() self.HDFIMAGEVERSION = getImageVersion() self.HDFIMAGEBUILD = getImageBuild() self.UBINIZE_ARGS = getMachineUBINIZE() self.MKUBIFS_ARGS = getMachineMKUBIFS() self.MTDKERNEL = getMachineMtdKernel() self.ROOTFSBIN = getMachineRootFile() self.KERNELBIN = getMachineKernelFile() self.ROOTFSTYPE = getImageFileSystem() print "[FULL BACKUP] BOX MACHINEBUILD = >%s<" %self.MACHINEBUILD print "[FULL BACKUP] BOX MACHINENAME = >%s<" %self.MACHINENAME print "[FULL BACKUP] BOX MACHINEBRAND = >%s<" %self.MACHINEBRAND print "[FULL BACKUP] BOX MODEL = >%s<" %self.MODEL print "[FULL BACKUP] OEM MODEL = >%s<" %self.OEM print "[FULL BACKUP] IMAGEFOLDER = >%s<" %self.IMAGEFOLDER print "[FULL BACKUP] UBINIZE = >%s<" %self.UBINIZE_ARGS print "[FULL BACKUP] MKUBIFS = >%s<" %self.MKUBIFS_ARGS print "[FULL BACKUP] MTDKERNEL = >%s<" %self.MTDKERNEL print "[FULL BACKUP] ROOTFSTYPE = >%s<" %self.ROOTFSTYPE self["key_green"] = Button("USB") self["key_red"] = Button("HDD") self["key_blue"] = Button(_("Exit")) self["key_yellow"] = Button("") self["info-usb"] = Label(_("USB = Do you want to make a back-up on USB?\nThis will take between 4 and 15 minutes depending on the used filesystem and is fully automatic.\nMake sure you first insert an USB flash drive before you select USB.")) self["info-hdd"] = Label(_("HDD = Do you want to make an USB-back-up image on HDD? \nThis only takes 2 or 10 minutes and is fully automatic.")) self["actions"] = ActionMap(["OkCancelActions", "ColorActions"], { "blue": self.quit, "yellow": self.yellow, "green": self.green, "red": self.red, "cancel": self.quit, }, -2)
def checkTraficLight(self): self.activityTimer.callback.remove(self.checkTraficLight) self.activityTimer.start(100, False) currentTimeoutDefault = socket.getdefaulttimeout() socket.setdefaulttimeout(3) message = "" picon = None default = True try: # TODO: Use Twisted's URL fetcher, urlopen is evil. And it can # run in parallel to the package update. url = "http://image.openmips.com/status/%s/" % (getImageVersion()) try: status = urlopen(url, timeout=5).read().split('!', 1) print status except: # bypass the certificate check from ssl import _create_unverified_context status = urlopen(url, timeout=5, context=_create_unverified_context()).read().split('!', 1) print status # prefer getMachineBuild if getMachineBuild() in status[0].split(','): message = len(status) > 1 and status[1] or _("The current software might not be stable.\nFor more information see %s.") % ("http://image.openmips.com") picon = MessageBox.TYPE_ERROR default = False # only use getBoxType if no getMachineBuild elif getBoxType() in status[0].split(','): message = len(status) > 1 and status[1] or _("The current software might not be stable.\nFor more information see %s.") % ("http://image.openmips.com") picon = MessageBox.TYPE_ERROR default = False except: message = _("The status of the current software could not be checked because %s can not be reached.") % ("http://image.openmips.com") picon = MessageBox.TYPE_ERROR default = False socket.setdefaulttimeout(currentTimeoutDefault) if default: self.showDisclaimer() else: message += "\n" + _("Do you want to update your receiver?") self.session.openWithCallback(self.startActualUpdate, MessageBox, message, default = default, picon = picon)
def setMenu(self): self.menulist = [] try: latest_release = "Release %s (Opendreambox 1.5)" % self.feedlists[RELEASE][0][0][-9:-4] self.menulist.append((RELEASE, _("Get latest release image"), _("Download %s from server" ) % latest_release, None)) except IndexError: pass try: dat = self.feedlists[EXPERIMENTAL][0][0][-12:-4] latest_experimental = "Experimental %s-%s-%s (Opendreambox 1.6)" % (dat[:4], dat[4:6], dat[6:]) self.menulist.append((EXPERIMENTAL, _("Get latest experimental image"), _("Download %s from server") % latest_experimental, None)) except IndexError: pass self.menulist.append((ALLIMAGES, _("Select an image to be downloaded"), _("Select desired image from feed list" ), None)) self.menulist.append((STICK_WIZARD, _("USB stick wizard"), _("Prepare another USB stick for image flashing" ), None)) self["menu"].setList(self.menulist) self["status"].text = _("Currently installed image") + ": %s" % (getImageVersion()) self.branch = START self.updateButtons()
def getLatestImageTimestamp(self): currentTimeoutDefault = socket.getdefaulttimeout() socket.setdefaulttimeout(3) try: # TODO: Use Twisted's URL fetcher, urlopen is evil. And it can # run in parallel to the package update. from time import strftime from datetime import datetime url = "http://image.openmips.com/%s/%s/build-timestamp" % (getImageVersion(), getBoxType()) try: latestImageTimestamp = datetime.fromtimestamp(int(urlopen(url, timeout=5).read())).strftime(_("%Y-%m-%d %H:%M")) except: # bypass the certificate check from ssl import _create_unverified_context latestImageTimestamp = datetime.fromtimestamp(int(urlopen(url, timeout=5, context=_create_unverified_context()).read())).strftime(_("%Y-%m-%d %H:%M")) except: latestImageTimestamp = "" print latestImageTimestamp print "[SoftwareUpdate] latestImageTimestamp:", latestImageTimestamp socket.setdefaulttimeout(currentTimeoutDefault) return latestImageTimestamp
def enumPlugins(filter_start=''): for feed in enumFeeds(): package = None try: if getImageVersion() == '4.0': file = open('/var/lib/opkg/lists/%s' % feed, 'r') else: file = open('/var/lib/opkg/%s' % feed, 'r') for line in file: if line.startswith('Package:'): package = line.split(":",1)[1].strip() version = '' description = '' if package.startswith(filter_start) and not package.endswith('-dev') and not package.endswith('-staticdev') and not package.endswith('-dbg') and not package.endswith('-doc') and not package.endswith('-src'): continue package = None if package is None: continue if line.startswith('Version:'): version = line.split(":",1)[1].strip() elif line.startswith('Description:'): description = line.split(":",1)[1].strip() elif description and line.startswith(' '): description += line[:-1] elif len(line) <= 1: d = description.split(' ',3) if len(d) > 3: # Get rid of annoying "version" and package repeating strings if d[1] == 'version': description = d[3] if description.startswith('gitAUTOINC'): description = description.split(' ',1)[1] yield package, version, description.strip() package = None file.close() except IOError: pass
def __init__(self, session): Screen.__init__(self, session) Screen.setTitle(self, _('Memory Information')) self.skinName = ['SystemMemoryInfo', 'About'] self['lab1'] = StaticText(_('Version:\t%s') % getImageVersion() + _(' %s') % getImageBuild()) self['lab2'] = StaticText(_('By REDOUANE')) self['AboutScrollLabel'] = ScrollLabel() self['actions'] = ActionMap(['SetupActions', 'ColorActions'], {'cancel': self.close, 'ok': self.close}) out_lines = file('/proc/meminfo').readlines() self.AboutText = _('RAM') + '\n\n' RamTotal = '-' RamFree = '-' for lidx in range(len(out_lines) - 1): tstLine = out_lines[lidx].split() if 'MemTotal:' in tstLine: MemTotal = out_lines[lidx].split() self.AboutText += _('Total Memory:') + '\t' + MemTotal[1] + '\n' if 'MemFree:' in tstLine: MemFree = out_lines[lidx].split() self.AboutText += _('Free Memory:') + '\t' + MemFree[1] + '\n' if 'Buffers:' in tstLine: Buffers = out_lines[lidx].split() self.AboutText += _('Buffers:') + '\t' + Buffers[1] + '\n' if 'Cached:' in tstLine: Cached = out_lines[lidx].split() self.AboutText += _('Cached:') + '\t' + Cached[1] + '\n' if 'SwapTotal:' in tstLine: SwapTotal = out_lines[lidx].split() self.AboutText += _('Total Swap:') + '\t' + SwapTotal[1] + '\n' if 'SwapFree:' in tstLine: SwapFree = out_lines[lidx].split() self.AboutText += _('Free Swap:') + '\t' + SwapFree[1] + '\n\n' self['actions'].setEnabled(False) self.Console = Console() self.Console.ePopen("df -mh / | grep -v '^Filesystem'", self.Stage1Complete)
class ItalyGreen(Screen): skin = '\n\t<screen name="ItalyGreen" position="center,center" size="1017,549" title="ItalySat Green Panel">\n\t\t <widget source="list" render="Listbox" position="16,3" scrollbarMode="showOnDemand" size="989,429">\n\t\t <convert type="TemplatedMultiContent">\n\t\t {"template": [\n\t\t MultiContentEntryText(pos = (125, 0), size = (650, 24), font=0, text = 0),\n\t\t MultiContentEntryText(pos = (125, 24), size = (650, 24), font=1, text = 1),\n\t\t MultiContentEntryPixmapAlphaTest(pos = (6, 5), size = (100, 40), png = 2),\n\t\t ],\n\t\t "fonts": [gFont("Regular", 24),gFont("Regular", 20)],\n\t\t "itemHeight": 52\n\t\t }\n\t\t </convert>\n\t\t </widget>\n\t\t <widget name="conn" position="17,465" size="983,40" font="Regular;20" halign="center" valign="center" zPosition="2" foregroundColor="red" />\n\t\t <ePixmap alphatest="blend" pixmap="skin_default/buttons/red.png" position="44,507" size="140,40" />\n\t\t <ePixmap alphatest="blend" pixmap="skin_default/buttons/green.png" position="330,506" size="140,40" />\n\t\t <ePixmap alphatest="blend" pixmap="skin_default/buttons/yellow.png" position="567,507" size="140,40" />\n\t\t <ePixmap alphatest="blend" pixmap="skin_default/buttons/blue.png" position="815,509" size="140,40" />\n\t\t <widget name="key_red" font="Regular;22" halign="left" position="44,508" size="204,40" transparent="1" zPosition="1" />\n\t\t <widget name="key_green" font="Regular;22" halign="left" position="330,508" size="140,40" transparent="1" zPosition="1" />\n\t\t <widget name="key_yellow" font="Regular;22" halign="left" position="567,508" size="179,40" transparent="1" zPosition="1" />\n\t\t <widget name="key_blue" font="Regular;22" halign="left" position="815,508" size="140,40" transparent="1" zPosition="1" />\n\t</screen>' ITALYSATVER = getImageVersion() SVNVERSION = getImageBuild() def __init__(self, session): Screen.__init__(self, session) self.list = [] self['list'] = List(self.list) self['conn'] = Label('') self['conn'].hide() self['key_red'] = Label(_('Addons Online')) self['key_green'] = Label(_('Fast Plugin')) self['key_yellow'] = Label(_('Script Manager')) self['key_blue'] = Label(_('Memory Info')) self['actions'] = ActionMap( ['WizardActions', 'ColorActions', 'NumberActions'], { 'ok': self.save, 'back': self.close, 'red': self.keyred, 'green': self.keygreen, 'yellow': self.keyyellow, 'blue': self.keyblue, '5': self.ExtraUrl, '6': self.Plugin }, -1) self.onLayoutFinish.append(self.updateList) self.onShown.append(self.setWindowTitle) def Plugin(self): from Tools.Directories import resolveFilename, SCOPE_PLUGINS plugins.readPluginList(resolveFilename(SCOPE_PLUGINS)) def setWindowTitle(self): self.setTitle('%s - %s: %s - SVN: (%s)' % (_('ItalySat'), _('Image Version'), self.ITALYSATVER, self.SVNVERSION)) def save(self): self.run() def run(self): mysel = self['list'].getCurrent() if mysel: plugin = mysel[3] plugin(session=self.session) def updateList(self): self.list = [] self.pluginlist = plugins.getPlugins(PluginDescriptor.WHERE_PLUGINMENU) for plugin in self.pluginlist: if plugin.icon is None: png = LoadPixmap( resolveFilename(SCOPE_SKIN_IMAGE, 'skin_default/icons/plugin.png')) else: png = plugin.icon res = (plugin.name, plugin.description, png, plugin) self.list.append(res) self['list'].list = self.list return def keyred(self): from ItalysatExtra import ItalyAddonsMenu self.session.open(ItalyAddonsMenu) def keyyellow(self): from ItalysatScript import ItalyScriptPanel self.session.open(ItalyScriptPanel) def keyblue(self): from ItalysatMemory import ItalyMemoryPanel self.session.open(ItalyMemoryPanel) def keygreen(self): result = '' check = False myplug = config.italysat.fp.value for plugin in self.list: result = plugin[3].name if result == myplug: runplug = plugin[3] check = True break if check == True: runplug(session=self.session) else: mybox = self.session.open( MessageBox, _('Setup Fast Plugin before to use this button.'), MessageBox.TYPE_INFO) mybox.setTitle(_('Info')) def NotYet(self): mybox = self.session.open(MessageBox, _('Function Not Yet Available'), MessageBox.TYPE_INFO) mybox.setTitle(_('Info')) def ExtraUrl(self): if fileExists('/etc/it_extra.url') or fileExists('/etc/it_extra2.url'): print 'Ok' else: extra = open('/etc/it_extra.url', 'w') line = 'http://www.italysat.allalla.com/' extra.write(line + '\n') extra.close() extra = open('/etc/it_extra2.url', 'w') line = 'http://italysat.altervista.org/' extra.write(line + '\n') extra.close()
def getlog(self): global ocram try: sourcefile = 'http://www.openvix.co.uk/feeds/%s/%s/%s-git.log' % (getImageDistro(), getImageVersion(), self.logtype) sourcefile,headers = urllib.urlretrieve(sourcefile) rename(sourcefile,'/tmp/' + self.logtype + '-git.log') fd = open('/tmp/' + self.logtype + '-git.log', 'r') releasenotes = fd.read() fd.close() except: releasenotes = '404 Not Found' if '404 Not Found' not in releasenotes: releasenotes = releasenotes.replace('[openvix] Zeus Release.', 'openvix: build 000') releasenotes = releasenotes.replace('\nopenvix: build',"\n\nopenvix: build") releasenotes = releasenotes.split('\n\n') ver = -1 releasever = "" viewrelease = "" while not releasever.isdigit(): ver += 1 releasever = releasenotes[int(ver)].split('\n') releasever = releasever[0].split(' ') if len(releasever) > 2: releasever = releasever[2].replace(':',"") else: releasever = releasever[0].replace(':',"") if self.logtype == 'oe': if int(getImageBuild()) == 1: imagever = int(getImageBuild())-1 else: imagever = int(getImageBuild()) else: imagever = int(getImageBuild())+905 while int(releasever) > int(imagever): if ocram: viewrelease += releasenotes[int(ver)]+'\n'+ocram+'\n' ocram = "" else: viewrelease += releasenotes[int(ver)]+'\n\n' ver += 1 releasever = releasenotes[int(ver)].split('\n') releasever = releasever[0].split(' ') releasever = releasever[2].replace(':',"") if not viewrelease and ocram: viewrelease = ocram ocram = "" self["text"].setText(viewrelease) summarytext = viewrelease.split(':\n') try: self['title_summary'].setText(summarytext[0]+':') self['text_summary'].setText(summarytext[1]) except: self['title_summary'].setText("") self['text_summary'].setText(viewrelease) else: self['title_summary'].setText("") self['text_summary'].setText(_("Error downloading change log.")) self['text'].setText(_("Error downloading change log."))
def getInfo(session=None, need_fullinfo=False): # TODO: get webif versione somewhere! info = {} global STATICBOXINFO if not (STATICBOXINFO is None or need_fullinfo): return STATICBOXINFO info['brand'] = getMachineBrand() info['model'] = getMachineName() info['boxtype'] = getBoxType() info['machinebuild'] = getMachineBuild() chipset = "unknown" if fileExists("/etc/.box"): f = open("/etc/.box", 'r') model = f.readline().strip().lower() f.close() if model.startswith("ufs") or model.startswith("ufc"): if model in ("ufs910", "ufs922", "ufc960"): chipset = "SH4 @266MHz" else: chipset = "SH4 @450MHz" elif model in ("topf", "tf7700hdpvr"): chipset = "SH4 @266MHz" elif model.startswith("azbox"): f = open("/proc/stb/info/model", 'r') model = f.readline().strip().lower() f.close() if model == "me": chipset = "SIGMA 8655" elif model == "minime": chipset = "SIGMA 8653" else: chipset = "SIGMA 8634" elif model.startswith("spark"): if model == "spark7162": chipset = "SH4 @540MHz" else: chipset = "SH4 @450MHz" elif fileExists("/proc/stb/info/azmodel"): f = open("/proc/stb/info/model", 'r') model = f.readline().strip().lower() f.close() if model == "me": chipset = "SIGMA 8655" elif model == "minime": chipset = "SIGMA 8653" else: chipset = "SIGMA 8634" elif fileExists("/proc/stb/info/model"): f = open("/proc/stb/info/model", 'r') model = f.readline().strip().lower() f.close() if model == "tf7700hdpvr": chipset = "SH4 @266MHz" elif model == "nbox": chipset = "STi7100 @266MHz" elif model == "arivalink200": chipset = "STi7109 @266MHz" elif model in ("adb2850", "adb2849", "dsi87"): chipset = "STi7111 @450MHz" elif model in ("sagemcom88", "esi88"): chipset = "STi7105 @450MHz" elif model.startswith("spark"): if model == "spark7162": chipset = "STi7162 @540MHz" else: chipset = "STi7111 @450MHz" elif model == "dm800": chipset = "bcm7401" info['model'] = "DM800 HD PVR" if fileExists("/proc/stb/info/chipset"): f = open("/proc/stb/info/chipset", 'r') chipset = f.readline().strip() f.close() info['chipset'] = chipset memFree = 0 for line in open("/proc/meminfo", 'r'): parts = line.split(':') key = parts[0].strip() if key == "MemTotal": info['mem1'] = parts[1].strip().replace("kB", _("kB")) elif key in ("MemFree", "Buffers", "Cached"): memFree += int(parts[1].strip().split(' ', 1)[0]) info['mem2'] = "%s %s" % (memFree, _("kB")) info['mem3'] = _("%s free / %s total") % (info['mem2'], info['mem1']) try: f = open("/proc/uptime", "rb") uptime = int(float(f.readline().split(' ', 2)[0].strip())) f.close() uptimetext = '' if uptime > 86400: d = uptime / 86400 uptime = uptime % 86400 uptimetext += '%dd ' % d uptimetext += "%d:%.2d" % (uptime / 3600, (uptime % 3600) / 60) except: uptimetext = "?" info['uptime'] = uptimetext info["webifver"] = getOpenWebifVer() info['imagedistro'] = getImageDistro() info['friendlyimagedistro'] = getFriendlyImageDistro() info['oever'] = getOEVersion() info['imagever'] = getImageVersion() ib = getImageBuild() if ib: info['imagever'] = info['imagever'] + "." + ib info['enigmaver'] = getEnigmaVersionString() info['driverdate'] = getDriverDate() info['kernelver'] = about.getKernelVersionString() try: from Tools.StbHardware import getFPVersion except ImportError: from Tools.DreamboxHardware import getFPVersion try: info['fp_version'] = getFPVersion() except: info['fp_version'] = None friendlychipsetdescription = _("Chipset") friendlychipsettext = info['chipset'].replace("bcm", "Broadcom ") if friendlychipsettext in ("7335", "7356", "7362", "73625", "7424", "7425", "7429"): friendlychipsettext = "Broadcom " + friendlychipsettext if not (info['fp_version'] is None or info['fp_version'] == 0): friendlychipsetdescription = friendlychipsetdescription + " (" + _( "Frontprocessor Version") + ")" friendlychipsettext = friendlychipsettext + " (" + str( info['fp_version']) + ")" info['friendlychipsetdescription'] = friendlychipsetdescription info['friendlychipsettext'] = friendlychipsettext info['tuners'] = [] for i in range(0, nimmanager.getSlotCount()): print "[OpenWebif] -D- tuner '%d' '%s' '%s'" % ( i, nimmanager.getNimName(i), nimmanager.getNim(i).getSlotName()) info['tuners'].append({ "name": nimmanager.getNim(i).getSlotName(), "type": nimmanager.getNimName(i) + " (" + nimmanager.getNim(i).getFriendlyType() + ")", "rec": "", "live": "" }) info['ifaces'] = [] ifaces = iNetwork.getConfiguredAdapters() for iface in ifaces: info['ifaces'].append({ "name": iNetwork.getAdapterName(iface), "friendlynic": getFriendlyNICChipSet(iface), "linkspeed": getLinkSpeed(iface), "mac": iNetwork.getAdapterAttribute(iface, "mac"), "dhcp": iNetwork.getAdapterAttribute(iface, "dhcp"), "ipv4method": getIPv4Method(iface), "ip": formatIp(iNetwork.getAdapterAttribute(iface, "ip")), "mask": formatIp(iNetwork.getAdapterAttribute(iface, "netmask")), "v4prefix": sum([ bin(int(x)).count('1') for x in formatIp( iNetwork.getAdapterAttribute(iface, "netmask")).split('.') ]), "gw": formatIp(iNetwork.getAdapterAttribute(iface, "gateway")), "ipv6": getAdapterIPv6(iface)['addr'], "ipmethod": getIPMethod(iface), "firstpublic": getAdapterIPv6(iface)['firstpublic'] }) info['hdd'] = [] for hdd in harddiskmanager.hdd: dev = hdd.findMount() if dev: stat = os.statvfs(dev) free = stat.f_bavail * stat.f_frsize / 1048576. else: free = -1 if free <= 1024: free = "%i %s" % (free, _("MB")) else: free = free / 1024. free = "%.1f %s" % (free, _("GB")) size = hdd.diskSize() * 1000000 / 1048576. if size > 1048576: size = "%.1f %s" % ((size / 1048576.), _("TB")) elif size > 1024: size = "%.1f %s" % ((size / 1024.), _("GB")) else: size = "%d %s" % (size, _("MB")) iecsize = hdd.diskSize() # Harddisks > 1000 decimal Gigabytes are labelled in TB if iecsize > 1000000: iecsize = (iecsize + 50000) // float(100000) / 10 # Omit decimal fraction if it is 0 if (iecsize % 1 > 0): iecsize = "%.1f %s" % (iecsize, _("TB")) else: iecsize = "%d %s" % (iecsize, _("TB")) # Round harddisk sizes beyond ~300GB to full tens: 320, 500, 640, 750GB elif iecsize > 300000: iecsize = "%d %s" % (((iecsize + 5000) // 10000 * 10), _("GB")) # ... be more precise for media < ~300GB (Sticks, SSDs, CF, MMC, ...): 1, 2, 4, 8, 16 ... 256GB elif iecsize > 1000: iecsize = "%d %s" % (((iecsize + 500) // 1000), _("GB")) else: iecsize = "%d %s" % (iecsize, _("MB")) info['hdd'].append({ "model": hdd.model(), "capacity": size, "labelled_capacity": iecsize, "free": free, "mount": dev, "friendlycapacity": _("%s free / %s total") % (free, size + ' ("' + iecsize + '")') }) info['shares'] = [] autofiles = ('/etc/auto.network', '/etc/auto.network_vti') for autofs in autofiles: if fileExists(autofs): method = "autofs" for line in file(autofs).readlines(): if not line.startswith('#'): # Replace escaped spaces that can appear inside credentials with underscores # Not elegant but we wouldn't want to expose credentials on the OWIF anyways tmpline = line.replace("\ ", "_") tmp = tmpline.split() if not len(tmp) == 3: continue name = tmp[0].strip() type = "unknown" if "cifs" in tmp[1]: # Linux still defaults to SMBv1 type = "SMBv1.0" settings = tmp[1].split(",") for setting in settings: if setting.startswith("vers="): type = setting.replace("vers=", "SMBv") elif "nfs" in tmp[1]: type = "NFS" # Default is r/w mode = _("r/w") settings = tmp[1].split(",") for setting in settings: if setting == "ro": mode = _("r/o") uri = tmp[2] parts = [] parts = tmp[2].split(':') if parts[0] is "": server = uri.split('/')[2] uri = uri.strip()[1:] else: server = parts[0] ipaddress = None if server: # Will fail on literal IPs try: # Try IPv6 first, as will Linux if has_ipv6: tmpaddress = None tmpaddress = getaddrinfo(server, 0, AF_INET6) if tmpaddress: ipaddress = "[" + list( tmpaddress)[0][4][0] + "]" # Use IPv4 if IPv6 fails or is not present if ipaddress is None: tmpaddress = None tmpaddress = getaddrinfo(server, 0, AF_INET) if tmpaddress: ipaddress = list(tmpaddress)[0][4][0] except: pass friendlyaddress = server if ipaddress is not None and not ipaddress == server: friendlyaddress = server + " (" + ipaddress + ")" info['shares'].append({ "name": name, "method": method, "type": type, "mode": mode, "path": uri, "host": server, "ipaddress": ipaddress, "friendlyaddress": friendlyaddress }) # TODO: fstab info['transcoding'] = False #: models transcoding feature if fileExists("/proc/stb/encoder/0/bitrate"): if os.path.exists( eEnv.resolve( '${libdir}/enigma2/python/Plugins/SystemPlugins/TransCodingSetup/plugin.pyo' ) ) or os.path.exists( eEnv.resolve( '${libdir}/enigma2/python/Plugins/SystemPlugins/TranscodingSetup/plugin.pyo' ) ) or os.path.exists( eEnv.resolve( '${libdir}/enigma2/python/Plugins/SystemPlugins/MultiTransCodingSetup/plugin.pyo' )): info['transcoding'] = True info['kinopoisk'] = False lang = ['ru', 'uk', 'lv', 'lt', 'et'] current_language = language.getLanguage() for l in lang: if l in current_language: info['kinopoisk'] = True break info['EX'] = '' if session: try: recs = NavigationInstance.instance.getRecordings() if recs: # only one stream and only TV from Plugins.Extensions.OpenWebif.controllers.stream import streamList s_name = '' s_cip = '' print "[OpenWebif] -D- streamList count '%d'" % len(streamList) if len(streamList) == 1: from Screens.ChannelSelection import service_types_tv from enigma import eEPGCache epgcache = eEPGCache.getInstance() serviceHandler = eServiceCenter.getInstance() services = serviceHandler.list( eServiceReference('%s ORDER BY name' % (service_types_tv))) channels = services and services.getContent("SN", True) s = streamList[0] srefs = s.ref.toString() for channel in channels: if srefs == channel[0]: s_name = channel[1] + ' (' + s.clientIP + ')' break print "[OpenWebif] -D- s_name '%s'" % s_name for stream in streamList: srefs = stream.ref.toString() print "[OpenWebif] -D- srefs '%s'" % srefs sname = '' timers = [] for timer in NavigationInstance.instance.RecordTimer.timer_list: if timer.isRunning() and not timer.justplay: timers.append( timer.service_ref.getServiceName().replace( '\xc2\x86', '').replace('\xc2\x87', '')) print "[OpenWebif] -D- timer '%s'" % timer.service_ref.getServiceName( ) # only one recording if len(timers) == 1: sname = timers[0] if sname == '' and s_name != '': sname = s_name print "[OpenWebif] -D- recs count '%d'" % len(recs) for rec in recs: feinfo = rec.frontendInfo() frontendData = feinfo and feinfo.getAll(True) if frontendData is not None: cur_info = feinfo.getTransponderData(True) if cur_info: nr = frontendData['tuner_number'] info['tuners'][nr]['rec'] = getOrbitalText( cur_info) + ' / ' + sname service = session.nav.getCurrentService() if service is not None: sname = service.info().getName() feinfo = service.frontendInfo() frontendData = feinfo and feinfo.getAll(True) if frontendData is not None: cur_info = feinfo.getTransponderData(True) if cur_info: nr = frontendData['tuner_number'] info['tuners'][nr]['live'] = getOrbitalText( cur_info) + ' / ' + sname except Exception, error: info['EX'] = error
from Components.SystemInfo import SystemInfo from Components.Label import Label from Components.ActionMap import ActionMap from Components.About import about from Components import Harddisk from Components.ChoiceList import ChoiceList, ChoiceEntryComponent from Screens.Console import Console from Screens.ChoiceBox import ChoiceBox from Screens.MessageBox import MessageBox from time import time, strftime, localtime from Tools.BoundFunction import boundFunction from Tools.Multiboot import GetImagelist, GetCurrentImage, GetCurrentImageMode, GetBoxName import os, commands, datetime from boxbranding import getMachineBrand, getMachineName, getDriverDate, getImageVersion, getImageBuild, getBrandOEM, getMachineBuild, getImageFolder, getMachineUBINIZE, getMachineMKUBIFS, getMachineMtdKernel, getMachineMtdRoot, getMachineKernelFile, getMachineRootFile, getImageFileSystem, getImageDistro, getImageVersion VERSION = _('Version') + ' %s %s images' % (getImageVersion(), getImageDistro()) class ImageBackup(Screen): skin = """ <screen name="Image Backup" position="center,center" size="750,900" flags="wfNoBorder" backgroundColor="transparent"> <eLabel name="b" position="0,0" size="750,700" backgroundColor="#00ffffff" zPosition="-2" /> <eLabel name="a" position="1,1" size="748,698" backgroundColor="#00000000" zPosition="-1" /> <widget source="Title" render="Label" position="60,10" foregroundColor="#00ffffff" size="480,50" halign="left" font="Regular; 28" backgroundColor="#00000000" /> <eLabel name="line" position="1,60" size="748,1" backgroundColor="#00ffffff" zPosition="1" /> <eLabel name="line2" position="1,250" size="748,4" backgroundColor="#00ffffff" zPosition="1" /> <widget name="config" position="2,280" size="730,380" halign="center" font="Regular; 22" backgroundColor="#00000000" foregroundColor="#00e5b243" /> <widget source="description" render="Label" position="2,80" size="730,30" halign="center" font="Regular; 22" backgroundColor="#00000000" foregroundColor="#00ffffff" /> <widget source="options" render="Label" position="2,130" size="730,60" halign="center" font="Regular; 22" backgroundColor="#00000000" foregroundColor="#00ffffff" /> <widget source="key_red" render="Label" position="30,200" size="150,30" noWrap="1" zPosition="1" valign="center" font="Regular; 20" halign="left" backgroundColor="#00000000" foregroundColor="#00ffffff" />
def ipkgCallback(self, event, param): if event == IpkgComponent.EVENT_DOWNLOAD: self.status.setText(_("Downloading")) elif event == IpkgComponent.EVENT_UPGRADE: if self.sliderPackages.has_key(param): self.slider.setValue(self.sliderPackages[param]) self.package.setText(param) self.status.setText(_("Upgrading") + ": %s/%s" % (self.packages, self.total_packages)) if not param in self.processed_packages: self.processed_packages.append(param) self.packages += 1 elif event == IpkgComponent.EVENT_INSTALL: self.package.setText(param) self.status.setText(_("Installing")) if not param in self.processed_packages: self.processed_packages.append(param) self.packages += 1 elif event == IpkgComponent.EVENT_REMOVE: self.package.setText(param) self.status.setText(_("Removing")) if not param in self.processed_packages: self.processed_packages.append(param) self.packages += 1 elif event == IpkgComponent.EVENT_CONFIGURING: self.package.setText(param) self.status.setText(_("Configuring")) elif event == IpkgComponent.EVENT_MODIFIED: if config.plugins.softwaremanager.overwriteConfigFiles.getValue() in ("N", "Y"): self.ipkg.write(True and config.plugins.softwaremanager.overwriteConfigFiles.getValue()) else: self.session.openWithCallback( self.modificationCallback, MessageBox, _("A configuration file (%s) has been modified since it was installed.\nDo you want to keep your modifications?") % param ) elif event == IpkgComponent.EVENT_ERROR: self.error += 1 elif event == IpkgComponent.EVENT_DONE: if self.updating: self.updating = False self.ipkg.startCmd(IpkgComponent.CMD_UPGRADE_LIST) elif self.ipkg.currentCommand == IpkgComponent.CMD_UPGRADE_LIST: from urllib import urlopen import socket currentTimeoutDefault = socket.getdefaulttimeout() socket.setdefaulttimeout(3) try: config.softwareupdate.updateisunstable.setValue(urlopen("http://enigma2.world-of-satellite.com/feeds/" + getImageVersion() + "/status").read()) except: config.softwareupdate.updateisunstable.setValue('1') socket.setdefaulttimeout(currentTimeoutDefault) self.total_packages = None if config.softwareupdate.updateisunstable.getValue() == '1' and config.softwareupdate.updatebeta.getValue(): self.total_packages = len(self.ipkg.getFetchedList()) message = _("The current update may be unstable") + "\n" + _("Are you sure you want to update your %s %s ?") % (getMachineBrand(), getMachineName()) + "\n(" + (ngettext("%s updated package available", "%s updated packages available", self.total_packages) % self.total_packages) + ")" elif config.softwareupdate.updateisunstable.getValue() == '0': self.total_packages = len(self.ipkg.getFetchedList()) message = _("Do you want to update your %s %s ?") % (getMachineBrand(), getMachineName()) + "\n(" + (ngettext("%s updated package available", "%s updated packages available", self.total_packages) % self.total_packages) + ")" if self.total_packages: global ocram for package_tmp in self.ipkg.getFetchedList(): if package_tmp[0].startswith('enigma2-plugin-picons-tv-ocram'): ocram = ocram + '[ocram-picons] ' + package_tmp[0].split('enigma2-plugin-picons-tv-ocram.')[1] + 'updated ' + package_tmp[2] + '\n' elif package_tmp[0].startswith('enigma2-plugin-settings-ocram'): ocram = ocram + '[ocram-settings] ' + package_tmp[0].split('enigma2-plugin-picons-tv-ocram.')[1] + 'updated ' + package_tmp[2] + '\n' config.softwareupdate.updatefound.setValue(True) choices = [(_("View the changes"), "changes"), (_("Upgrade and reboot system"), "cold")] if path.exists("/usr/lib/enigma2/python/Plugins/SystemPlugins/ViX/BackupManager.pyo"): if not config.softwareupdate.autosettingsbackup.getValue() and config.backupmanager.backuplocation.getValue(): choices.append((_("Perform a settings backup,") + '\n\t' + _("making a backup before updating") + '\n\t' +_("is strongly advised."), "backup")) if not config.softwareupdate.autoimagebackup.getValue() and config.imagemanager.backuplocation.getValue(): choices.append((_("Perform a full image backup"), "imagebackup")) choices.append((_("Update channel list only"), "channels")) choices.append((_("Cancel"), "")) upgrademessage = self.session.openWithCallback(self.startActualUpgrade, ChoiceBox, title=message, list=choices, skin_name = "SoftwareUpdateChoices") upgrademessage.setTitle(_('Software update')) else: upgrademessage = self.session.openWithCallback(self.close, MessageBox, _("Nothing to upgrade"), type=MessageBox.TYPE_INFO, timeout=10, close_on_any_key=True) upgrademessage.setTitle(_('Software update')) elif self.channellist_only > 0: if self.channellist_only == 1: self.setEndMessage(_("Could not find installed channel list.")) elif self.channellist_only == 2: self.slider.setValue(2) self.ipkg.startCmd(IpkgComponent.CMD_REMOVE, {'package': self.channellist_name}) self.channellist_only += 1 elif self.channellist_only == 3: self.slider.setValue(3) self.ipkg.startCmd(IpkgComponent.CMD_INSTALL, {'package': self.channellist_name}) self.channellist_only += 1 elif self.channellist_only == 4: self.showUpdateCompletedMessage() eDVBDB.getInstance().reloadBouquets() eDVBDB.getInstance().reloadServicelist() elif self.error == 0: self.showUpdateCompletedMessage() else: self.activityTimer.stop() self.activityslider.setValue(0) error = _("Your %s %s might be unusable now. Please consult the manual for further assistance before rebooting your %s %s.") % (getMachineBrand(), getMachineName(), getMachineBrand(), getMachineName()) if self.packages == 0: error = _("No updates available. Please try again later.") if self.updating: error = _("Update failed. Your %s %s does not have a working internet connection.") % (getMachineBrand(), getMachineName()) self.status.setText(_("Error") + " - " + error) elif event == IpkgComponent.EVENT_LISTITEM: if 'enigma2-plugin-settings-' in param[0] and self.channellist_only > 0: self.channellist_name = param[0] self.channellist_only = 2 #print event, "-", param pass
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") % 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 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 __init__(self, session): Screen.__init__(self, session) self.setTitle(_("About")) hddsplit = skin.parameters.get("AboutHddSplit", 0) AboutText = _("Model: %s %s") % (getMachineBrand(), getMachineName()) + "\n" AboutText += _("Image: ") + about.getImageTypeString() + "\n" AboutText += _( "Kernel version: ") + about.getKernelVersionString() + "\n" if path.exists('/proc/stb/info/chipset'): AboutText += _("Chipset: %s") % about.getChipSetString() + "\n" AboutText += _("CPU: %s") % about.getCPUString() + "\n" AboutText += _("Version: %s") % getImageVersion() + "\n" AboutText += _("Build: %s") % getImageBuild() + "\n" if path.exists('/proc/stb/info/release') and getBoxType() in ( 'et7000', 'et7500', 'et8500'): realdriverdate = open("/proc/stb/info/release", 'r') for line in realdriverdate: tmp = line.strip() AboutText += _("Drivers: %s") % tmp + "\n" realdriverdate.close() else: string = getDriverDate() year = string[0:4] month = string[4:6] day = string[6:8] driversdate = '-'.join((year, month, day)) AboutText += _("Drivers: %s") % driversdate + "\n" EnigmaVersion = "Enigma: " + about.getEnigmaVersionString() self["EnigmaVersion"] = StaticText(EnigmaVersion) AboutText += EnigmaVersion + "\n" AboutText += _( "Enigma (re)starts: %d\n") % config.misc.startCounter.value GStreamerVersion = "GStreamer: " + about.getGStreamerVersionString( ).replace("GStreamer", "") self["GStreamerVersion"] = StaticText(GStreamerVersion) AboutText += GStreamerVersion + "\n" ImageVersion = _("Last upgrade: ") + about.getImageVersionString() self["ImageVersion"] = StaticText(ImageVersion) AboutText += ImageVersion + "\n" AboutText += _( "Python version: ") + about.getPythonVersionString() + "\n" + "\n" fp_version = getFPVersion() if fp_version is None: fp_version = "" else: fp_version = _("Frontprocessor version: %s") % fp_version AboutText += fp_version + "\n" self["FPVersion"] = StaticText(fp_version) skinWidth = getDesktop(0).size().width() skinHeight = getDesktop(0).size().height() AboutText += _("Skin Name: %s") % config.skin.primary_skin.value[ 0:-9] + _(" (%s x %s)") % (skinWidth, skinHeight) + "\n" if path.exists('/etc/enigma2/EtRcType'): rfp = open('/etc/enigma2/EtRcType', "r") Remote = rfp.read() rfp.close AboutText += _("Remote control type") + _(": ") + Remote + "\n" else: AboutText += _("Remote control type") + _( ": ") + iRcTypeControl.getBoxType() + "\n" if path.exists('/proc/stb/ir/rc/type'): fp = open('/proc/stb/ir/rc/type', "r") RcID = fp.read() fp.close AboutText += _("Remote control ID") + _(": ") + RcID self["TunerHeader"] = StaticText(_("Detected NIMs:")) AboutText += "\n" + _("Detected NIMs:") + "\n" nims = nimmanager.nimListCompressed() for count in range(len(nims)): if count < 4: self["Tuner" + str(count)] = StaticText(nims[count]) else: self["Tuner" + str(count)] = StaticText("") AboutText += nims[count] + "\n" self["HDDHeader"] = StaticText(_("Detected HDD:")) AboutText += "\n" + _("Detected HDD:") + "\n" hddlist = harddiskmanager.HDDList() hddinfo = "" if hddlist: formatstring = hddsplit and "%s:%s, %.1f %sB %s" or "%s\n(%s, %.1f %sB %s)" for count in range(len(hddlist)): if hddinfo: hddinfo += "\n" hdd = hddlist[count][1] if int(hdd.free()) > 1024: hddinfo += formatstring % (hdd.model(), hdd.capacity(), hdd.free() / 1024.0, "G", _("free")) else: hddinfo += formatstring % (hdd.model(), hdd.capacity(), hdd.free(), "M", _("free")) else: hddinfo = _("none") self["hddA"] = StaticText(hddinfo) AboutText += hddinfo + "\n\n" + _("Network Info:") for x in about.GetIPsFromNetworkInterfaces(): AboutText += "\n" + x[0] + ": " + x[1] self["AboutScrollLabel"] = ScrollLabel(AboutText) self["key_green"] = Button(_("Troubleshoot")) self["key_red"] = Button(_("Latest Commits")) self["key_yellow"] = Button(_("Memory Info")) self["key_blue"] = Button(_("%s ") % getMachineName() + _("picture")) self["actions"] = ActionMap( [ "ColorActions", "SetupActions", "DirectionActions", "ChannelSelectEPGActions" ], { "cancel": self.close, "ok": self.close, "info": self.showTranslationInfo, "red": self.showCommits, "green": self.showTroubleshoot, "yellow": self.showMemoryInfo, "blue": self.showModelPic, "up": self["AboutScrollLabel"].pageUp, "down": self["AboutScrollLabel"].pageDown })
def 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 doFullBackup(self, answer): if answer is not None: if answer[1]: self.RECOVERY = answer[3] self.DIRECTORY = "%s/fullbackup" % answer[2] if not os.path.exists(self.DIRECTORY): try: os.makedirs(self.DIRECTORY) except: self.session.open(MessageBox, _("Can't create backup directory"), MessageBox.TYPE_ERROR, timeout=10) return self.SLOT = answer[1] self.MODEL = GetBoxName() self.OEM = getBrandOEM() self.MACHINEBUILD = getMachineBuild() self.MACHINENAME = getMachineName() self.MACHINEBRAND = getMachineBrand() self.IMAGEFOLDER = getImageFolder() self.UBINIZE_ARGS = getMachineUBINIZE() self.MKUBIFS_ARGS = getMachineMKUBIFS() self.ROOTFSSUBDIR = "none" self.ROOTFSBIN = getMachineRootFile() self.KERNELBIN = getMachineKernelFile() self.ROOTFSTYPE = getImageFileSystem().strip() self.IMAGEDISTRO = getImageDistro() self.DISTROVERSION = getImageVersion() if SystemInfo["canRecovery"]: self.EMMCIMG = SystemInfo["canRecovery"][0] self.MTDBOOT = SystemInfo["canRecovery"][1] else: self.EMMCIMG = "none" self.MTDBOOT = "none" self.getImageList = self.saveImageList if SystemInfo["canMultiBoot"]: self.MTDKERNEL = SystemInfo["canMultiBoot"][ self.SLOT]["kernel"].split('/')[2] self.MTDROOTFS = SystemInfo["canMultiBoot"][ self.SLOT]["device"].split('/')[2] if 'rootsubdir' in SystemInfo["canMultiBoot"][self.SLOT]: self.ROOTFSSUBDIR = SystemInfo["canMultiBoot"][ self.SLOT]['rootsubdir'] else: self.MTDKERNEL = getMachineMtdKernel() self.MTDROOTFS = getMachineMtdRoot() print "[Image Backup] BOX MACHINEBUILD = >%s<" % self.MACHINEBUILD print "[Image Backup] BOX MACHINENAME = >%s<" % self.MACHINENAME print "[Image Backup] BOX MACHINEBRAND = >%s<" % self.MACHINEBRAND print "[Image Backup] BOX MODEL = >%s<" % self.MODEL print "[Image Backup] OEM MODEL = >%s<" % self.OEM print "[Image Backup] IMAGEFOLDER = >%s<" % self.IMAGEFOLDER print "[Image Backup] UBINIZE = >%s<" % self.UBINIZE_ARGS print "[Image Backup] MKUBIFS = >%s<" % self.MKUBIFS_ARGS print "[Image Backup] MTDBOOT = >%s<" % self.MTDBOOT print "[Image Backup] MTDKERNEL = >%s<" % self.MTDKERNEL print "[Image Backup] MTDROOTFS = >%s<" % self.MTDROOTFS print "[Image Backup] ROOTFSBIN = >%s<" % self.ROOTFSBIN print "[Image Backup] KERNELBIN = >%s<" % self.KERNELBIN print "[Image Backup] ROOTFSSUBDIR = >%s<" % self.ROOTFSSUBDIR print "[Image Backup] ROOTFSTYPE = >%s<" % self.ROOTFSTYPE print "[Image Backup] EMMCIMG = >%s<" % self.EMMCIMG print "[Image Backup] IMAGEDISTRO = >%s<" % self.IMAGEDISTRO print "[Image Backup] DISTROVERSION = >%s<" % self.DISTROVERSION print "[Image Backup] MTDBOOT = >%s<" % self.MTDBOOT print "[Image Backup] USB RECOVERY = >%s< " % self.RECOVERY print "[Image Backup] DESTINATION = >%s< " % self.DIRECTORY print "[Image Backup] SLOT = >%s< " % self.SLOT self.TITLE = _("Full back-up on %s") % (self.DIRECTORY) self.START = time() self.DATE = strftime("%Y%m%d_%H%M", localtime(self.START)) self.IMAGEVERSION = self.imageInfo() self.MKFS_UBI = "/usr/sbin/mkfs.ubifs" self.MKFS_TAR = "/bin/tar" self.BZIP2 = "/usr/bin/bzip2" self.MKFS_JFFS2 = "/usr/sbin/mkfs.jffs2" self.UBINIZE = "/usr/sbin/ubinize" self.NANDDUMP = "/usr/sbin/nanddump" self.FASTBOOT = "/usr/bin/ext2simg" self.WORKDIR = "%s/bi" % self.DIRECTORY self.SHOWNAME = "%s %s" % (self.MACHINEBRAND, self.MODEL) self.MAINDEST = "%s/build_%s/%s" % (self.DIRECTORY, self.MODEL, self.IMAGEFOLDER) self.MAINDESTROOT = "%s/build_%s" % (self.DIRECTORY, self.MODEL) self.message = "echo -e '\n" if getMachineBrand().startswith('A') or getMachineBrand( ).startswith('E') or getMachineBrand().startswith( 'I') or getMachineBrand().startswith( 'O') or getMachineBrand().startswith( 'U') or getMachineBrand().startswith('Xt'): self.message += (_('Back-up Tool for an %s\n') % self.SHOWNAME).upper() else: self.message += (_('Back-up Tool for a %s\n') % self.SHOWNAME).upper() self.message += VERSION + '\n' self.message += "_________________________________________________\n\n" self.message += _( "Please be patient, a backup will now be made,\n") self.message += _( "because of the used filesystem the back-up\n") if self.RECOVERY: self.message += _( "will take about 30 minutes for this system\n") else: self.message += _( "will take about 1-15 minutes for this system\n") self.message += "_________________________________________________\n" self.message += "'" ## PREPARING THE BUILDING ENVIRONMENT os.system("rm -rf %s" % self.WORKDIR) self.backuproot = "/tmp/bi/root" if SystemInfo["canMultiBoot"]: if 'rootsubdir' in SystemInfo["canMultiBoot"][self.SLOT]: self.backuproot = "/tmp/bi/RootSubdir/" if not os.path.exists(self.WORKDIR): os.makedirs(self.WORKDIR) if not os.path.exists(self.backuproot): os.makedirs(self.backuproot) os.system("sync") if SystemInfo["canMultiBoot"]: if 'rootsubdir' in SystemInfo["canMultiBoot"][self.SLOT]: os.system("mount /dev/%s /tmp/bi/RootSubdir" % self.MTDROOTFS) self.backuproot = self.backuproot + self.ROOTFSSUBDIR else: os.system("mount /dev/%s %s" % (self.MTDROOTFS, self.backuproot)) else: os.system("mount --bind / %s" % (self.backuproot)) if "jffs2" in self.ROOTFSTYPE.split(): cmd1 = "%s --root=%s --faketime --output=%s/root.jffs2 %s" % ( self.MKFS_JFFS2, self.backuproot, self.WORKDIR, self.MKUBIFS_ARGS) cmd2 = None cmd3 = None elif "ubi" in self.ROOTFSTYPE.split(): f = open("%s/ubinize.cfg" % self.WORKDIR, "w") f.write("[ubifs]\n") f.write("mode=ubi\n") f.write("image=%s/root.ubi\n" % self.WORKDIR) f.write("vol_id=0\n") f.write("vol_type=dynamic\n") f.write("vol_name=rootfs\n") f.write("vol_flags=autoresize\n") f.close() ff = open("%s/root.ubi" % self.WORKDIR, "w") ff.close() cmd1 = "%s -r %s -o %s/root.ubi %s" % ( self.MKFS_UBI, self.backuproot, self.WORKDIR, self.MKUBIFS_ARGS) cmd2 = "%s -o %s/root.ubifs %s %s/ubinize.cfg" % ( self.UBINIZE, self.WORKDIR, self.UBINIZE_ARGS, self.WORKDIR) cmd3 = "mv %s/root.ubifs %s/root.%s" % ( self.WORKDIR, self.WORKDIR, self.ROOTFSTYPE) else: if self.EMMCIMG == "usb_update.bin" and self.RECOVERY: cmd1 = None cmd2 = None else: cmd1 = "%s -cf %s/rootfs.tar -C %s --exclude ./var/nmbd --exclude ./.resizerootfs --exclude ./.resize-rootfs --exclude ./.resize-linuxrootfs --exclude ./.resize-userdata --exclude ./var/lib/samba/private/msg.sock --exclude ./var/lib/samba/msg.sock/* --exclude ./run/avahi-daemon/socket ." % ( self.MKFS_TAR, self.WORKDIR, self.backuproot) cmd2 = "%s %s/rootfs.tar" % (self.BZIP2, self.WORKDIR) cmd3 = None cmdlist = [] cmdlist.append(self.message) if cmd1: cmdlist.append('echo "' + _("Create:") + ' %s"' % self.ROOTFSBIN) cmdlist.append(cmd1) if cmd2: cmdlist.append(cmd2) if cmd3: cmdlist.append(cmd3) if self.EMMCIMG == "usb_update.bin" and self.RECOVERY: SEEK_CONT = (Harddisk.getFolderSize(self.backuproot) / 1024) + 100000 cmdlist.append('echo "' + _("Create:") + " fastboot dump" + '"') cmdlist.append( 'cp -f /usr/share/fastboot.bin %s/fastboot.bin' % (self.WORKDIR)) #cmdlist.append("dd if=/dev/mmcblk0p1 of=%s/fastboot.bin" % self.WORKDIR) cmdlist.append('echo "' + _("Create:") + " bootargs dump" + '"') cmdlist.append( 'cp -f /usr/share/bootargs.bin %s/bootargs.bin' % (self.WORKDIR)) #cmdlist.append("dd if=/dev/mmcblk0p2 of=%s/bootargs.bin" % self.WORKDIR) cmdlist.append('echo "' + _("Create:") + " boot dump" + '"') cmdlist.append("dd if=/dev/mmcblk0p3 of=%s/boot.img" % self.WORKDIR) cmdlist.append('echo "' + _("Create:") + " baseparam dump" + '"') #cmdlist.append('cp -f /usr/share/bootargs.bin %s/baseparam.img' %(self.WORKDIR)) cmdlist.append("dd if=/dev/mmcblk0p4 of=%s/baseparam.img" % self.WORKDIR) cmdlist.append('echo "' + _("Create:") + " pq_param dump" + '"') #cmdlist.append('cp -f /usr/share/bootargs.bin %s/pq_param.bin' %(self.WORKDIR)) cmdlist.append("dd if=/dev/mmcblk0p5 of=%s/pq_param.bin" % self.WORKDIR) cmdlist.append('echo "' + _("Create:") + " logo dump" + '"') cmdlist.append("dd if=/dev/mmcblk0p6 of=%s/logo.img" % self.WORKDIR) cmdlist.append('echo "' + _("Create:") + " deviceinfo dump" + '"') #cmdlist.append('cp -f /usr/share/bootargs.bin %s/deviceinfo.bin' %(self.WORKDIR)) cmdlist.append( "dd if=/dev/mmcblk0p7 of=%s/deviceinfo.bin" % self.WORKDIR) cmdlist.append('echo "' + _("Create:") + " apploader dump" + '"') cmdlist.append( 'cp -f /usr/share/apploader.bin %s/apploader.bin' % (self.WORKDIR)) #cmdlist.append("dd if=/dev/mmcblk0p10 of=%s/apploader.bin" % self.WORKDIR) cmdlist.append('echo "' + _("Create:") + " rootfs dump" + '"') cmdlist.append( "dd if=/dev/zero of=%s/rootfs.ext4 seek=%s count=60 bs=1024" % (self.WORKDIR, SEEK_CONT)) cmdlist.append("mkfs.ext4 -F -i 4096 %s/rootfs.ext4" % (self.WORKDIR)) cmdlist.append("mkdir -p %s/userdata" % self.WORKDIR) cmdlist.append("mount %s/rootfs.ext4 %s/userdata" % (self.WORKDIR, self.WORKDIR)) cmdlist.append("mkdir -p %s/userdata/linuxrootfs1" % self.WORKDIR) cmdlist.append("mkdir -p %s/userdata/linuxrootfs2" % self.WORKDIR) cmdlist.append("mkdir -p %s/userdata/linuxrootfs3" % self.WORKDIR) cmdlist.append("mkdir -p %s/userdata/linuxrootfs4" % self.WORKDIR) cmdlist.append("rsync -aAX %s/ %s/userdata/linuxrootfs1/" % (self.backuproot, self.WORKDIR)) cmdlist.append("umount %s/userdata" % (self.WORKDIR)) cmdlist.append('echo "' + _("Create:") + " kerneldump" + '"') if SystemInfo["canMultiBoot"] or self.MTDKERNEL.startswith( 'mmcblk0'): cmdlist.append( "dd if=/dev/%s of=%s/%s" % (self.MTDKERNEL, self.WORKDIR, self.KERNELBIN)) else: cmdlist.append("nanddump -a -f %s/vmlinux.gz /dev/%s" % (self.WORKDIR, self.MTDKERNEL)) if self.EMMCIMG == "usb_update.bin" and self.RECOVERY: cmdlist.append('echo "' + _("Create: Recovery Fullbackup %s") % (self.EMMCIMG) + '"') f = open("%s/emmc_partitions.xml" % self.WORKDIR, "w") f.write('<?xml version="1.0" encoding="GB2312" ?>\n') f.write('<Partition_Info>\n') f.write( '<Part Sel="1" PartitionName="fastboot" FlashType="emmc" FileSystem="none" Start="0" Length="1M" SelectFile="fastboot.bin"/>\n' ) f.write( '<Part Sel="1" PartitionName="bootargs" FlashType="emmc" FileSystem="none" Start="1M" Length="1M" SelectFile="bootargs.bin"/>\n' ) f.write( '<Part Sel="1" PartitionName="bootoptions" FlashType="emmc" FileSystem="none" Start="2M" Length="1M" SelectFile="boot.img"/>\n' ) f.write( '<Part Sel="1" PartitionName="baseparam" FlashType="emmc" FileSystem="none" Start="3M" Length="3M" SelectFile="baseparam.img"/>\n' ) f.write( '<Part Sel="1" PartitionName="pqparam" FlashType="emmc" FileSystem="none" Start="6M" Length="4M" SelectFile="pq_param.bin"/>\n' ) f.write( '<Part Sel="1" PartitionName="logo" FlashType="emmc" FileSystem="none" Start="10M" Length="4M" SelectFile="logo.img"/>\n' ) f.write( '<Part Sel="1" PartitionName="deviceinfo" FlashType="emmc" FileSystem="none" Start="14M" Length="4M" SelectFile="deviceinfo.bin"/>\n' ) f.write( '<Part Sel="1" PartitionName="loader" FlashType="emmc" FileSystem="none" Start="26M" Length="32M" SelectFile="apploader.bin"/>\n' ) f.write( '<Part Sel="1" PartitionName="linuxkernel1" FlashType="emmc" FileSystem="none" Start="66M" Length="16M" SelectFile="kernel.bin"/>\n' ) if self.MACHINENAME in ("sf8008m"): f.write( '<Part Sel="1" PartitionName="userdata" FlashType="emmc" FileSystem="ext3/4" Start="130M" Length="3580M" SelectFile="rootfs.ext4"/>\n' ) else: f.write( '<Part Sel="1" PartitionName="userdata" FlashType="emmc" FileSystem="ext3/4" Start="130M" Length="7000M" SelectFile="rootfs.ext4"/>\n' ) f.write('</Partition_Info>\n') f.close() cmdlist.append( 'mkupdate -s 00000003-00000001-01010101 -f %s/emmc_partitions.xml -d %s/%s' % (self.WORKDIR, self.WORKDIR, self.EMMCIMG)) self.session.open(Console, title=self.TITLE, cmdlist=cmdlist, finishedCallback=self.doFullBackupCB, closeOnSuccess=True) else: self.close() else: self.close()
def ipkgCallback(self, event, param): if event == IpkgComponent.EVENT_DONE: if self.updating: self.updating = False self.ipkg.startCmd(IpkgComponent.CMD_UPGRADE_LIST) elif self.ipkg.currentCommand == IpkgComponent.CMD_UPGRADE_LIST: self.total_packages = len(self.ipkg.getFetchedList()) print ('[OnlineVersionCheck] %s Updates available' % self.total_packages) if self.total_packages: from urllib import urlopen import socket currentTimeoutDefault = socket.getdefaulttimeout() socket.setdefaulttimeout(3) config.softwareupdate.updatefound.setValue(True) try: config.softwareupdate.updateisunstable.setValue(urlopen("http://odisealinux.com/feeds/" + getImageVersion() + "/status").read()) except: config.softwareupdate.updateisunstable.setValue(1) socket.setdefaulttimeout(currentTimeoutDefault) else: config.softwareupdate.updatefound.setValue(False) else: config.softwareupdate.updatefound.setValue(False) pass
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" AboutText += _("Python:\t%s\n") % about.getPythonVersionString() AboutText += _("Flashed:\t%s\n") % about.getFlashDateString() 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', '').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', ' ') 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" AboutText += _("CPU:\t\t%s (%s) %s cores") % (about.getCPUString(), about.getCPUSpeedString(), about.getCpuCoresString()) + "\n" imagestarted = "" bootname = '' if path.exists('/boot/bootname'): f = open('/boot/bootname', 'r') bootname = f.readline().split('=')[1] f.close() if BoxInfo.getItem("canMultiBoot"): slot = image = GetCurrentImage() bootmode = "" part = _("eMMC slot %s") % slot if BoxInfo.getItem("canMode12"): bootmode = _(" bootmode = %s") % GetCurrentImageMode() if BoxInfo.getItem("HasHiSi") and "sda" in BoxInfo.getItem("canMultiBoot")[slot]['device']: if slot > 4: image -= 4 else: image -= 1 part = "SDcard slot %s (%s) " % (image, BoxInfo.getItem("canMultiBoot")[slot]['device']) AboutText += _("Selected Image:\t\t%s") % _("STARTUP_") + str(slot) + " (" + part + bootmode + ")\n" AboutText += _("Version / Build:\t\t%s (%s)") % (getImageVersion(), MyDateConverter(getImageBuild())) + "\n" AboutText += _("Kernel:\t\t%s") % about.getKernelVersionString() + "\n" AboutText += _("OpenSSL:\t\t%s") % about.getopensslVersionString() + "\n" AboutText += _("Drivers:\t\t%s") % MyDateConverter(getDriverDate()) + "\n" skinWidth = getDesktop(0).size().width() skinHeight = getDesktop(0).size().height() AboutText += _("Skin:\t\t%s") % config.skin.primary_skin.value.split("/")[0] + _(" (%s x %s)") % (skinWidth, skinHeight) + "\n" AboutText += _("GStreamer:\t\t%s") % about.getGStreamerVersionString() + "\n" AboutText += _("Python:\t\t%s") % about.getPythonVersionString() + "\n" MyFlashDate = about.getFlashDateString() if MyFlashDate != _("unknown"): AboutText += _("Installed:\t\t%s") % MyDateConverter(MyFlashDate) + "\n" AboutText += _("Last E2 update:\t\t%s") % MyDateConverter(getEnigmaVersionString()) + "\n" AboutText += _("Uptime:\t\t%s") % about.getBoxUptime() + "\n" AboutText += _("Enigma2 debug level:\t%d") % eGetEnigmaDebugLvl() + "\n" fp_version = getFPVersion() if fp_version is None: fp_version = "" elif fp_version != 0: fp_version = _("Frontprocessor version:\t%s") % fp_version AboutText += fp_version + "\n" tempinfo = "" if path.exists('/proc/stb/sensors/temp0/value'): f = open('/proc/stb/sensors/temp0/value', 'r') tempinfo = f.read() f.close() elif path.exists('/proc/stb/fp/temp_sensor'): f = open('/proc/stb/fp/temp_sensor', 'r') tempinfo = f.read() f.close() elif path.exists('/proc/stb/sensors/temp/value'): f = open('/proc/stb/sensors/temp/value', 'r') tempinfo = f.read() f.close() if tempinfo and int(tempinfo.replace('\n', '')) > 0: AboutText += _("System temperature:\t%s") % tempinfo.replace('\n', '').replace(' ', '') + SIGN + "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', 'u45'): tempinfo = str(int(tempinfo) - 15) except: tempinfo = "" if tempinfo and int(tempinfo.replace('\n', '')) > 0: AboutText += _("Processor temperature:\t%s") % tempinfo.replace('\n', '').replace(' ', '') + SIGN + "C\n" AboutLcdText = AboutText.replace('\t', ' ') return AboutText, AboutLcdText
def checkForDevelopImage(): if getImageVersion() == 'develop': return config.misc.check_developimage.value elif not config.misc.check_developimage.value: config.misc.check_developimage.value = True config.misc.check_developimage.save()
def ipkgCallback(self, event, param): if event == IpkgComponent.EVENT_DOWNLOAD: self.status.setText(_("Downloading")) elif event == IpkgComponent.EVENT_UPGRADE: if param in self.sliderPackages: self.slider.setValue(self.sliderPackages[param]) self.package.setText(param) self.status.setText(_("Upgrading") + ": %s/%s" % (self.packages, self.total_packages)) if not param in self.processed_packages: self.processed_packages.append(param) self.packages += 1 elif event == IpkgComponent.EVENT_INSTALL: self.package.setText(param) self.status.setText(_("Installing")) if not param in self.processed_packages: self.processed_packages.append(param) self.packages += 1 elif event == IpkgComponent.EVENT_REMOVE: self.package.setText(param) self.status.setText(_("Removing")) if not param in self.processed_packages: self.processed_packages.append(param) self.packages += 1 elif event == IpkgComponent.EVENT_CONFIGURING: self.package.setText(param) self.status.setText(_("Configuring")) elif event == IpkgComponent.EVENT_MODIFIED: if config.plugins.softwaremanager.overwriteConfigFiles.value in ("N", "Y"): self.ipkg.write(True and config.plugins.softwaremanager.overwriteConfigFiles.value) else: self.session.openWithCallback( self.modificationCallback, MessageBox, _("A configuration file (%s) has been modified since it was installed.\nDo you want to keep your modifications?") % (param) ) elif event == IpkgComponent.EVENT_ERROR: self.error += 1 elif event == IpkgComponent.EVENT_DONE: if self.updating: self.updating = False self.ipkg.startCmd(IpkgComponent.CMD_UPGRADE_LIST) elif self.ipkg.currentCommand == IpkgComponent.CMD_UPGRADE_LIST: self.total_packages = len(self.ipkg.getFetchedList()) if self.total_packages: latestImageTimestamp = self.getLatestImageTimestamp() if latestImageTimestamp: message = _("Latest available teamBlue %s build is from: %s") % (getImageVersion(), self.getLatestImageTimestamp()) + "\n" message += _("Do you want to update your receiver?") + "\n" else: message = _("Do you want to update your receiver?") + "\n" message += "(" + (ngettext("%s updated package available", "%s updated packages available", self.total_packages) % self.total_packages) + ")" if self.total_packages > 150: message += " " + _("Reflash recommended!") choices = [(_("Update and reboot (recommended)"), "cold"), (_("Update and ask to reboot"), "hot"), #(_("Update channel list only"), "channels"), (_("Show packages to be upgraded"), "showlist")] else: message = _("No updates available") choices = [] if fileExists("/home/root/ipkgupgrade.log"): choices.append((_("Show latest upgrade log"), "log")) choices.append((_("Show latest commits"), "commits")) if not config.usage.show_update_disclaimer.value: choices.append((_("Show disclaimer"), "disclaimer")) choices.append((_("Cancel"), "")) self.session.openWithCallback(self.startActualUpgrade, ChoiceBox, title=message, list=choices, windowTitle=self.title) elif self.channellist_only > 0: if self.channellist_only == 1: self.setEndMessage(_("Could not find installed channel list.")) elif self.channellist_only == 2: self.slider.setValue(2) self.ipkg.startCmd(IpkgComponent.CMD_REMOVE, {'package': self.channellist_name}) self.channellist_only += 1 elif self.channellist_only == 3: self.slider.setValue(3) self.ipkg.startCmd(IpkgComponent.CMD_INSTALL, {'package': self.channellist_name}) self.channellist_only += 1 elif self.channellist_only == 4: self.showUpdateCompletedMessage() eDVBDB.getInstance().reloadBouquets() eDVBDB.getInstance().reloadServicelist() elif self.error == 0: self.showUpdateCompletedMessage() else: self.activityTimer.stop() self.activityslider.setValue(0) error = _("Your receiver might be unusable now. Please consult the manual for further assistance before rebooting your receiver.") if self.packages == 0: error = _("No updates available. Please try again later.") if self.updating: error = _("Update failed. Your receiver does not have a working internet connection.") self.status.setText(_("Error") + " - " + error) elif event == IpkgComponent.EVENT_LISTITEM: if 'enigma2-plugin-settings-' in param[0] and self.channellist_only > 0: self.channellist_name = param[0] self.channellist_only = 2 #print event, "-", param pass
def getlog(self): global ocram try: sourcefile = 'http://feeds.italysat.eu/' + getImageVersion( ) + getBoxType() + '/' + self.logtype + '-git.log' sourcefile, headers = urllib.urlretrieve(sourcefile) rename(sourcefile, '/tmp/' + self.logtype + '-git.log') fd = open('/tmp/' + self.logtype + '-git.log', 'r') releasenotes = fd.read() fd.close() except: releasenotes = '404 Not Found' if '404 Not Found' not in releasenotes: releasenotes = releasenotes.replace('[italysat] 7.0 Release.', 'italysat: build 000') releasenotes = releasenotes.replace('\nitalysat: build', '\n\nitalysat: build') releasenotes = releasenotes.split('\n\n') ver = -1 releasever = '' viewrelease = '' while not releasever.isdigit(): ver += 1 releasever = releasenotes[int(ver)].split('\n') releasever = releasever[0].split(' ') if len(releasever) > 2: releasever = releasever[2].replace(':', '') else: releasever = releasever[0].replace(':', '') if self.logtype == 'oe': if int(getImageBuild()) == 1: imagever = int(getImageBuild()) - 1 else: imagever = int(getImageBuild()) else: imagever = int(getImageBuild()) + 170 while int(releasever) > int(imagever): if ocram: viewrelease += releasenotes[int(ver)] + '\n' + ocram + '\n' ocram = '' else: viewrelease += releasenotes[int(ver)] + '\n\n' ver += 1 releasever = releasenotes[int(ver)].split('\n') releasever = releasever[0].split(' ') releasever = releasever[2].replace(':', '') if not viewrelease and ocram: viewrelease = ocram ocram = '' self['text'].setText(viewrelease) summarytext = viewrelease.split(':\n') try: self['title_summary'].setText(summarytext[0] + ':') self['text_summary'].setText(summarytext[1]) except: self['title_summary'].setText('') self['text_summary'].setText(viewrelease) else: self['title_summary'].setText('') self['text_summary'].setText(_('Error downloading change log.')) self['text'].setText(_('Error downloading change log.'))
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)" 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() 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 populate(self): self["lab1"] = StaticText(_("Virtuosso Image Xtreme")) self["lab2"] = StaticText(_("By Team ViX")) model = None AboutText = "" self["lab3"] = StaticText( _("Support at") + " www.world-of-satellite.com") AboutText += _("Model:\t%s %s\n") % (getMachineBrand(), getMachineName()) if about.getChipSetString() != _("unavailable"): if SystemInfo["HasHiSi"]: AboutText += _("Chipset:\tHiSilicon %s\n" ) % about.getChipSetString().upper() elif about.getIsBroadcom(): AboutText += _("Chipset:\tBroadcom %s\n" ) % about.getChipSetString().upper() else: AboutText += _( "Chipset:\t%s\n") % about.getChipSetString().upper() AboutText += _("CPU:\t%s %s %s\n") % (about.getCPUArch(), about.getCPUSpeedString(), about.getCpuCoresString()) imageSubBuild = "" if getImageType() != 'release': imageSubBuild = ".%s" % getImageDevBuild() AboutText += _("Image:\t%s.%s%s (%s)\n") % (getImageVersion( ), getImageBuild(), imageSubBuild, getImageType().title()) if SystemInfo["canMultiBoot"]: slot = image = GetCurrentImage() part = "eMMC slot %s" % slot bootmode = "" if SystemInfo["canMode12"]: bootmode = "bootmode = %s" % GetCurrentImageMode() if SystemInfo["HasSDmmc"]: slot += 1 if image != 0: part = "SDC slot %s (%s%s) " % ( image, SystemInfo["canMultiBoot"][2], image * 2) else: part = "eMMC slot %s" % slot AboutText += _("Image Slot:\t%s") % "STARTUP_" + str( slot) + " " + part + " " + bootmode + "\n" if getMachineName() in ('ET8500') and path.exists('/proc/mtd'): self.dualboot = self.dualBoot() if self.dualboot: AboutText += _("ET8500 Multiboot: Installed\n") skinWidth = getDesktop(0).size().width() skinHeight = getDesktop(0).size().height() string = getDriverDate() year = string[0:4] month = string[4:6] day = string[6:8] driversdate = '-'.join((year, month, day)) AboutText += _("Drivers:\t%s\n") % driversdate AboutText += _("Kernel:\t%s\n") % about.getKernelVersionString() AboutText += _("GStreamer:\t%s\n") % about.getGStreamerVersionString( ).replace("GStreamer ", "") AboutText += _("Python:\t%s\n") % about.getPythonVersionString() AboutText += _("Installed:\t%s\n") % about.getFlashDateString() AboutText += _("Last update:\t%s\n") % getEnigmaVersionString() AboutText += _("E2 (re)starts:\t%s\n") % config.misc.startCounter.value AboutText += _("Skin:\t%s") % config.skin.primary_skin.value[0:-9] + _( " (%s x %s)") % (skinWidth, skinHeight) + "\n" tempinfo = "" if path.exists('/proc/stb/sensors/temp0/value'): f = open('/proc/stb/sensors/temp0/value', 'r') tempinfo = f.read() f.close() elif path.exists('/proc/stb/fp/temp_sensor'): f = open('/proc/stb/fp/temp_sensor', 'r') tempinfo = f.read() f.close() elif path.exists('/proc/stb/sensors/temp/value'): f = open('/proc/stb/sensors/temp/value', 'r') tempinfo = f.read() f.close() if tempinfo and int(tempinfo.replace('\n', '')) > 0: mark = str('\xc2\xb0') AboutText += _("System temp:\t%s") % tempinfo.replace( '\n', '').replace(' ', '') + mark + "C\n" tempinfo = "" if path.exists('/proc/stb/fp/temp_sensor_avs'): f = open('/proc/stb/fp/temp_sensor_avs', 'r') tempinfo = f.read() f.close() elif path.exists('/sys/devices/virtual/thermal/thermal_zone0/temp'): try: f = open('/sys/devices/virtual/thermal/thermal_zone0/temp', 'r') tempinfo = f.read() tempinfo = tempinfo[:-4] f.close() except: tempinfo = "" elif path.exists('/proc/hisi/msp/pm_cpu'): try: tempinfo = search( 'temperature = (\d+) degree', open("/proc/hisi/msp/pm_cpu").read()).group(1) except: tempinfo = "" if tempinfo and int(tempinfo) > 0: mark = str('\xc2\xb0') AboutText += _("Processor temp:\t%s") % tempinfo.replace( '\n', '').replace(' ', '') + mark + "C\n" AboutLcdText = AboutText.replace('\t', ' ') fp_version = getFPVersion() if fp_version is None: fp_version = "" elif fp_version != 0: fp_version = _("FP version:\t%s") % fp_version AboutText += fp_version + "\n" bootloader = "" if path.exists('/sys/firmware/devicetree/base/bolt/tag'): f = open('/sys/firmware/devicetree/base/bolt/tag', 'r') bootloader = f.readline().replace('\x00', '').replace('\n', '') f.close() AboutText += _("Bootloader:\t%s\n") % (bootloader) self["AboutScrollLabel"] = ScrollLabel(AboutText)
def getAboutText(): AboutText = "" AboutText += _("Model:\t %s %s\n") % (getMachineBrand(), getMachineName()) if path.exists('/proc/stb/info/chipset'): AboutText += _("Chipset:\t %s") % str(getChipSetString()) + "\n" 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'): cpuMHz = " (1,5 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(getCPUString()) + cpuMHz + "\n" AboutText += _("Cores:\t %s") % str(getCpuCoresString()) + "\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 += _("Kernel:\t %s") % str(getKernelVersionString()) + "\n" AboutText += _("DVB drivers:\t %s") % str(getDriverInstalledDate()) + "\n" AboutText += _("Last update:\t %s") % str(getEnigmaVersionString()) + "\n" AboutText += _("GStreamer:\t%s") % str(getGStreamerVersionString().replace( 'GStreamer', '')) + "\n" #AboutText += _("FFmpeg:\t%s") % str((' 3.1.4')) + "\n" AboutText += _("Python:\t %s") % 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" 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', ' ') 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" 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) return AboutText, AboutLcdText
from Components.SystemInfo import SystemInfo from Screens.Console import Console from Screens.MessageBox import MessageBox from Screens.Screen import Screen from Screens.Console import Console from Screens.HelpMenu import HelpableScreen from Screens.TaskView import JobView from Tools.Downloader import downloadWithProgress from enigma import fbClass import urllib2 import os import shutil import math from boxbranding import getMachineBuild, getMachineProcModel, getMachineBrand, getMachineName, getMachineMtdKernel, getMachineKernelFile, getMachineMtdRoot, getMachineRootFile, getMachineMKUBIFS, getMachineUBINIZE, getBoxType, getBrandOEM, getOEVersion, getDriverDate, getImageVersion, getImageBuild, getImageDistro, getImageFolder, getImageFileSystem, getMachineMtdKernel, getMachineMtdRoot distro = getImageDistro() ImageVersion2 = getImageVersion() ROOTFSBIN = getMachineRootFile() KERNELBIN = getMachineKernelFile() MTDKERNEL = getMachineMtdKernel() MTDROOTFS = getMachineMtdRoot() ############################################################################################################# # Create a List of imagetypes # 0 = Name Of Image, 1 = link to file images = [] global imagesCounter imagesCounter = 0 images.append(["switch to V6.3", "http://pur-e2.club/OU/images/6.2"]) #images.append(["switch to V6.2", "http://pur-e2.club/OU/images/6.3"])
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 75-85', 'r'): line = line.strip() netspeed += line return str(netspeed) def netspeed_wlan0(): netspeed = "" for line in popen('iwconfig wlan0 | grep Bit | cut -c 75-85', 'r'): line = line.strip() netspeed += line return str(netspeed) def netspeed_wlan1(): netspeed = "" for line in popen('iwconfig wlan1 | grep Bit | cut -c 75-85', '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'): 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'): try: import binascii f = open( '/sys/firmware/devicetree/base/cpus/cpu@0/clock-frequency', 'rb') clockfrequency = f.read() f.close() cpuMHz = "%s MHz" % str( round( int(binascii.hexlify(clockfrequency), 16) / 1000000, 1)) except: cpuMHz = "1,7 GHz" else: if path.exists('/proc/cpuinfo'): f = open('/proc/cpuinfo', 'r') temp = f.readlines() f.close() try: for lines in temp: lisp = lines.split(': ') if lisp[0].startswith('cpu MHz'): #cpuMHz = " (" + lisp[1].replace('\n', '') + " MHz)" cpuMHz = " (" + str( int(float(lisp[1].replace('\n', '')))) + " MHz)" break except: pass bogoMIPS = "" if res: cpuMHz = "" + res.replace("\n", "") + " MHz" if res2: bogoMIPS = "" + res2.replace("\n", "") if getMachineBuild() in ('vusolo4k', 'hd51', 'hd52', 'sf4008', 'dm900', 'h7', 'gb7252', '8100s'): AboutText += _("CPU:\t%s") % about.getCPUString() + cpuMHz + "\n" else: AboutText += _( "CPU:\t%s") % about.getCPUString() + " " + cpuMHz + "\n" dMIPS = 0 if getMachineBuild() in ('vusolo4k'): dMIPS = "10.500" elif getMachineBuild() in ('hd52', 'hd51', 'sf4008', 'dm900', 'h7', 'gb7252', '8100s'): dMIPS = "12.000" if getMachineBuild() in ('vusolo4k', 'hd51', 'hd52', 'sf4008', 'dm900', 'h7', 'gb7252', '8100s'): AboutText += _("DMIPS:\t") + dMIPS + "\n" else: AboutText += _("BogoMIPS:\t%s") % bogoMIPS + "\n" tempinfo = "" if path.exists('/proc/stb/sensors/temp0/value'): f = open('/proc/stb/sensors/temp0/value', 'r') tempinfo = f.read() f.close() elif path.exists('/proc/stb/fp/temp_sensor'): f = open('/proc/stb/fp/temp_sensor', 'r') tempinfo = f.read() f.close() elif path.exists('/proc/stb/sensors/temp/value'): f = open('/proc/stb/sensors/temp/value', 'r') tempinfo = f.read() f.close() elif path.exists('/sys/devices/virtual/thermal/thermal_zone0/temp'): if getBoxType() in ('mutant51', 'ax51', 'zgemmah7', 'e4hdultra'): tempinfo = "" else: f = open('/sys/devices/virtual/thermal/thermal_zone0/temp', 'r') tempinfo = f.read() tempinfo = tempinfo[:-4] f.close() if tempinfo and int(tempinfo.replace('\n', '')) > 0: mark = str('\xc2\xb0') AboutText += _("System Temp:\t%s") % tempinfo.replace( '\n', '').replace(' ', '') + mark + "C\n" tempinfo = "" if path.exists('/proc/stb/fp/temp_sensor_avs'): f = open('/proc/stb/fp/temp_sensor_avs', 'r') tempinfo = f.read() f.close() elif path.exists('/proc/stb/power/avs'): f = open('/proc/stb/power/avs', 'r') tempinfo = f.read() f.close() elif path.exists('/sys/devices/virtual/thermal/thermal_zone0/temp'): try: f = open('/sys/devices/virtual/thermal/thermal_zone0/temp', 'r') tempinfo = f.read() tempinfo = tempinfo[:-4] f.close() except: tempinfo = "" elif path.exists('/proc/hisi/msp/pm_cpu'): try: for line in open('/proc/hisi/msp/pm_cpu').readlines(): line = [x.strip() for x in line.strip().split(":")] if line[0] in ("Tsensor"): temp = line[1].split("=") temp = line[1].split(" ") tempinfo = temp[2] except: tempinfo = "" if tempinfo and int(tempinfo.replace('\n', '')) > 0: mark = str('\xc2\xb0') AboutText += _("CPU Temp:\t%s") % tempinfo.replace( '\n', '').replace(' ', '') + mark + "C\n" AboutText += _("Cores:\t%s") % about.getCpuCoresString() + "\n" AboutText += _("HDF Version:\tV%s") % getImageVersion( ) + " Build #" + getImageBuild() + " based on " + getOEVersion() + "\n" AboutText += _("Kernel (Box):\t%s") % about.getKernelVersionString( ) + " (" + getBoxType() + ")" + "\n" 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 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" 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() if path.exists('/boot/STARTUP'): #if getMachineBuild() in ('cc1','sf8008','sf8008s','sf8008t'): # os.system("tune2fs -l /dev/sda2 | grep 'Filesystem created:' | cut -d ' ' -f 9-13 > /tmp/flashdate" ) #else: # os.system("tune2fs -l /dev/sda1 | grep 'Filesystem created:' | cut -d ' ' -f 9-13 > /tmp/flashdate" ) #flashdate = open('/tmp/flashdate', 'r').read() #AboutText += _("Flashed:\t%s") % flashdate AboutText += _("Flashed:\tMultiboot active\n") else: AboutText += _("Flashed:\t%s\n") % about.getFlashDateString() 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 += _("Network:") eth0 = about.getIfConfig('eth0') eth1 = about.getIfConfig('eth1') ra0 = about.getIfConfig('ra0') wlan0 = about.getIfConfig('wlan0') wlan1 = about.getIfConfig('wlan1') if eth0.has_key('addr'): for x in about.GetIPsFromNetworkInterfaces(): AboutText += "\t" + x[0] + ": " + x[1] + " (" + netspeed( ) + ")\n" elif eth1.has_key('addr'): for x in about.GetIPsFromNetworkInterfaces(): AboutText += "\t" + x[0] + ": " + x[1] + " (" + netspeed_eth1( ) + ")\n" elif ra0.has_key('addr'): for x in about.GetIPsFromNetworkInterfaces(): AboutText += "\t" + x[0] + ": " + x[1] + " (~" + netspeed_ra0( ) + ")\n" elif wlan0.has_key('addr'): for x in about.GetIPsFromNetworkInterfaces(): AboutText += "\t" + x[0] + ": " + x[ 1] + " (~" + netspeed_wlan0() + ")\n" elif wlan1.has_key('addr'): for x in about.GetIPsFromNetworkInterfaces(): AboutText += "\t" + x[0] + ": " + x[ 1] + " (~" + netspeed_wlan1() + ")\n" else: for x in about.GetIPsFromNetworkInterfaces(): AboutText += "\t" + x[0] + ": " + x[1] + "\n" fp_version = getFPVersion() if fp_version is None: fp_version = "" elif fp_version != 0: fp_version = _("Frontprocessor:\tVersion %s") % fp_version AboutText += fp_version + "\n" AboutLcdText = AboutText.replace('\t', ' ') self["AboutScrollLabel"] = ScrollLabel(AboutText)
from time import time if os.path.isfile("/usr/lib/enigma2/python/enigma.zip"): sys.path.append("/usr/lib/enigma2/python/enigma.zip") from Tools.Profile import profile, profile_final profile("PYTHON_START") # Don't remove this line. It may seem to do nothing, but if removed, # it will break output redirection for crash logs. import Tools.RedirectOutput from boxbranding import getBoxType, getBrandOEM, getImageVersion, getImageBuild, getImageDevBuild, getImageType, getMachineBuild print "[Image Type] %s" % getImageType() print "[Image Version] %s" % getImageVersion() print "[Image Build] %s" % getImageBuild() if getImageType() != 'release': print "[Image DevBuild] %s" % getImageDevBuild() import enigma import eConsoleImpl import eBaseImpl enigma.eTimer = eBaseImpl.eTimer enigma.eSocketNotifier = eBaseImpl.eSocketNotifier enigma.eConsoleAppContainer = eConsoleImpl.eConsoleAppContainer boxtype = getBoxType() from traceback import print_exc
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 %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', 'gbquad4k', '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") % MyDateConverter( 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 = "" 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 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 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 ('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 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 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") % driversdate + "\n" AboutText += _( "GStreamer:\t\t%s") % about.getGStreamerVersionString() + "\n" AboutText += _("Python:\t\t%s") % about.getPythonVersionString() + "\n" if getMachineBuild() not in ('h9', 'vuzero4k', 'sf5008', 'et13000', 'et1x000', 'hd51', 'hd52', 'vusolo4k', 'vuuno4k', 'vuuno4kse', 'vuultimo4k', 'sf4008', 'dm820', 'dm7080', 'dm900', 'dm920', 'gb7252', 'dags7252', 'vs1500', 'h7', 'xc7439', '8100s', 'u5', 'u5pvr', 'u52', 'u53', 'u51'): AboutText += _("Installed:\t\t%s") % about.getFlashDateString() + "\n" AboutText += _("Last update:\t\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() elif path.exists('/sys/devices/virtual/thermal/thermal_zone0/temp'): try: f = open('/sys/devices/virtual/thermal/thermal_zone0/temp', 'r') tempinfo = f.read() tempinfo = tempinfo[:-4] f.close() except: tempinfo = "" if tempinfo and int(tempinfo.replace('\n', '')) > 0: mark = str('\xc2\xb0') AboutText += _("Processor temperature:\t%s") % tempinfo.replace( '\n', '').replace(' ', '') + mark + "C\n" AboutLcdText = AboutText.replace('\t', ' ') return AboutText, AboutLcdText
import boxbranding print("getVisionVersion=%s<" % boxbranding.getVisionVersion()) print("getVisionRevision=%s<" % boxbranding.getVisionRevision()) print("getDeveloperName=%s<" % boxbranding.getDeveloperName()) print("getBoxBrand=%s<" % boxbranding.getBoxBrand()) print("getOEVersion=%s<" % boxbranding.getOEVersion()) print("getImageDistro=%s<" % boxbranding.getImageDistro()) print("getBoxType=%s<" % boxbranding.getBoxType()) print("getMachineBuild=%s<" % boxbranding.getMachineBuild()) print("getImageVersion=%s<" % boxbranding.getImageVersion()) print("getImageBuild=%s<" % boxbranding.getImageBuild()) print("getImageDevBuild=%s<" % boxbranding.getImageDevBuild()) print("getImageType=%s<" % boxbranding.getImageType()) print("getFeedsUrl=%s<" % boxbranding.getFeedsUrl()) print("getImageFolder=%s<" % boxbranding.getImageFolder()) print("getImageFileSystem=%s<" % boxbranding.getImageFileSystem()) print("getMachineMtdBoot=%s<" % boxbranding.getMachineMtdBoot()) print("getMachineMtdRoot=%s<" % boxbranding.getMachineMtdRoot()) print("getMachineMtdKernel=%s<" % boxbranding.getMachineMtdKernel()) print("getMachineRootFile=%s<" % boxbranding.getMachineRootFile()) print("getMachineKernelFile=%s<" % boxbranding.getMachineKernelFile()) print("getMachineMKUBIFS=%s<" % boxbranding.getMachineMKUBIFS()) print("getMachineUBINIZE=%s<" % boxbranding.getMachineUBINIZE()) print("getForceMode=%s<" % boxbranding.getForceMode()) print("getImageArch=%s<" % boxbranding.getImageArch()) print("getImageFPU=%s<" % boxbranding.getImageFPU()) print("getDisplayType=%s<" % boxbranding.getDisplayType()) print("getHaveSmallFlash=%s<" % boxbranding.getHaveSmallFlash()) print("getHaveMiddleFlash=%s<" % boxbranding.getHaveMiddleFlash()) print("getHaveTranscoding=%s<" % boxbranding.getHaveTranscoding())
def getInfo(): # TODO: get webif versione somewhere! info = {} info['brand'] = getMachineBrand() info['model'] = getMachineName() info['boxtype'] = getBoxType() info['machinebuild'] = getMachineBuild() chipset = "unknown" if fileExists("/etc/.box"): f = open("/etc/.box",'r') model = f.readline().strip().lower() f.close() if model.startswith("ufs") or model.startswith("ufc"): if model in ("ufs910", "ufs922", "ufc960"): chipset = "SH4 @266MHz" else: chipset = "SH4 @450MHz" elif model in ("topf", "tf7700hdpvr"): chipset = "SH4 @266MHz" elif model.startswith("azbox"): f = open("/proc/stb/info/model",'r') model = f.readline().strip().lower() f.close() if model == "me": chipset = "SIGMA 8655" elif model == "minime": chipset = "SIGMA 8653" else: chipset = "SIGMA 8634" elif model.startswith("spark"): if model == "spark7162": chipset = "SH4 @540MHz" else: chipset = "SH4 @450MHz" elif fileExists("/proc/stb/info/azmodel"): f = open("/proc/stb/info/model",'r') model = f.readline().strip().lower() f.close() if model == "me": chipset = "SIGMA 8655" elif model == "minime": chipset = "SIGMA 8653" else: chipset = "SIGMA 8634" elif fileExists("/proc/stb/info/model"): f = open("/proc/stb/info/model",'r') model = f.readline().strip().lower() f.close() if model == "tf7700hdpvr": chipset = "SH4 @266MHz" elif model == "nbox": chipset = "STi7100 @266MHz" elif model == "arivalink200": chipset = "STi7109 @266MHz" elif model in ("adb2850", "adb2849", "dsi87"): chipset = "STi7111 @450MHz" elif model in ("sagemcom88", "esi88"): chipset = "STi7105 @450MHz" elif model.startswith("spark"): if model == "spark7162": chipset = "STi7162 @540MHz" else: chipset = "STi7111 @450MHz" if fileExists("/proc/stb/info/chipset"): f = open("/proc/stb/info/chipset",'r') chipset = f.readline().strip() f.close() info['chipset'] = chipset memFree = 0 for line in open("/proc/meminfo",'r'): parts = line.split(':') key = parts[0].strip() if key == "MemTotal": info['mem1'] = parts[1].strip() elif key in ("MemFree", "Buffers", "Cached"): memFree += int(parts[1].strip().split(' ',1)[0]) info['mem2'] = "%s kB" % memFree try: f = open("/proc/uptime", "rb") uptime = int(float(f.readline().split(' ', 2)[0].strip())) f.close() uptimetext = '' if uptime > 86400: d = uptime/86400 uptime = uptime % 86400 uptimetext += '%dd ' % d uptimetext += "%d:%.2d" % (uptime/3600, (uptime%3600)/60) except: uptimetext = "?" info['uptime'] = uptimetext info["webifver"] = getOpenWebifVer() info['imagedistro'] = getImageDistro() info['oever'] = getOEVersion() info['imagever'] = getImageVersion() + '.' + getImageBuild() info['enigmaver'] = getEnigmaVersionString() info['driverdate'] = getDriverDate() info['kernelver'] = about.getKernelVersionString() try: from Tools.StbHardware import getFPVersion except ImportError: from Tools.DreamboxHardware import getFPVersion info['fp_version'] = getFPVersion() info['tuners'] = [] for i in range(0, nimmanager.getSlotCount()): info['tuners'].append({ "name": nimmanager.getNim(i).getSlotName(), "type": nimmanager.getNimName(i) + " (" + nimmanager.getNim(i).getFriendlyType() + ")" }) info['ifaces'] = [] ifaces = iNetwork.getConfiguredAdapters() for iface in ifaces: info['ifaces'].append({ "name": iNetwork.getAdapterName(iface), "mac": iNetwork.getAdapterAttribute(iface, "mac"), "dhcp": iNetwork.getAdapterAttribute(iface, "dhcp"), "ip": formatIp(iNetwork.getAdapterAttribute(iface, "ip")), "mask": formatIp(iNetwork.getAdapterAttribute(iface, "netmask")), "v4prefix": sum([bin(int(x)).count('1') for x in formatIp(iNetwork.getAdapterAttribute(iface, "netmask")).split('.')]), "gw": formatIp(iNetwork.getAdapterAttribute(iface, "gateway")), "ipv6": getAdapterIPv6(iface)['addr'], "firstpublic": getAdapterIPv6(iface)['firstpublic'] }) info['hdd'] = [] for hdd in harddiskmanager.hdd: dev = hdd.findMount() if dev: stat = os.statvfs(dev) free = int((stat.f_bfree/1024) * (stat.f_bsize/1024)) else: free = -1 if free <= 1024: free = "%i MB" % free else: free = free / 1024. free = "%.3f GB" % free size = hdd.diskSize() * 1000000 / 1048576. if size > 1048576: size = "%.2f TB" % (size / 1048576.) elif size > 1024: size = "%.1f GB" % (size / 1024.) else: size = "%d MB" % size iecsize = hdd.diskSize() # Harddisks > 1000 decimal Gigabytes are labelled in TB if iecsize > 1000000: iecsize = (iecsize + 50000) // float(100000) / 10 # Omit decimal fraction if it is 0 if (iecsize % 1 > 0): iecsize = "%.1f TB" % iecsize else: iecsize = "%d TB" % iecsize # Round harddisk sizes beyond ~300GB to full tens: 320, 500, 640, 750GB elif iecsize > 300000: iecsize = "%d GB" % ((iecsize + 5000) // 10000 * 10) # ... be more precise for media < ~300GB (Sticks, SSDs, CF, MMC, ...): 1, 2, 4, 8, 16 ... 256GB elif iecsize > 1000: iecsize = "%d GB" % ((iecsize + 500) // 1000) else: iecsize = "%d MB" % iecsize info['hdd'].append({ "model": hdd.model(), "capacity": size, "labelled_capacity": iecsize, "free": free }) info['transcoding'] = False if (info['model'] in ("Solo4K", "Solo²", "Duo²", "Solo SE", "Quad", "Quad Plus") or info['machinebuild'] in ('inihdp', 'hd2400', 'et10000', 'xpeedlx3', 'ew7356', 'dags3', 'dags4')): if os.path.exists(eEnv.resolve('${libdir}/enigma2/python/Plugins/SystemPlugins/TransCodingSetup/plugin.pyo')) or os.path.exists(eEnv.resolve('${libdir}/enigma2/python/Plugins/SystemPlugins/TranscodingSetup/plugin.pyo')) or os.path.exists(eEnv.resolve('${libdir}/enigma2/python/Plugins/SystemPlugins/MultiTransCodingSetup/plugin.pyo')): info['transcoding'] = True info['kinopoisk'] = False lang = ['ru', 'uk', 'lv', 'lt', 'et'] for l in lang: if l in language.getLanguage(): info['kinopoisk'] = True global STATICBOXINFO STATICBOXINFO = info return info
def updateStatus(self): print("[TVCharts] Status Update ...") self.DBStatusTimer.stop() if not config.plugins.tvcharts.enabled.value or Screens.Standby.inStandby: return # Get Channelname sref = self.session.nav.getCurrentlyPlayingServiceReference() if sref is not None: ref = eServiceReference(sref.toString()) ref.setName("") serviceHandler = eServiceCenter.getInstance() info = serviceHandler.info(ref) channel_name = info and info.getName(ref).replace( '\xc2\x86', '').replace('\xc2\x87', '').decode( "utf-8", "ignore").encode("utf-8") or "" self.serviceref = ref.toString() else: channel_name = "" self.serviceref = "" # Get Event Info service = self.session.nav.getCurrentService() info = service and service.info() event = info and info.getEvent(0) event_name = event and event.getEventName() or "" event_description = "" event_begin = 0 if event is not None: curEvent = parseEvent(event) event_begin = int( curEvent[0]) + (config.recording.margin_before.getValue() * 60) event_description = event.getExtendedDescription() # Get Box Info self.BoxID = iNetwork.getAdapterAttribute("eth0", "mac") self.DeviceName = HardwareInfo().get_device_name() try: from enigma import getEnigmaVersionString from boxbranding import getImageVersion, getImageBuild self.EnigmaVersion = getEnigmaVersionString() self.ImageVersion = getImageVersion() + '.' + getImageBuild() except: self.EnigmaVersion = about.getEnigmaVersionString() self.ImageVersion = about.getVersionString() # Get TimerList self.timerlist = "" if config.plugins.tvcharts.submittimers.value and self.LastTimerlistUpdate <= ( time() - 1800): self.LastTimerlistUpdate = time() try: for timer in self.recordtimer.timer_list: if timer.disabled == 0 and timer.justplay == 0: self.timerlist += "%s|%s|%s|%s|%s|%s|%s\n" % ( timer.eit, str( int(timer.begin) + (config.recording.margin_before.getValue() * 60)), str( int(timer.end) - (config.recording.margin_after.getValue() * 60)), str(timer.service_ref), timer.name, timer.service_ref.getServiceName().replace( '\xc2\x86', '').replace('\xc2\x87', '').decode( "utf-8", "ignore").encode("utf-8"), timer.repeated) except Exception: print("[TVCharts] Error loading timers!") # Get Pluginlist if config.plugins.tvcharts.submitplugins.value and self.pluginlist == "": try: os_system( "opkg list_installed | grep enigma2-plugin- > /tmp/plugins.txt" ) for plugin in open('/tmp/plugins.txt', 'r'): self.pluginlist += plugin[0:plugin.find(' - ')] + "\n" os_system("rm -f /tmp/plugins.txt") except Exception: print("[TVCharts] Error loading plugins!") # Status Update getPage( url='http://www.dreambox-plugins.de/feeds/TVCharts/status.php', agent="Mozilla/5.0 (Windows; U; MSIE 7.0; Windows NT 6.0; en-US)", timeout=60, method='POST', headers={ 'Content-Type': 'application/x-www-form-urlencoded' }, postdata=urlencode({ 'boxid': self.BoxID, 'devicename': self.DeviceName, 'imageversion': self.ImageVersion, 'enigmaversion': self.EnigmaVersion, 'lastchannel': channel_name, 'lastevent': event_name, 'eventdescr': event_description, 'lastbegin': event_begin, 'lastserviceref': self.serviceref, 'timerlist': self.timerlist, 'pluginlist': self.pluginlist })).addErrback(self.updateError) # Restart Timer self.DBStatusTimer.start(900000, True)
from Components.Sources.StaticText import StaticText from Screens.Console import Console from Screens.MessageBox import MessageBox from Screens.ChoiceBox import ChoiceBox from Screens.Screen import Screen from Screens.Console import Console from Screens.HelpMenu import HelpableScreen from Screens.TaskView import JobView from Tools.Downloader import downloadWithProgress import urllib2 import os import shutil import math from boxbranding import getBoxType, getImageDistro, getMachineName, getMachineBrand, getImageVersion distro = getImageDistro() ImageVersion = getImageVersion() ############################################################################################################# image = 0 # 0=openATV / 1=openMips if distro.lower() == "openmips": image = 1 elif distro.lower() == "openatv": image = 0 feedurl_atv = 'http://images.mynonpublic.com/openatv/%s' % ImageVersion if ImageVersion == '4.1' or ImageVersion == '4.0' or ImageVersion == '3.0': ImageVersion2 = '4.2' else: ImageVersion2 = '4.1' feedurl_atv2 = 'http://images.mynonpublic.com/openatv/%s' % ImageVersion2 feedurl_om = 'http://image.openmips.com/4.2' imagePath = '/media/hdd/images'
import sys import os from time import time if os.path.isfile("/usr/lib/enigma2/python/enigma.zip"): sys.path.append("/usr/lib/enigma2/python/enigma.zip") from Tools.Profile import profile, profile_final profile("PYTHON_START") import Tools.RedirectOutput from boxbranding import getBrandOEM, getImageVersion, getImageBuild, getImageDevBuild, getImageType print "[Image Type] %s" % getImageType() print "[Image Version] %s" % getImageVersion() print "[Image Build] %s" % getImageBuild() if getImageType() != 'release': print "[Image DevBuild] %s" % getImageDevBuild() import enigma import eConsoleImpl import eBaseImpl enigma.eTimer = eBaseImpl.eTimer enigma.eSocketNotifier = eBaseImpl.eSocketNotifier enigma.eConsoleAppContainer = eConsoleImpl.eConsoleAppContainer from traceback import print_exc profile("SimpleSummary") from Screens import InfoBar from Screens.SimpleSummary import SimpleSummary from sys import stdout, exc_info
def Stage5(self): tmplist = config.backupmanager.backupdirs.value tmplist.append('/tmp/ExtraInstalledPlugins') tmplist.append('/tmp/backupkernelversion') tmplist.append('/tmp/backupimageversion') if path.exists('/tmp/3rdPartyPlugins'): tmplist.append('/tmp/3rdPartyPlugins') if path.exists('/tmp/3rdPartyPluginsLocation'): tmplist.append('/tmp/3rdPartyPluginsLocation') self.backupdirs = ' '.join(tmplist) print '[BackupManager] Backup running' backupdate = datetime.now() if self.updatebackup: self.Backupfile = self.BackupDirectory + config.backupmanager.folderprefix.value + '-SoftwareUpdate-' + getImageVersion() + '.' + getImageBuild() + '-' + backupdate.strftime("%Y-%m-%d_%H-%M") + '.tar.gz' else: self.Backupfile = self.BackupDirectory + config.backupmanager.folderprefix.value + '-' + getImageVersion() + '.' + getImageBuild() + '-' + backupdate.strftime("%Y-%m-%d_%H-%M") + '.tar.gz' self.Console.ePopen('tar -czvf ' + self.Backupfile + ' ' + self.backupdirs, self.Stage4Complete)
def populate(self): self["lab1"] = StaticText(_("Open Black Hole")) self["lab2"] = StaticText(_("From the BH Team")) model = None AboutText = "" self["lab3"] = StaticText( _("Support at %s") % "www.vuplus-community.net") AboutText += _("Model:\t%s %s\n") % (getMachineBrand(), getMachineName()) if about.getChipSetString() != _("unavailable"): if SystemInfo["HasHiSi"]: AboutText += _("Chipset:\tHiSilicon %s\n" ) % about.getChipSetString().upper() elif about.getIsBroadcom(): AboutText += _("Chipset:\tBroadcom %s\n" ) % about.getChipSetString().upper() else: AboutText += _( "Chipset:\t%s\n") % about.getChipSetString().upper() AboutText += _("CPU:\t%s %s %s\n") % (about.getCPUArch(), about.getCPUSpeedString(), about.getCpuCoresString()) imageSubBuild = "" if getImageType() != 'release': imageSubBuild = ".%s" % getImageDevBuild() AboutText += _("Image:\t%s.%s%s (%s)\n") % (getImageVersion( ), getImageBuild(), imageSubBuild, getImageType().title()) if SystemInfo["HasH9SD"]: if "rootfstype=ext4" in open( '/sys/firmware/devicetree/base/chosen/bootargs', 'r').read(): part = " - SD card in use for Image root \n" else: part = " - eMMC slot in use for Image root \n" AboutText += _("%s") % part if SystemInfo["canMultiBoot"]: slot = image = GetCurrentImage() part = "eMMC slot %s" % slot bootmode = "" if SystemInfo["canMode12"]: bootmode = "bootmode = %s" % GetCurrentImageMode() print "[About] HasHiSi = %s, slot = %s" % (SystemInfo["HasHiSi"], slot) if SystemInfo["HasHiSi"] and "sda" in SystemInfo["canMultiBoot"][ slot]['root']: if slot > 4: image -= 4 else: image -= 1 part = "SDcard slot %s (%s) " % ( image, SystemInfo["canMultiBoot"][slot]['root']) AboutText += _("Image Slot:\t%s") % "STARTUP_" + str( slot) + " " + part + " " + bootmode + "\n" skinWidth = getDesktop(0).size().width() skinHeight = getDesktop(0).size().height() string = getDriverDate() year = string[0:4] month = string[4:6] day = string[6:8] driversdate = '-'.join((year, month, day)) AboutText += _("Drivers:\t%s\n") % driversdate AboutText += _("Kernel:\t%s\n") % about.getKernelVersionString() AboutText += _("GStreamer:\t%s\n") % about.getGStreamerVersionString( ).replace("GStreamer ", "") FFmpegVersion = about.getFFmpegVersionString() if FFmpegVersion != "": FFmpegVersion = _("FFmpeg version:\t") + FFmpegVersion self["FFmpegVersion"] = StaticText(FFmpegVersion) AboutText += FFmpegVersion + "\n" AboutText += _("Python:\t%s\n") % about.getPythonVersionString() AboutText += _("Installed:\t%s\n") % about.getFlashDateString() AboutText += _("Last update:\t%s\n") % getEnigmaVersionString() AboutText += _("E2 (re)starts:\t%s\n") % config.misc.startCounter.value AboutText += _("Skin:\t%s") % config.skin.primary_skin.value[0:-9] + _( " (%s x %s)") % (skinWidth, skinHeight) + "\n" tempinfo = "" if path.exists('/proc/stb/sensors/temp0/value'): with open('/proc/stb/sensors/temp0/value', 'r') as f: tempinfo = f.read() elif path.exists('/proc/stb/fp/temp_sensor'): with open('/proc/stb/fp/temp_sensor', 'r') as f: tempinfo = f.read() elif path.exists('/proc/stb/sensors/temp/value'): with open('/proc/stb/sensors/temp/value', 'r') as f: tempinfo = f.read() if tempinfo and int(tempinfo.replace('\n', '')) > 0: mark = str('\xc2\xb0') AboutText += _("System temp:\t%s") % tempinfo.replace( '\n', '').replace(' ', '') + mark + "C\n" tempinfo = "" if path.exists('/proc/stb/fp/temp_sensor_avs'): with open('/proc/stb/fp/temp_sensor_avs', 'r') as f: tempinfo = f.read() elif path.exists('/sys/devices/virtual/thermal/thermal_zone0/temp'): try: with open('/sys/devices/virtual/thermal/thermal_zone0/temp', 'r') as f: tempinfo = f.read() tempinfo = tempinfo[:-4] except: tempinfo = "" elif path.exists('/proc/hisi/msp/pm_cpu'): try: tempinfo = search( 'temperature = (\d+) degree', open("/proc/hisi/msp/pm_cpu").read()).group(1) except: tempinfo = "" if tempinfo and int(tempinfo) > 0: mark = str('\xc2\xb0') AboutText += _("Processor temp:\t%s") % tempinfo.replace( '\n', '').replace(' ', '') + mark + "C\n" AboutLcdText = AboutText.replace('\t', ' ') fp_version = getFPVersion() if fp_version is None: fp_version = "" elif fp_version != 0: fp_version = _("FP version:\t%s") % fp_version AboutText += fp_version + "\n" bootloader = "" if path.exists('/sys/firmware/devicetree/base/bolt/tag'): f = open('/sys/firmware/devicetree/base/bolt/tag', 'r') bootloader = f.readline().replace('\x00', '').replace('\n', '') f.close() AboutText += _("Bootloader:\t%s\n") % (bootloader) self["AboutScrollLabel"] = ScrollLabel(AboutText)
def getEnigmaVersionString(): return getImageVersion()
def getVersionString(): return getImageVersion()
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 ImageList(self, imagedict): self.saveImageList = imagedict list = [] currentimageslot = GetCurrentImage() or 1 print "[Image Backup] Current Image Slot %s, Imagelist %s"% ( currentimageslot, imagedict) if imagedict: for x in sorted(imagedict.keys()): if imagedict[x]["imagename"] != _("Empty slot"): if x == 1 and currentimageslot == 1 and SystemInfo["canRecovery"]: list.append(ChoiceEntryComponent('',(_("slot%s - %s as USB Recovery") % (x, imagedict[x]["imagename"]), x, True))) list.append(ChoiceEntryComponent('',((_("slot%s - %s (current image)") if x == currentimageslot else _("slot%s - %s")) % (x, imagedict[x]["imagename"]), x, False))) else: if SystemInfo["canRecovery"]: list.append(ChoiceEntryComponent('',(_("internal flash: %s %s as USB Recovery") %(getImageDistro(), getImageVersion()),"x",True))) list.append(ChoiceEntryComponent('',(_("internal flash: %s %s ") %(getImageDistro(), getImageVersion()),"x",False))) self["config"].setList(list)