1
from libdesklets.system.Arch import Arch
13
self.__net_devices = re.compile('^\s*(\w+):.*mtu', re.M
14
).findall( os.popen('/sbin/ifconfig -a').read() )
16
# cpu0 at mainbus0: MIPS R3000A CPU (0x230) Rev. 3.0 with MIPS R3010 FPC Rev. 3.0
17
# cpu0: 64KB/4B direct-mapped Instruction cache, 64 TLB entries
18
# cpu0: 64KB/4B direct-mapped write-through Data cache
20
m = re.compile('^cpu0 at mainbus0: (.*?) CPU', re.M
21
).search(open("/var/run/dmesg.log").read() )
23
self.__model = m.group(1)
27
def net_devices(self):
29
@return : all available network devices
33
return (self.__net_devices)
39
@return : model/type of installed processor
49
@return : number of connected users
55
data = open('/var/run/utmp', 'rb').read()
57
for i in range(8, len(data), 36):
59
ut_name = struct.unpack('c', data[i:i+1])[0]