Exemple #1
0
	def getImageVersionString(cls):
		from Components.About import about
		if hasattr(about,'getVTiVersionString'):
			creator = about.getVTiVersionString()
		else:
			creator = about.getEnigmaVersionString()
		version = about.getVersionString()

		return ' / '.join((creator, version))
	def getImageVersionString(cls):
		from Components.About import about

		creator = "n/a"
		version = "n/a"

		if hasattr(about,'getVTiVersionString'):
			creator = about.getVTiVersionString()
		else:
			creator = about.getEnigmaVersionString()
		version = about.getVersionString()

		return ' / '.join((creator, version))
Exemple #3
0
def getInfo():
    info = {}
    brand = 'Dream Multimedia'
    model = 'unknown'
    chipset = 'unknown'
    if fileExists('/proc/stb/info/boxtype'):
        brand = 'Xtrend'
        f = open('/proc/stb/info/boxtype', 'r')
        model = f.readline().strip()
        if model.startswith('et'):
            brand = 'Xtrend'
        elif model.startswith('ini'):
            brand = 'INI-Series'
        elif model.startswith('xp'):
            brand = 'XP-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()
    else:
        try:
            imagever = 'VTi-Team Image Release v. '
            imagever += about.getVTiVersionString()
        except:
            imagever = about.getImageVersionString()

    info['imagever'] = imagever
    info['enigmaver'] = about.getEnigmaVersionString()
    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')),
         '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 #4
0
def getInfo():
    info = {}
    brand = 'Dream Multimedia'
    model = 'unknown'
    chipset = 'unknown'
    if fileExists('/proc/stb/info/boxtype'):
        brand = 'Xtrend'
        f = open('/proc/stb/info/boxtype', 'r')
        model = f.readline().strip()
        if model.startswith('et'):
            brand = 'Xtrend'
        elif model.startswith('ini'):
            brand = 'INI-Series'
        elif model.startswith('xp'):
            brand = 'XP-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()
    else:
        try:
            imagever = 'VTi-Team Image Release v. '
            imagever += about.getVTiVersionString()
        except:
            imagever = about.getImageVersionString()

    info['imagever'] = imagever
    info['enigmaver'] = about.getEnigmaVersionString()
    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')),
         '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