From f120b5fa5933fef104c1f5e711581455e3980e2e Mon Sep 17 00:00:00 2001 From: nima Date: Fri, 31 Oct 2008 14:07:22 +0000 Subject: Implemented reading a dump to - this concludes syncing to the upstream release. Next, exceptions should be thrown in certain places, more error checking in the python side of things, and also in relation to setting and unsetting of the alternate memory file. git-svn-id: svn://svn.autonomy.net.au/python-dmidecode@104 abc39116-655e-4be6-ad55-d661dc543056 --- example.py | 31 ++++++++++++++++++++++--------- 1 file changed, 22 insertions(+), 9 deletions(-) (limited to 'example.py') diff --git a/example.py b/example.py index bccf31f..a6c7bf7 100755 --- a/example.py +++ b/example.py @@ -1,14 +1,9 @@ #!/usr/bin/env python2.4 import dmidecode import sys +from pprint import pprint -print dmidecode.get_dev() -print dmidecode.set_dev("private/mem-XXX") -print dmidecode.dump() - -print dmidecode.set_dev("private/mem-001") -print dmidecode.get_dev() - +#. Test all functions using /dev/mem... print "*** bios ***\n"; dmidecode.bios() print "*** system ***\n"; dmidecode.system() print "*** system ***\n"; dmidecode.system() @@ -20,9 +15,27 @@ print "*** cache ***\n"; dmidecode.cache() print "*** connector ***\n"; dmidecode.connector() print "*** slot ***\n"; dmidecode.slot() -sys.exit(0) +#. Now test get/set of memory device file... +print dmidecode.get_dev() +print dmidecode.set_dev("private/mem-XXX"); +print dmidecode.get_dev() -from pprint import pprint +#. Test taking a dump... +print dmidecode.dump() + +#. Test reading the dump... +print "*** bios ***\n"; pprint(dmidecode.bios()) +print "*** system ***\n"; pprint(dmidecode.system()) +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()) + +sys.exit(0) print "*** bios ***\n"; pprint(dmidecode.bios()) print "*** system ***\n"; pprint(dmidecode.system()) print "*** baseboard ***\n"; pprint(dmidecode.baseboard()) -- cgit