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__
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.")
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")
# ? 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 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 info_table.add_row_to_table(huayra()[0], huayra()[1], 0, "Versión de Huayra\n[Repositorios habilitados]") info_table.add_row_to_table(debian()[0], debian()[1], 1, "Versión base de Debian\n[Repositorios habilitados]") #rint __name__
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()), 2, "Discos y Particiones.")
# 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") info_table.add_row_to_table(micro_label, micro_texto, 4, "Modelo de microprocesador")
huayra_text = markup.text_set_markup('Huayra ' + huayra_raw_ver + ' (' + huayra_code_name + ') ' + huayra_sources_repos) return huayra_label, huayra_text 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 info_table.add_row_to_table(huayra()[0], huayra()[1], 0, "Versión de Huayra\n[Repositorios habilitados]") info_table.add_row_to_table( debian()[0], debian()[1], 1, "Versión base de Debian\n[Repositorios habilitados]") #rint __name__
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")
# -*- coding: utf-8 -*- # Copyright 2015 - Pedro Boliche <*****@*****.**> # License: GPLv3 (see http://www.gnu.org/licenses/gpl.html) import markup import info_table import os #from subprocess import check_output 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 info_table.add_row_to_table(kernel()[0], kernel()[1], 5, "Versión de compilación del kernel") #rint __name__
import markup import info_table # Link web_label = markup.label_start_markup + "info" + markup.label_end_markup web_link = markup.text_start_markup + "<a href='http://huayra.conectarigualdad.gob.ar/'>sitio web</a>" + markup.text_end_markup info_table.add_row_to_table(web_label, web_link, 8, destino="gui")
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__