Exemple #1
0
    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
        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()
        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())
Exemple #2
0
def generateInformation():
    from os import popen
    from Tools.DreamboxHardware import getFPVersion
    from Components.Harddisk import harddiskmanager
    from Components.NimManager import nimmanager
    from Components.About import about

    def command(cmd):
        try:
            result = popen(cmd, "r").read().strip()
            return str(result)
        except:
            pass

    information = [
        "kernel         : %s\n" % (command("uname -a")),
        "version        : %s (%s)\n" % (str(about.getImageVersionString()),
                                        str(about.getEnigmaVersionString())),
        "frontprocessor : %s\n" % (str(getFPVersion())),
        "frontend       : %s\n" % (str(nimmanager.nimList())),
        "hdd info       : %s\n" % (str(harddiskmanager.HDDList())),
        "network information : \n%s\n" % (command("ifconfig -a"))
    ]
    f = open("/tmp/machine.info", 'w')
    f.writelines(information)
    f.close()
Exemple #3
0
def Plugins(**kwargs):
    from Tools.DreamboxHardware import getFPVersion
    from Screens.MessageBox import MessageBox

    version = getFPVersion()
    newversion = getUpgradeVersion() or 0
    list = []
    if version is not None and version < newversion:
        list.append(
            PluginDescriptor(name="FP Upgrade",
                             where=PluginDescriptor.WHERE_WIZARD,
                             needsRestart=True,
                             fnc=(8, FPUpgrade)))

    try:
        msg = open("/proc/stb/message").read()
        list.append(
            PluginDescriptor(name="System Message Check",
                             where=PluginDescriptor.WHERE_WIZARD,
                             needsRestart=True,
                             fnc=(9, SystemMessage, msg)))
    except:
        pass

    return list
Exemple #4
0
def Plugins(**kwargs):
	from Tools.DreamboxHardware import getFPVersion
	version = getFPVersion()
	newversion = getUpgradeVersion() or 0
	if version is not None and version < newversion:
		return PluginDescriptor(name="FP Upgrade", where = PluginDescriptor.WHERE_WIZARD, fnc=(8, FPUpgrade))
	else:
		return [ ]
 def _fpUpdateText(self):
     self._numTries = 0
     updateText = _(
         "There is a new firmware for your frontprocessor available. Update now?"
     )
     if getFPVersion() <= 1.12:
         updateText += _(
             "\n\n!!! ATTENTION !!!\nDue to major firmware changes you can not downgrade to images dated before this one anymore!\nThis update is mandatory and should not be skipped!\n!!! ATTENTION !!!!"
         )
     return updateText
Exemple #6
0
	def __init__(self, session):
		Screen.__init__(self, session)

		self["EnigmaVersion"] = StaticText("Enigma2: " + about.getEnigmaVersionString())
		self["ImageVersion"] = StaticText("Image: " + about.getImageVersionString())

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

		fp_version = getFPVersion()
		if fp_version is None:
			fp_version = ""
		else:
			fp_version = _("Frontprocessor version: %d") % fp_version

		self["FPVersion"] = StaticText(fp_version)

		nims = nimmanager.nimList()
		for count in (0, 1, 2, 3):
			if count < len(nims):
				self["Tuner" + str(count)] = StaticText(nims[count])
			else:
				self["Tuner" + str(count)] = StaticText("")

		self["HDDHeader"] = StaticText(_("Detected HDD:"))
		hddlist = harddiskmanager.HDDList()
		hdd = hddlist and hddlist[0][1] or None
		if hdd is not None and hdd.model() != "":
			self["hddA"] = StaticText(_("%s\n(%s, %d MB free)") % (hdd.model(), hdd.capacity(),hdd.free()))
		else:
			self["hddA"] = StaticText(_("none"))

		self["IPHeader"] = StaticText(_("Current IP Address:"))
		iNetwork = resourcemanager.getResource("iNetwork")
		ifaces = iNetwork.getConfiguredAdapters()
		convertIP = lambda l: "%s.%s.%s.%s" % tuple(l) if l and len(l) == 4 else "0.0.0.0"
		ipA = _("none")
		if len(ifaces) > 0:
			iface = ifaces[0]
			ip = iNetwork.getAdapterAttribute(iface, "ip")
			name = iNetwork.getFriendlyAdapterName(iface)
			if ip != None:
				ipA = "%s (%s)" %(convertIP(ip), name)
		self["ipA"] = StaticText(ipA)

		self["actions"] = ActionMap(["SetupActions", "ColorActions"],
			{
				"cancel": self.close,
				"ok": self.close,
				"green": self.showTranslationInfo
			})
Exemple #7
0
def Plugins(**kwargs):
	from Tools.DreamboxHardware import getFPVersion

	version = getFPVersion()
	newversion = getUpgradeVersion() or 0
	list = []
	if version is not None and version < newversion:
		list.append(PluginDescriptor(name="FP Upgrade", where = PluginDescriptor.WHERE_WIZARD, needsRestart = True, fnc=(8, FPUpgrade)))

	try:
		msg = open("/proc/stb/message").read()
		list.append(PluginDescriptor(name="System Message Check", where = PluginDescriptor.WHERE_WIZARD, needsRestart = True, fnc=(9, SystemMessage, msg)))
	except:
		pass

	return list
Exemple #8
0
	def __init__(self, session):
		Screen.__init__(self, session)

		self["EnigmaVersion"] = StaticText("Dreambox OS: " + about.getEnigmaVersionString())
		self["ImageVersion"] = StaticText("Image: " + about.getImageVersionString())

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

		fp_version = getFPVersion()
		if fp_version is None:
			fp_version = ""
		else:
			fp_version = _("Frontprocessor version: %d") % fp_version

		self["FPVersion"] = StaticText(fp_version)

		nims = nimmanager.nimList()
		for count in (0, 1, 2, 3):
			if count < len(nims):
				self["Tuner" + str(count)] = StaticText(nims[count])
			else:
				self["Tuner" + str(count)] = StaticText("")

		self["HDDHeader"] = StaticText(_("Detected HDD:"))
		hddlist = harddiskmanager.HDDList()
		hdd = hddlist and hddlist[0][1] or None
		if hdd is not None and hdd.model() != "":
			self["hddA"] = StaticText(_("%s\n(%s, %d MB free)") % (hdd.model(), hdd.capacity(),hdd.free()))
		else:
			self["hddA"] = StaticText(_("none"))

		self["IPHeader"] = StaticText(_("Current IP Address:"))

		ipA = _("none")
		services = eNetworkManager.getInstance().getServices()
		for service in services:
			ip = self.getServiceIP(service)
			name = service.name()
			if ip != None:
				ipA = "%s (%s)" %(ip, name)
		self["ipA"] = StaticText(ipA)
		self["actions"] = ActionMap(["SetupActions", "ColorActions"],
			{
				"cancel": self.close,
				"ok": self.close,
				"green": self.showTranslationInfo
			})
Exemple #9
0
	def __init__(self, session):
		self.skin = FPUpgrade.skin
		Screen.__init__(self, session)
		
		from Tools.DreamboxHardware import getFPVersion
		version = str(getFPVersion() or "N/A")
		newversion = str(getUpgradeVersion() or "N/A")

		self["text"] = Label(_("Your frontprocessor firmware must be upgraded.\nPress OK to start upgrade."))
		self["oldversion_label"] = Label(_("Current version:"))
		self["newversion_label"] = Label(_("New version:"))

		self["oldversion"] = Label(version)
		self["newversion"] = Label(newversion)

		self["actions"] = ActionMap(["OkCancelActions"],
		{
			"ok": self.ok,
			"cancel": self.close,
		})
    def __init__(self, session):
        Screen.__init__(self, session)

        self["EnigmaVersion"] = StaticText("Enigma: " +
                                           about.getEnigmaVersionString())
        self["ImageVersion"] = StaticText("Evolution: " +
                                          about.getImageVersionString())

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

        fp_version = getFPVersion()
        if fp_version is None:
            fp_version = ""
        else:
            fp_version = _("Frontprocessor version: %d") % fp_version

        self["FPVersion"] = StaticText(fp_version)

        nims = nimmanager.nimList()
        for count in (0, 1, 2, 3):
            if count < len(nims):
                self["Tuner" + str(count)] = StaticText(nims[count])
            else:
                self["Tuner" + str(count)] = StaticText("")

        self["HDDHeader"] = StaticText(_("Detected HDD:"))
        hddlist = harddiskmanager.HDDList()
        hdd = hddlist and hddlist[0][1] or None
        if hdd is not None and hdd.model() != "":
            self["hddA"] = StaticText(
                _("%s\n(%s, %d MB free)") %
                (hdd.model(), hdd.capacity(), hdd.free()))
        else:
            self["hddA"] = StaticText(_("none"))

        self["actions"] = ActionMap(
            ["SetupActions", "ColorActions"], {
                "cancel": self.close,
                "ok": self.close,
                "green": self.showTranslationInfo
            })
	def __init__(self, session, request):
		WebScreen.__init__(self, session, request)
		from WebComponents.Sources.Network import Network
		from WebComponents.Sources.Hdd import Hdd
		from WebComponents.Sources.Frontend import Frontend
		from Components.config import config
		from Components.About import about
		from Components.Sources.StaticText import StaticText
		from Tools.DreamboxHardware import getFPVersion
		from Tools.HardwareInfo import HardwareInfo

		hw = HardwareInfo()

		self["Network"] = Network()
		self["Hdd"] = Hdd()
		self["Frontends"] = Frontend()
		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())
Exemple #12
0
def generateInformation():
	from os import popen
	from Tools.DreamboxHardware import getFPVersion
	from Components.Harddisk import harddiskmanager
	from Components.NimManager import nimmanager
	from Components.About import about
	def command(cmd):
		try:
			result = popen(cmd, "r").read().strip()
			return str(result)
		except:
			pass
	information = [
		 "kernel         : %s\n"%(command("uname -a"))
		,"version        : %s (%s)\n"%(str(about.getImageVersionString()), str(about.getEnigmaVersionString()))
		,"frontprocessor : %s\n"%(str(getFPVersion()))
		,"frontend       : %s\n"%(str(nimmanager.nimList()))
		,"hdd info       : %s\n"%(str(harddiskmanager.HDDList()))
		,"network information : \n%s\n"%(command("ifconfig -a"))
		]
	f = open("/tmp/machine.info", 'w')
	f.writelines(information)
	f.close()
Exemple #13
0
	def __init__(self, session):
		Screen.__init__(self, session)

		self["EnigmaVersion"] = StaticText("Version: " + about.getEnigmaVersionString())
		self["ImageVersion"] = StaticText("Image: " + about.getImageVersionString())

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

		fp_version = getFPVersion()
		if fp_version is None:
			fp_version = ""
		else:
			fp_version = _("Frontprocessor version: %d") % fp_version

		self["FPVersion"] = StaticText(fp_version)

		nims = nimmanager.nimList()
		for count in (0, 1, 2, 3):
			if count < len(nims):
				self["Tuner" + str(count)] = StaticText(nims[count])
			else:
				self["Tuner" + str(count)] = StaticText("")

		self["HDDHeader"] = StaticText(_("Detected HDD:"))
		hddlist = harddiskmanager.HDDList()
		hdd = hddlist and hddlist[0][1] or None
		if hdd is not None and hdd.model() != "":
			self["hddA"] = StaticText(_("%s\n(%s, %d MB free)") % (hdd.model(), hdd.capacity(),hdd.free()))
		else:
			self["hddA"] = StaticText(_("none"))

		self["actions"] = ActionMap(["SetupActions", "ColorActions"], 
			{
				"cancel": self.close,
				"ok": self.close,
				"green": self.showTranslationInfo
			})
Exemple #14
0
    def __init__(self, session):
        Screen.__init__(self, session)

        AboutText = _("Hardware: ") + about.getHardwareTypeString() + "\n"
        AboutText += _("Image: ") + about.getImageTypeString() + "\n"
        AboutText += _(
            "Kernel Version: ") + about.getKernelVersionString() + "\n"

        EnigmaVersion = "Enigma: " + about.getEnigmaVersionString()
        self["EnigmaVersion"] = StaticText(EnigmaVersion)
        AboutText += EnigmaVersion + "\n"

        ImageVersion = _("Last Upgrade: ") + about.getImageVersionString()
        self["ImageVersion"] = StaticText(ImageVersion)
        AboutText += ImageVersion + "\n"

        fp_version = getFPVersion()
        if fp_version is None:
            fp_version = ""
        else:
            fp_version = _("Frontprocessor version: %d") % fp_version
            AboutText += fp_version + "\n"

        self["FPVersion"] = StaticText(fp_version)

        self["TunerHeader"] = StaticText(_("Detected NIMs:"))
        AboutText += "\n" + _("Detected NIMs:") + "\n"

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

        self["HDDHeader"] = StaticText(_("Detected HDD:"))
        AboutText += "\n" + _("Detected HDD:") + "\n"

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

        self["actions"] = ActionMap(
            ["SetupActions", "ColorActions", "DirectionActions"], {
                "cancel": self.close,
                "ok": self.close,
                "green": self.showTranslationInfo,
                "up": self["AboutScrollLabel"].pageUp,
                "down": self["AboutScrollLabel"].pageDown
            })
Exemple #15
0
    def __init__(self, session):
        Screen.__init__(self, session)
        logoname = "Hypercube"
        # show
        # 		try:
        # 			fd = open("/proc/stb/info/eeprom/customer_id",'r');
        # 			costomid = fd.read(8)
        # 			print costomid
        # 			for cust in custidlist:
        # 				if cust["custid"] == costomid:
        # 					logoname = cust["custname"]
        # 					break
        # 		except:
        # 			pass

        self["AboutTitle"] = StaticText("About " + logoname)
        # 		AboutText = _("Hardware: ") + about.getHardwareTypeString() + "\n"
        AboutText = _("Hardware: ") + logoname + "\n"
        AboutText += _("Image: ") + about.getImageTypeString() + "\n"
        AboutText += _("Kernel Version: ") + about.getKernelVersionString() + "\n"

        EnigmaVersion = "Enigma: " + about.getEnigmaVersionString()
        self["EnigmaVersion"] = StaticText(EnigmaVersion)
        AboutText += EnigmaVersion + "\n"

        ImageVersion = _("Last Upgrade: ") + about.getImageVersionString()
        self["ImageVersion"] = StaticText(ImageVersion)
        AboutText += ImageVersion + "\n"

        fp_version = getFPVersion()
        if fp_version is None:
            fp_version = ""
        else:
            fp_version = _("Frontprocessor version: %d") % fp_version
            AboutText += fp_version + "\n"

        self["FPVersion"] = StaticText(fp_version)

        self["TunerHeader"] = StaticText(_("Detected NIMs:"))
        AboutText += "\n" + _("Detected NIMs:") + "\n"

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

        self["HDDHeader"] = StaticText(_("Detected HDD:"))
        AboutText += "\n" + _("Detected HDD:") + "\n"

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

        self["actions"] = ActionMap(
            ["SetupActions", "ColorActions", "DirectionActions"],
            {
                "cancel": self.close,
                "ok": self.close,
                "green": self.showTranslationInfo,
                "up": self["AboutScrollLabel"].pageUp,
                "down": self["AboutScrollLabel"].pageDown,
            },
        )
Exemple #16
0
    def __init__(self, session):
        Screen.__init__(self, session)
        logoname = "Hypercube"
        # show
        #		try:
        #			fd = open("/proc/stb/info/eeprom/customer_id",'r');
        #			costomid = fd.read(8)
        #			print costomid
        #			for cust in custidlist:
        #				if cust["custid"] == costomid:
        #					logoname = cust["custname"]
        #					break
        #		except:
        #			pass

        self["AboutTitle"] = StaticText("About " + logoname)
        #		AboutText = _("Hardware: ") + about.getHardwareTypeString() + "\n"
        AboutText = _("Hardware: ") + logoname + "\n"
        AboutText += _("Image: ") + about.getImageTypeString() + "\n"
        AboutText += _(
            "Kernel Version: ") + about.getKernelVersionString() + "\n"

        EnigmaVersion = "Enigma: " + about.getEnigmaVersionString()
        self["EnigmaVersion"] = StaticText(EnigmaVersion)
        AboutText += EnigmaVersion + "\n"

        ImageVersion = _("Last Upgrade: ") + about.getImageVersionString()
        self["ImageVersion"] = StaticText(ImageVersion)
        AboutText += ImageVersion + "\n"

        fp_version = getFPVersion()
        if fp_version is None:
            fp_version = ""
        else:
            fp_version = _("Frontprocessor version: %d") % fp_version
            AboutText += fp_version + "\n"

        self["FPVersion"] = StaticText(fp_version)

        self["TunerHeader"] = StaticText(_("Detected NIMs:"))
        AboutText += "\n" + _("Detected NIMs:") + "\n"

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

        self["HDDHeader"] = StaticText(_("Detected HDD:"))
        AboutText += "\n" + _("Detected HDD:") + "\n"

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

        self["actions"] = ActionMap(
            ["SetupActions", "ColorActions", "DirectionActions"], {
                "cancel": self.close,
                "ok": self.close,
                "green": self.showTranslationInfo,
                "up": self["AboutScrollLabel"].pageUp,
                "down": self["AboutScrollLabel"].pageDown
            })
Exemple #17
0
def getInfo():
	# TODO: get webif versione somewhere!
	info = {}

	brand = "Dream Multimedia"
	model = "unknown"
	chipset = "unknown"
	
	if fileExists("/proc/stb/info/vumodel"):
		brand = "Vuplus"
		f = open("/proc/stb/info/vumodel",'r')
 		model = f.readline().strip()
 		f.close()
	elif fileExists("/proc/stb/info/boxtype"):
		brand = "Clarke-Xtrend"
		f = open("/proc/stb/info/boxtype",'r')
 		model = f.readline().strip()
 		f.close()
	else:
		f = open("/proc/stb/info/model",'r')
 		model = f.readline().strip()
 		f.close()

	info['brand'] = brand
	info['model'] = model

	if fileExists("/proc/stb/info/chipset"):
		f = open("/proc/stb/info/chipset",'r')
 		chipset = f.readline().strip()
 		f.close()
		
	info['chipset'] = chipset
	
	f = open("/proc/meminfo",'r')
 	parts = f.readline().split(':')
	info['mem1'] = parts[1].strip()
	parts = f.readline().split(':')
	info['mem2'] = parts[1].strip()
	f.close()
		
	f = os.popen("uptime")
	parts = f.readline().split(',')
	info['uptime'] = parts[0].strip()
	f.close()
		
	if fileExists("/etc/bhversion"):
		f = open("/etc/bhversion",'r')
		imagever = f.readline().strip()
		f.close()
	else:
		imagever = about.getImageVersionString()
		
	info["webifver"] = "0.0.0"
	info['imagever'] = imagever
	info['enigmaver'] = about.getEnigmaVersionString()
	info['kernelver'] = about.getKernelVersionString()
	
	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")),
			"gw": formatIp(iNetwork.getAdapterAttribute(iface, "gateway"))
		})
			
	info['hdd'] = []
	for hdd in harddiskmanager.hdd:
		if hdd.free() <= 1024:
			free = "%i MB" % (hdd.free())
		else:
			free = float(hdd.free()) / float(1024)
			free = "%.3f GB" % free
		info['hdd'].append({
			"model": hdd.model(),
			"capacity": hdd.capacity(),
			"free": free
		})
	return info
Exemple #18
0
    def __init__(self, session):
        Screen.__init__(self, session)

        AboutText = _("Hardware: ") + about.getHardwareTypeString() + "\n"
        AboutText += _("Image: ") + about.getImageTypeString() + "\n"
        AboutText += _("Kernel version: ") + about.getKernelVersionString() + "\n"

        EnigmaVersion = "Enigma: " + about.getEnigmaVersionString()
        self["EnigmaVersion"] = StaticText(EnigmaVersion)
        AboutText += EnigmaVersion + "\n"

        ImageVersion = _("Last upgrade: ") + about.getImageVersionString()
        self["ImageVersion"] = StaticText(ImageVersion)
        AboutText += ImageVersion + "\n"

        fp_version = getFPVersion()
        if fp_version is None:
            fp_version = ""
        else:
            fp_version = _("Frontprocessor version: %d") % fp_version
            AboutText += fp_version + "\n"

        self["FPVersion"] = StaticText(fp_version)

        self["TunerHeader"] = StaticText(_("Detected NIMs:"))
        AboutText += "\n" + _("Detected NIMs:") + "\n"

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

        self["HDDHeader"] = StaticText(_("Detected HDD:"))
        AboutText += "\n" + _("Detected HDD:") + "\n"

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

        self["actions"] = ActionMap(
            ["ColorActions", "SetupActions", "DirectionActions"],
            {
                "cancel": self.close,
                "ok": self.close,
                "red": self.showCommits,
                "green": self.showTranslationInfo,
                "up": self["AboutScrollLabel"].pageUp,
                "down": self["AboutScrollLabel"].pageDown,
            },
        )
Exemple #19
0
def getInfo():
    # TODO: get webif versione somewhere!
    info = {}

    brand = "Dream Multimedia"
    model = "unknown"
    chipset = "unknown"

    if fileExists("/usr/local/e2/etc/stb/info/vumodel"):
        brand = "Vuplus"
        f = open("/usr/local/e2/etc/stb/info/vumodel", 'r')
        model = f.readline().strip()
        f.close()
    elif fileExists("/usr/local/e2/etc/stb/info/boxtype"):
        brand = "Clarke-Xtrend"
        f = open("/usr/local/e2/etc/stb/info/boxtype", 'r')
        model = f.readline().strip()
        f.close()
    else:
        f = open("/usr/local/e2/etc/stb/info/model", 'r')
        model = f.readline().strip()
        f.close()

    info['brand'] = brand
    info['model'] = model

    if fileExists("/usr/local/e2/etc/stb/info/chipset"):
        f = open("/usr/local/e2/etc/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

    if fileExists("/etc/bhversion"):
        f = open("/etc/bhversion", 'r')
        imagever = f.readline().strip()
        f.close()
    elif fileExists("/etc/vtiversion.info"):
        f = open("/etc/vtiversion.info", 'r')
        imagever = f.readline().strip()
        f.close()
    else:
        imagever = about.getImageVersionString()

    info["webifver"] = getOpenWebifVer()
    info['imagever'] = imagever
    info['enigmaver'] = about.getEnigmaVersionString()
    info['kernelver'] = about.getKernelVersionString()

    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")),
            "gw":
            formatIp(iNetwork.getAdapterAttribute(iface, "gateway"))
        })

    info['hdd'] = []
    for hdd in harddiskmanager.hdd:
        if hdd.free() <= 1024:
            free = "%i MB" % (hdd.free())
        else:
            free = float(hdd.free()) / float(1024)
            free = "%.3f GB" % free
        info['hdd'].append({
            "model": hdd.model(),
            "capacity": hdd.capacity(),
            "free": free
        })
    return info
Exemple #20
0
    def __init__(self, session):
        Screen.__init__(self, session)

        self["EnigmaVersion"] = StaticText("Version: " +
                                           about.getEnigmaVersionString())
        self["ImageVersion"] = StaticText("Image: " +
                                          about.getImageVersionString())

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

        fp_version = getFPVersion()
        if fp_version is None:
            fp_version = ""
        else:
            fp_version = _("Frontprocessor version: %d") % fp_version

        self["FPVersion"] = StaticText(fp_version)

        nims = nimmanager.nimList()
        if len(nims) <= 4:
            for count in (0, 1, 2, 3):
                if count < len(nims):
                    self["Tuner" + str(count)] = StaticText(nims[count])
                else:
                    self["Tuner" + str(count)] = StaticText("")
        else:
            desc_list = []
            count = 0
            cur_idx = -1
            while count < len(nims):
                data = nims[count].split(":")
                idx = data[0].strip('Tuner').strip()
                desc = data[1].strip()
                if desc_list and desc_list[cur_idx]['desc'] == desc:
                    desc_list[cur_idx]['end'] = idx
                else:
                    desc_list.append({'desc': desc, 'start': idx, 'end': idx})
                    cur_idx += 1
                count += 1

            for count in (0, 1, 2, 3):
                if count < len(desc_list):
                    if desc_list[count]['start'] == desc_list[count]['end']:
                        text = "Tuner %s: %s" % (desc_list[count]['start'],
                                                 desc_list[count]['desc'])
                    else:
                        text = "Tuner %s-%s: %s" % (desc_list[count]['start'],
                                                    desc_list[count]['end'],
                                                    desc_list[count]['desc'])
                else:
                    text = ""

                self["Tuner" + str(count)] = StaticText(text)

        self["HDDHeader"] = StaticText(_("Detected HDD:"))
        hddlist = harddiskmanager.HDDList()
        hdd = hddlist and hddlist[0][1] or None
        if hdd is not None and hdd.model() != "":
            self["hddA"] = StaticText(
                _("%s\n(%s, %d MB free)") %
                (hdd.model(), hdd.capacity(), hdd.free()))
        else:
            self["hddA"] = StaticText(_("none"))

        self["actions"] = ActionMap(["SetupActions", "ColorActions"], {
            "cancel": self.close,
            "ok": self.close,
        })
Exemple #21
0
    def __init__(self, session):
        Screen.__init__(self, session)

        self["Model"] = StaticText(api.enigma2.systeminfo.modelname())
        self["EnigmaVersion"] = StaticText("Dreambox OS: " +
                                           about.getEnigmaVersionString())
        self["ImageVersion"] = StaticText("Image: " +
                                          about.getImageVersionString())

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

        fp_version = getFPVersion()
        if fp_version is None:
            fp_version = ""
        else:
            fp_version = _("Frontprocessor version: %s") % fp_version

        self["FPVersion"] = StaticText(fp_version)

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

        self["HDDHeader"] = StaticText(_("Detected HDD:"))
        hdd = None
        hddlist = harddiskmanager.HDDList()
        defaultDisk = harddiskmanager.getDefaultStorageDevicebyUUID(
            config.storage_options.default_device.value)
        if defaultDisk:
            default_hdd = "/dev/%s" % (defaultDisk.device, )
            for hd in hddlist:
                hd = hd[1]
                if default_hdd.startswith(hd.getDeviceDir()):
                    Log.i("Default HDD matched! (%s -> %s)" %
                          (default_hdd, hd.getDeviceDir()))
                    hdd = hd
                    break
        if not hdd:
            hdd = hddlist and hddlist[0][1] or None
            Log.w(
                "No default Harddisk found. Falling back to first in list -> %s"
                % (hdd, ))

        if hdd is not None and hdd.model() != "":
            self["hddA"] = StaticText(
                _("%s\n(%s, %d MB free)") %
                (hdd.model(), hdd.capacity(), hdd.free()))
        else:
            self["hddA"] = StaticText(_("none"))

        self["IPHeader"] = StaticText(_("Current IP Address:"))

        ipA = _("none")
        services = eNetworkManager.getInstance().getServices()
        for service in services:
            ip = self.getServiceIP(service)
            name = service.name()
            if ip != None:
                ipA = "%s (%s)" % (ip, name)
        self["ipA"] = StaticText(ipA)
        self["actions"] = ActionMap(
            ["SetupActions", "ColorActions"], {
                "cancel": self.close,
                "ok": self.close,
                "green": self.showTranslationInfo
            })
Exemple #22
0
	def __init__(self, session):
		Screen.__init__(self, session)

		try:
			f = open("/etc/bpversion",'r')
 			name = f.readline().strip()
 			f.close()
		except:
			name = "Black Pole"
			
		
		AboutText = _("Hardware: ") + about.getHardwareTypeString() + "\n"
		AboutText += _("Image: ") + about.getImageTypeString() + "\n"
		AboutText += _("Kernel Version: ") + about.getKernelVersionString() + "\n"
		
		EnigmaVersion = "Firmware: " + name
		self["EnigmaVersion"] = StaticText(EnigmaVersion)
		AboutText += EnigmaVersion + "\n"
		
		ImageVersion = "Team Homesite: vuplus-community.net"
		self["ImageVersion"] = StaticText(ImageVersion)
		AboutText += ImageVersion + "\n"

		fp_version = getFPVersion()
		if fp_version is None:
			fp_version = ""
		else:
			fp_version = _("Frontprocessor version: %d") % fp_version
			AboutText += fp_version + "\n"

		self["FPVersion"] = StaticText(fp_version)
		
		self["TunerHeader"] = StaticText(_("Detected NIMs:"))
		AboutText += "\n" + _("Detected NIMs:") + "\n"

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

		self["HDDHeader"] = StaticText(_("Detected HDD:"))
		AboutText += "\n" + _("Detected HDD:") + "\n"

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

		self["actions"] = ActionMap(["SetupActions", "ColorActions", "DirectionActions"], 
			{
				"cancel": self.close,
				"ok": self.close,
				"green": self.showTranslationInfo,
				"up": self["AboutScrollLabel"].pageUp,
				"down": self["AboutScrollLabel"].pageDown
			})
Exemple #23
0
	def populate(self):
		self["lab1"] = StaticText(_("Virtuosso Image Xtreme"))
		self["lab2"] = StaticText(_("By Team ViX"))
		if config.misc.boxtype.value == 'vuuno':
			self["lab3"] = StaticText(_("Support at") + " www.vuplus-support.co.uk")
			self["BoxType"] = StaticText(_("Hardware:") + " Vu+ Uno")
			AboutText = _("Hardware:") + " Vu+ Uno\n"
		elif config.misc.boxtype.value == 'vuultimo':
			self["lab3"] = StaticText(_("Support at") + " www.vuplus-support.co.uk")
			self["BoxType"] = StaticText(_("Hardware:") + " Vu+ Ultimo")
			AboutText = _("Hardware:") + " Vu+ Ultimo\n"
		elif config.misc.boxtype.value == 'vusolo':
			self["lab3"] = StaticText(_("Support at") + " www.vuplus-support.co.uk")
			self["BoxType"] = StaticText(_("Hardware:") + " Vu+ Solo")
			AboutText = _("Hardware:") + " Vu+ Solo\n"
		elif config.misc.boxtype.value == 'vuduo':
			self["lab3"] = StaticText(_("Support at") + " www.vuplus-support.co.uk")
			self["BoxType"] = StaticText(_("Hardware:") + " Vu+ Duo")
			AboutText = _("Hardware:") + " Vu+ Duo\n"
		elif config.misc.boxtype.value == 'et5x00':
			self["lab3"] = StaticText(_("Support at") + " www.xtrend-support.co.uk")
			self["BoxType"] = StaticText(_("Hardware:") + " Xtrend ET5x00 Series")
			AboutText = _("Hardware:") + "  Xtrend ET5x00 Series\n"
		elif config.misc.boxtype.value == 'et6x00':
			self["lab3"] = StaticText(_("Support at") + " www.xtrend-support.co.uk")
			self["BoxType"] = StaticText(_("Hardware:") + " Xtrend ET6x00 Series")
			AboutText = _("Hardware:") + "  Xtrend ET6x00 Series\n"
		elif config.misc.boxtype.value == 'et9x00':
			self["lab3"] = StaticText(_("Support at") + " www.xtrend-support.co.uk")
			self["BoxType"] = StaticText(_("Hardware:") + " Xtrend ET9x00 Series")
			AboutText = _("Hardware:") + " Xtrend ET9x00 Series\n"
		elif config.misc.boxtype.value == 'odin':
			self["lab3"] = StaticText(_("Support at") + " www.odin-support.co.uk")
			self["BoxType"] = StaticText(_("Hardware:") + " Odin")
			AboutText = _("Hardware:") + " Odin\n"
		else:
			self["lab3"] = StaticText(_("Support at") + " www.world-of-satellite.co.uk")
			self["BoxType"] = StaticText(_("Hardware:") + " " + config.misc.boxtype.value)
			AboutText = _("Hardware:") + " " + config.misc.boxtype.value + "\n"

		self["KernelVersion"] = StaticText(_("Kernel:") + " " + about.getKernelVersionString())
		AboutText += _("Kernel:") + " " + about.getKernelVersionString() + "\n"
		self["DriversVersion"] = StaticText(_("Drivers:") + " " + about.getDriversString())
		AboutText += _("Drivers:") + " " + about.getDriversString() + "\n"
		self["ImageType"] = StaticText(_("Image:") + " " + about.getImageTypeString())
		AboutText += _("Image:") + " " + about.getImageTypeString() + "\n"
		self["ImageVersion"] = StaticText(_("Version:") + " " + about.getImageVersionString())
		AboutText += _("Version:") + " " + about.getImageVersionString() + "\n"
		self["BuildVersion"] = StaticText(_("Build:") + " " + about.getBuildVersionString())
		AboutText += _("Build:") + " " + about.getBuildVersionString() + "\n"
		self["EnigmaVersion"] = StaticText(_("Last Update:") + " " + about.getLastUpdateString())
		AboutText += _("Last Update:") + " " + about.getLastUpdateString() + "\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"
		self["FPVersion"] = StaticText(fp_version)

		self["TranslationHeader"] = StaticText(_("Translation:"))
		AboutText += _("Translation:") + "\n"

		# don't remove the string out of the _(), or it can't be "translated" anymore.
		# TRANSLATORS: Add here whatever should be shown in the "translator" about screen, up to 6 lines (use \n for newline)
		info = _("TRANSLATOR_INFO")

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

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

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

		self["TranslatorName"] = StaticText(translator_name)
		AboutText += translator_name + "\n\n"

		self["TranslationInfo"] = StaticText(info)
		AboutText += info

		self["AboutScrollLabel"] = ScrollLabel(AboutText)
Exemple #24
0
	def __init__(self, session):
		Screen.__init__(self, session)

		self["Model"] = StaticText(api.enigma2.systeminfo.modelname())
		self["EnigmaVersion"] = StaticText("Dreambox OS: " + about.getEnigmaVersionString())
		self["ImageVersion"] = StaticText("Image: " + about.getImageVersionString())

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

		fp_version = getFPVersion()
		if fp_version is None:
			fp_version = ""
		else:
			fp_version = _("Frontprocessor version: %s") % fp_version

		self["FPVersion"] = StaticText(fp_version)

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

		self["HDDHeader"] = StaticText(_("Detected HDD:"))
		hdd = None
		hddlist = harddiskmanager.HDDList()
		defaultDisk = harddiskmanager.getDefaultStorageDevicebyUUID(config.storage_options.default_device.value)
		if defaultDisk:
			default_hdd = "/dev/%s" %(defaultDisk.device,)
			for hd in hddlist:
				hd = hd[1]
				if default_hdd.startswith(hd.getDeviceDir()):
					Log.i("Default HDD matched! (%s -> %s)" %(default_hdd,hd.getDeviceDir()))
					hdd = hd
					break
		if not hdd:
			hdd = hddlist and hddlist[0][1] or None
			Log.w("No default Harddisk found. Falling back to first in list -> %s" %(hdd,))

		if hdd is not None and hdd.model() != "":
			self["hddA"] = StaticText(_("%s\n(%s, %d MB free)") % (hdd.model(), hdd.capacity(),hdd.free()))
		else:
			self["hddA"] = StaticText(_("none"))

		self["IPHeader"] = StaticText(_("Current IP Address:"))

		ipA = _("none")
		services = eNetworkManager.getInstance().getServices()
		for service in services:
			ip = self.getServiceIP(service)
			name = service.name()
			if ip != None:
				ipA = "%s (%s)" %(ip, name)
		self["ipA"] = StaticText(ipA)
		self["actions"] = ActionMap(["SetupActions", "ColorActions"],
			{
				"cancel": self.close,
				"ok": self.close,
				"green": self.showTranslationInfo
			})
Exemple #25
0
	def __init__(self, session):
		Screen.__init__(self, session)

		self["EnigmaVersion"] = StaticText(_("Version") + ": " + about.getEnigmaVersionString())
		self["ImageVersion"] = StaticText(_("Image") + ": " + about.getImageVersionString())

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

		fp_version = getFPVersion()
		if fp_version is None:
			fp_version = ""
		else:
			fp_version = _("Frontprocessor version: %d") % fp_version

		self["FPVersion"] = StaticText(fp_version)

		nims = nimmanager.nimList()
		self.tuner_list = []
		if len(nims) <= 4 :
			for count in (0, 1, 2, 3, 4, 5, 6, 7):
				if count < len(nims):
					self["Tuner" + str(count)] = StaticText(nims[count])
					self.tuner_list.append((nims[count] + "\n"))
				else:
					self["Tuner" + str(count)] = StaticText("")
		else:
			desc_list = []
			count = 0
			cur_idx = -1
			while count < len(nims):
				data = nims[count].split(":")
				idx = data[0].strip('Tuner').strip()
				desc = data[1].strip()
				if desc_list and desc_list[cur_idx]['desc'] == desc:
					desc_list[cur_idx]['end'] = idx
				else:
					desc_list.append({'desc' : desc, 'start' : idx, 'end' : idx})
					cur_idx += 1
				count += 1

			for count in (0, 1, 2, 3, 4, 5, 6, 7):
				if count < len(desc_list):
					if desc_list[count]['start'] == desc_list[count]['end']:
						text = "Tuner %s: %s" % (desc_list[count]['start'], desc_list[count]['desc'])
					else:
						text = "Tuner %s-%s: %s" % (desc_list[count]['start'], desc_list[count]['end'], desc_list[count]['desc'])
				else:
					text = ""

				self["Tuner" + str(count)] = StaticText(text)
				if text != "":
					self.tuner_list.append(text + "\n")

		self["HDDHeader"] = StaticText(_("Detected HDD:"))
		hddlist = harddiskmanager.HDDList()
		hdd = hddlist and hddlist[0][1] or None
		if hdd is not None and hdd.model() != "":
			self["hddA"] = StaticText(_("%s\n(%s, %d MB free)") % (hdd.model(), hdd.capacity(),hdd.free()))
		else:
			self["hddA"] = StaticText(_("none"))


		self.enigma2_version = _("Version") + ": " + about.getEnigmaVersionString()
		self.image_version = _("Image") + ": " + about.getImageVersionString()
		cpu_info = parseLines("/proc/cpuinfo")
		cpu_name = "N/A"
		for line in cpu_info:
			if line.find('model') != -1:
				cpu_name = line.split(':')
				if len(cpu_name) >= 2:
					cpu_name = cpu_name[1].strip()
				break
		
		self.cpu = _("CPU") + ": " + cpu_name
		self.chipset = _("Chipset") + ": " + parseFile("/proc/stb/info/chipset")
		self.tuner_header = _("Detected NIMs:")
		self.hdd_header = _("Detected HDD:")
		self.hdd_list = []
		if len(hddlist):
			for hddX in hddlist:
				hdd = hddX[1]
				if hdd.model() != "":
					self.hdd_list.append((hdd.model() + "\n   %.2f GB - %.2f GB" % (hdd.diskSize()/1000.0, hdd.free()/1000.0) + " " + _("free") + "\n\n"))

		ifaces = iNetwork.getConfiguredAdapters()
		iface_list = []
		for iface in ifaces:
			iface_list.append((_("Interface") + " : " + iNetwork.getAdapterName(iface) + " ("+ iNetwork.getFriendlyAdapterName(iface) + ")\n"))
			iface_list.append((_("IP") + " : " + parse_ipv4(iNetwork.getAdapterAttribute(iface, "ip")) + "\n"))
			iface_list.append((_("Netmask") + " : " + parse_ipv4(iNetwork.getAdapterAttribute(iface, "netmask")) + "\n"))
			iface_list.append((_("Gateway") + " : " + parse_ipv4(iNetwork.getAdapterAttribute(iface, "gateway")) + "\n"))
			if iNetwork.getAdapterAttribute(iface, "dhcp"):
				iface_list.append((_("DHCP") + " : " + _("Yes") + "\n"))
			else:
				iface_list.append((_("DHCP") + " : " + _("No") + "\n"))
			iface_list.append((_("MAC") + " : " + iNetwork.getAdapterAttribute(iface, "mac") + "\n"))
			iface_list.append(("\n"))

		my_txt = self.enigma2_version + "\n"
		my_txt += self.image_version + "\n"
		my_txt += "\n"
		my_txt += self.cpu + "\n"
		my_txt += self.chipset + "\n"
		my_txt += "\n"
		my_txt += self.tuner_header + "\n"
		for x in self.tuner_list:
			my_txt += "   " + x
		my_txt += "\n"
		my_txt += _("Network") + ":\n"
		for x in iface_list:
			my_txt += "   " + x
		my_txt += self.hdd_header + "\n"
		for x in self.hdd_list:
			my_txt += "   " + x
		my_txt += "\n"

		self["FullAbout"] = ScrollLabel(my_txt)

		self["actions"] = ActionMap(["SetupActions", "ColorActions", "EventViewActions"], 
			{
				"cancel": self.close,
				"ok": self.close,
				"pageUp": self.pageUp,
				"pageDown": self.pageDown
			})
def getInfo():
	# TODO: get webif versione somewhere!
	info = {}

	brand = "Dream Multimedia"
	model = "unknown"
	chipset = "unknown"
	
	if fileExists("/proc/stb/info/boxtype"):
		brand = "Clarke-Xtrend"
		f = open("/proc/stb/info/boxtype",'r')
 		model = f.readline().strip()
 		if model == "ini-3000" or model == "ini-5000" or model == "ini-7000":
		    brand = "INI-Series"
 		f.close()
	elif fileExists("/proc/stb/info/vumodel"):
		brand = "Vuplus"
		f = open("/proc/stb/info/vumodel",'r')
 		model = f.readline().strip()
 		f.close()
	elif fileExists("/proc/stb/info/azmodel"):
		brand = "AZBOX"
		f = open("/proc/stb/info/model",'r')
 		model = f.readline().strip()
 		f.close()
 		if model == "me":
			chipset = "SIGMA 8655"
 		elif model == "minime":
			chipset = "SIGMA 8653"
 		else:
			chipset = "SIGMA 8634"
	else:
		f = open("/proc/stb/info/model",'r')
 		model = f.readline().strip()
 		f.close()

	info['brand'] = brand
	info['model'] = model

	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
		
	if fileExists("/etc/bhversion"):
		f = open("/etc/bhversion",'r')
		imagever = f.readline().strip()
		f.close()
	elif fileExists("/etc/vtiversion.info"):
		f = open("/etc/vtiversion.info",'r')
		imagever = f.readline().strip()
		f.close()
	else:
		imagever = about.getImageVersionString()
		
	info["webifver"] = getOpenWebifVer()
	info['imagever'] = imagever
	info['enigmaver'] = about.getEnigmaVersionString()
	info['kernelver'] = about.getKernelVersionString()
	
	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")),
			"gw": formatIp(iNetwork.getAdapterAttribute(iface, "gateway"))
		})
			
	info['hdd'] = []
	for hdd in harddiskmanager.hdd:
		if hdd.free() <= 1024:
			free = "%i MB" % (hdd.free())
		else:
			free = float(hdd.free()) / float(1024)
			free = "%.3f GB" % free
		info['hdd'].append({
			"model": hdd.model(),
			"capacity": hdd.capacity(),
			"free": free
		})
	return info
Exemple #27
0
def getInfo():
    # TODO: get webif versione somewhere!
    info = {}

    brand = "Dream Multimedia"
    model = "unknown"
    chipset = "unknown"

    if fileExists("/proc/stb/info/vumodel"):
        brand = "Vuplus"
        f = open("/proc/stb/info/vumodel", 'r')
        model = f.readline().strip()
        f.close()
    elif fileExists("/proc/stb/info/boxtype"):
        brand = "Clarke-Xtrend"
        f = open("/proc/stb/info/boxtype", 'r')
        model = f.readline().strip()
        f.close()
    else:
        f = open("/proc/stb/info/model", 'r')
        model = f.readline().strip()
        f.close()

    info['brand'] = brand
    info['model'] = model

    if fileExists("/proc/stb/info/chipset"):
        f = open("/proc/stb/info/chipset", 'r')
        chipset = f.readline().strip()
        f.close()

    info['chipset'] = chipset

    f = open("/proc/meminfo", 'r')
    parts = f.readline().split(':')
    info['mem1'] = parts[1].strip()
    parts = f.readline().split(':')
    info['mem2'] = parts[1].strip()
    f.close()

    f = os.popen("uptime")
    parts = f.readline().split(',')
    info['uptime'] = parts[0].strip()
    f.close()

    if fileExists("/etc/bhversion"):
        f = open("/etc/bhversion", 'r')
        imagever = f.readline().strip()
        f.close()
    else:
        imagever = about.getImageVersionString()

    info["webifver"] = "0.0.0"
    info['imagever'] = imagever
    info['enigmaver'] = about.getEnigmaVersionString()
    info['kernelver'] = about.getKernelVersionString()

    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")),
            "gw":
            formatIp(iNetwork.getAdapterAttribute(iface, "gateway"))
        })

    info['hdd'] = []
    for hdd in harddiskmanager.hdd:
        if hdd.free() <= 1024:
            free = "%i MB" % (hdd.free())
        else:
            free = float(hdd.free()) / float(1024)
            free = "%.3f GB" % free
        info['hdd'].append({
            "model": hdd.model(),
            "capacity": hdd.capacity(),
            "free": free
        })
    return info