Example #1
0
def huayra():
    try:
        lsb_list = open('/etc/lsb-release').read().replace('\n', '=').split('=')
    except IOError as e:
        lsb_list = []
    lsb_release = dict(zip(lsb_list[0::2], lsb_list[1::2]))

    if lsb_release.get("DISTRIB_ID") == 'Huayra':  # lsb_release is aware of huayra
        huayra_raw_ver = lsb_release.get("DISTRIB_RELEASE")
        huayra_code_name = lsb_release.get("DISTRIB_CODENAME")

    else:
        try:
            huayra_raw_ver = open('/etc/huayra_version', 'r').read()[:-1]
            if huayra_raw_ver >= "4.0":
                huayra_code_name = 'zonda'
            elif huayra_raw_ver >= "3.0":
                huayra_code_name = 'sud'
            elif huayra_raw_ver >= "2.0":
                huayra_code_name = 'pampero'
        except IOError as e:  # huayra is not still aware of himself
            huayra_code_name = 'brisa'
            huayra_raw_ver = '1.X'

    # ? hay repos agregados ?
    huayra_sources_repos = check_sources_huayra()
    if huayra_code_name != huayra_sources_repos:
        huayra_sources_repos = '[' + huayra_sources_repos + ']'
    else:
        huayra_sources_repos = ''

    huayra_label = markup.label_set_markup('Versión')
    huayra_text = markup.text_set_markup('Huayra ' + huayra_raw_ver + ' (' + huayra_code_name + ') ' + huayra_sources_repos)

    return huayra_label, huayra_text
Example #2
0
def kernel():
    running_kernel = os.uname()
    kver_label = markup.label_set_markup('Kernel versión')
    kver_text = markup.text_set_markup(" ".join(
        running_kernel[3].split()[2:4]))

    return kver_label, kver_text
Example #3
0
def debian():
    base_src_code_name = check_sources_debian()
    try:
        base_dist_ver = open('/etc/debian_version', 'r').read().split()
    except:
        base_dist_ver = ['']

    base_dist_issue = ['Debian']
    debian_label = markup.label_set_markup('Base')
    debian_text = markup.text_set_markup(base_dist_issue[0] + ' ' + base_dist_ver[0] + ' [' + base_src_code_name + ']')
    return debian_label, debian_text
Example #4
0
def debian():
    base_src_code_name = check_sources_debian()
    try:
        base_dist_ver = open('/etc/debian_version', 'r').read().split()
    except:
        base_dist_ver = ['']

    base_dist_issue = ['Debian']
    debian_label = markup.label_set_markup('Base')
    debian_text = markup.text_set_markup(base_dist_issue[0] + ' ' +
                                         base_dist_ver[0] + ' [' +
                                         base_src_code_name + ']')
    return debian_label, debian_text
Example #5
0
def huayra():
    try:
        lsb_list = open('/etc/lsb-release').read().replace('\n',
                                                           '=').split('=')
    except IOError as e:
        lsb_list = []
    lsb_release = dict(zip(lsb_list[0::2], lsb_list[1::2]))

    if lsb_release.get(
            "DISTRIB_ID") == 'Huayra':  # lsb_release is aware of huayra
        huayra_raw_ver = lsb_release.get("DISTRIB_RELEASE")
        huayra_code_name = lsb_release.get("DISTRIB_CODENAME")

    else:
        try:
            huayra_raw_ver = open('/etc/huayra_version', 'r').read()[:-1]
            if huayra_raw_ver >= "4.0":
                huayra_code_name = 'zonda'
            elif huayra_raw_ver >= "3.0":
                huayra_code_name = 'sud'
            elif huayra_raw_ver >= "2.0":
                huayra_code_name = 'pampero'
        except IOError as e:  # huayra is not still aware of himself
            huayra_code_name = 'brisa'
            huayra_raw_ver = '1.X'

    # ? hay repos agregados ?
    huayra_sources_repos = check_sources_huayra()
    if huayra_code_name != huayra_sources_repos:
        huayra_sources_repos = '[' + huayra_sources_repos + ']'
    else:
        huayra_sources_repos = ''

    huayra_label = markup.label_set_markup('Versión')
    huayra_text = markup.text_set_markup('Huayra ' + huayra_raw_ver + ' (' +
                                         huayra_code_name + ') ' +
                                         huayra_sources_repos)

    return huayra_label, huayra_text
import os.path
import subprocess


LABEL = u'Discos y Particiones'


class Info(object):

    @staticmethod
    def text():
        cmd = ['df', '-h']
        process = subprocess.Popen(cmd, stdout=subprocess.PIPE)
        out, err = process.communicate()
        info = out.strip()
        info = '\n' + info
        return info

    @staticmethod
    def label():
        return LABEL

if __name__ == '__main__':
    #print Info.label()
    #print Info.text()
    null

else:
    info_table.add_row_to_table(markup.label_set_markup(Info.label()), markup.text_set_markup(Info.text()), 9, "Discos y Particiones.")

Example #7
0
LABEL = u'Arquitectura'


class Info(object):

    @staticmethod
    def text():
        cmd = ['uname', '-m']
        process = subprocess.Popen(cmd, stdout=subprocess.PIPE)
        out, err = process.communicate()
        info = out.strip()

        if os.path.exists('/sys/firmware/efi'):
            info += ' (modo UEFI)'
        else:
            info += ' (modo BIOS)'

        return info

    @staticmethod
    def label():
        return LABEL

if __name__ == '__main__':
    print '{0}: {1}'.format(Info.label(), Info.text())

else:
    info_table.add_row_to_table(markup.label_set_markup(Info.label()), markup.text_set_markup(Info.text()), 2, "Arquitectura del sistema.")

    #rint __name__
Example #8
0
import markup
import info_table
import os.path
import subprocess

LABEL = "Placas de Red"


class Info(object):
    @staticmethod
    def text():
        cmd = ['./info_red.sh']
        process = subprocess.Popen(cmd, stdout=subprocess.PIPE)
        out, err = process.communicate()
        info = out.strip()
        info = '\n' + info
        return info

    @staticmethod
    def label():
        return LABEL


if __name__ == '__main__':
    print '{0}: {1}'.format(Info.label(), Info.text())

else:
    info_table.add_row_to_table(markup.label_set_markup(Info.label()),
                                markup.text_set_markup(Info.text()), 2,
                                "Placas de Red")
Example #9
0
#! /usr/bin/python
# -*- coding: utf-8 -*-
# Copyleft 2015 - Diego Accorinti (mejoras memoria y modelo de cpu)
# License: GPLv3 (see http://www.gnu.org/licenses/gpl.html)
import markup
import info_table
from subprocess import Popen, PIPE


# Memoria
memo = open('/proc/meminfo').read().split()
mem_label = markup.label_set_markup('Memoria')
mem_texto = markup.text_set_markup(str(int(memo[1]) / 1024) + " MB")

# CPU
s = ""
micro = open('/proc/cpuinfo').read()
micro = (s.join(micro)).split()
micro_label = markup.label_set_markup('Microprocesador')

x = 0
while micro[x] != "name":
    x += 1

x += 1  # skip ":"
micro_texto = ""
while micro[x + 1] != "stepping":
    micro_texto = micro_texto + micro[x + 1] + " "
    x += 1
micro_texto = markup.text_set_markup(micro_texto)
Example #10
0
#! /usr/bin/python
# -*- coding: utf-8 -*-
# Copyleft 2015 - Diego Accorinti (mejoras memoria y modelo de cpu)
# License: GPLv3 (see http://www.gnu.org/licenses/gpl.html)
import markup
import info_table
from subprocess import Popen, PIPE

# Memoria
memo = open('/proc/meminfo').read().split()
mem_label = markup.label_set_markup('Memoria')
mem_texto = markup.text_set_markup(str(int(memo[1]) / 1024) + " MB")

# CPU
s = ""
micro = open('/proc/cpuinfo').read()
micro = (s.join(micro)).split()
micro_label = markup.label_set_markup('Microprocesador')

x = 0
while micro[x] != "name":
    x += 1

x += 1  # skip ":"
micro_texto = ""
while micro[x + 1] != "stepping":
    micro_texto = micro_texto + micro[x + 1] + " "
    x += 1
micro_texto = markup.text_set_markup(micro_texto)

info_table.add_row_to_table(mem_label, mem_texto, 3, "Memoria disponible")
Example #11
0
import info_table
import os.path
import subprocess


LABEL = u"Placas de Red"


class Info(object):

    @staticmethod
    def text():
        cmd= ['lspci | grep -E "Network | network | Ethernet | ethernet | wireless | Wireless" | cut -c9-100']
        process = subprocess.Popen(cmd,shell=True, stdout=subprocess.PIPE)
        out, err = process.communicate()
        info = out.strip()
        info = '\n' + info
        return info

    @staticmethod
    def label():
        return LABEL


if __name__ == '__main__':
    #print '{0}: {1}'.format(Info.label(), Info.text())
    null

else:
    info_table.add_row_to_table(markup.label_set_markup(Info.label()), markup.text_set_markup(Info.text()), 10, "Placas de Red")
Example #12
0

class Info(object):

    @staticmethod
    def text():
        cmd = ['uname', '-m']
        process = subprocess.Popen(cmd, stdout=subprocess.PIPE)
        out, err = process.communicate()
        info = out.strip()

        if os.path.exists('/sys/firmware/efi'):
            info += ' (modo UEFI)'
        else:
            info += ' (modo BIOS)'

        return info

    @staticmethod
    def label():
        return LABEL

if __name__ == '__main__':
    print '{0}: {1}'.format(Info.label(), Info.text())


else:
    info_table.add_row_to_table(markup.label_set_markup(Info.label()), markup.text_set_markup(Info.text()), 2, "Arquitectura del sistema.")

    #rint __name