From e308e170fc844c8b4454384873497f52f0d37ae7 Mon Sep 17 00:00:00 2001 From: nima Date: Wed, 29 Oct 2008 07:09:10 +0000 Subject: Tested new dmidecode python module with this example file. A real test case will be implemented sometime in future. git-svn-id: svn://svn.autonomy.net.au/python-dmidecode@82 abc39116-655e-4be6-ad55-d661dc543056 --- example.py | 33 ++++++++++++++++++--------------- 1 file changed, 18 insertions(+), 15 deletions(-) (limited to 'example.py') diff --git a/example.py b/example.py index 9c585e6..9bfa259 100755 --- a/example.py +++ b/example.py @@ -1,20 +1,23 @@ -#!/usr/bin/env python2.3 +#!/usr/bin/env python2.4 import dmidecode import sys from pprint import pprint -#print "*** bios ***"; pprint(dmidecode.bios()) -#print "*** system ***\n", pprint(dmidecode.system()) -#print "*** baseboard ***\n"; pprint(dmidecode.baseboard()) -#print "*** chassis ***\n"; pprint(dmidecode.chassis()) -#print "*** processor ***\n"; pprint(dmidecode.processor()) +print "*** bios ***"; pprint(dmidecode.bios()) +print "*** system ***\n", pprint(dmidecode.system()) +print "*** baseboard ***\n"; pprint(dmidecode.baseboard()) +print "*** chassis ***\n"; pprint(dmidecode.chassis()) +print "*** processor ***\n"; pprint(dmidecode.processor()) print "*** memory ***\n"; pprint(dmidecode.memory()) -#print "*** cache ***\n"; pprint(dmidecode.cache()) -#print "*** connector ***\n"; pprint(dmidecode.connector()) -#print "*** slot ***\n"; pprint(dmidecode.slot()) -# -#for v in dmidecode.memory().values(): -# if type(v) == dict and v['dmi_type'] == 17: -# print v['data']['Size'], -#print "" +print "*** cache ***\n"; pprint(dmidecode.cache()) +print "*** connector ***\n"; pprint(dmidecode.connector()) +print "*** slot ***\n"; pprint(dmidecode.slot()) -print dmidecode.type('17') +for v in dmidecode.memory().values(): + if type(v) == dict and v['dmi_type'] == 17: + print v['data']['Size'], +print "" + +import time +print dmidecode.type('3') +time.sleep(1) +print dmidecode.type('bios') -- cgit