Console: new label with XO Firmware version
This commit is contained in:
parent
1352e5be94
commit
b36af52f52
@ -23,6 +23,8 @@ import string
|
||||
import gobject
|
||||
import drwarea
|
||||
|
||||
import procmem
|
||||
|
||||
class CPU_Usage:
|
||||
|
||||
CPU_HZ = 0
|
||||
@ -105,12 +107,12 @@ class XO_CPU(gtk.Frame):
|
||||
|
||||
self.add(fixed)
|
||||
|
||||
DRW_CPU = CPU_Usage()
|
||||
DRW_CPU.frequency = 1000 # 1 Second
|
||||
self._DRW_CPU = CPU_Usage()
|
||||
self._DRW_CPU.frequency = 1000 # 1 Second
|
||||
|
||||
gobject.timeout_add(DRW_CPU.frequency, self._update_cpu_usage, DRW_CPU)
|
||||
gobject.timeout_add(self._DRW_CPU.frequency, self._update_cpu_usage)
|
||||
|
||||
def _update_cpu_usage(self, DRW_CPU):
|
||||
def _update_cpu_usage(self):
|
||||
|
||||
redraw_all = False
|
||||
|
||||
@ -123,7 +125,7 @@ class XO_CPU(gtk.Frame):
|
||||
else:
|
||||
length = len(self._cpu_buffer) - 1
|
||||
|
||||
self._cpu = DRW_CPU._get_CPU_usage()
|
||||
self._cpu = self._DRW_CPU._get_CPU_usage()
|
||||
self._cpu_buffer.append(self._cpu)
|
||||
|
||||
self._updated = True
|
||||
@ -251,3 +253,4 @@ class XO_CPU(gtk.Frame):
|
||||
freq+=1
|
||||
|
||||
context.stroke()
|
||||
|
||||
|
@ -39,6 +39,11 @@ class XO_System(gtk.Fixed):
|
||||
label_build = Label('OLPC Build:', Label.DESCRIPTION)
|
||||
label_build_value = Label(str(build), Label.DESCRIPTION)
|
||||
|
||||
# FIRMWARE
|
||||
firmware = self._get_firmware_version()
|
||||
label_firmware = Label('XO Firmware:', Label.DESCRIPTION)
|
||||
label_firmware_value = Label(firmware, Label.DESCRIPTION)
|
||||
|
||||
# KERNEL
|
||||
sysinfo = os.uname()
|
||||
label_kernel = Label('Kernel Version:', Label.DESCRIPTION)
|
||||
@ -48,9 +53,13 @@ class XO_System(gtk.Fixed):
|
||||
table.attach(label_build, 0, 1, 0, 1)
|
||||
table.attach(label_build_value, 1,2, 0,1)
|
||||
|
||||
# XO Firmware
|
||||
table.attach(label_firmware, 0, 1, 1, 2)
|
||||
table.attach(label_firmware_value, 1, 2, 1, 2)
|
||||
|
||||
# Kernel Version
|
||||
table.attach(label_kernel, 0, 1, 1, 2)
|
||||
table.attach(label_kernel_value, 1, 2, 1, 2)
|
||||
table.attach(label_kernel, 0, 1, 2, 3)
|
||||
table.attach(label_kernel_value, 1, 2, 2, 3)
|
||||
|
||||
frame = gtk.Frame('System Information')
|
||||
style = Style()
|
||||
@ -72,3 +81,15 @@ class XO_System(gtk.Fixed):
|
||||
except:
|
||||
return "None"
|
||||
|
||||
# Get XO Firmware Versions
|
||||
def _get_firmware_version(self):
|
||||
|
||||
try:
|
||||
# Shell command
|
||||
cmd = "/usr/sbin/olpc-bios-sig"
|
||||
|
||||
data = os.popen(cmd).readlines()
|
||||
return data[0].strip()
|
||||
except:
|
||||
return "None"
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user