summaryrefslogtreecommitdiffstats
path: root/examples/dmidump.py
diff options
context:
space:
mode:
authorDavid Sommerseth <davids@redhat.com>2009-08-11 11:34:21 +0200
committerDavid Sommerseth <davids@redhat.com>2009-08-11 11:34:21 +0200
commiteb08fd406370a81172d7fdd0663233a5f140b784 (patch)
treec50e19f2b873441672b20a7e339c176d9a4a7cbf /examples/dmidump.py
parent39cbdfb56e80cabbd67754d8d77f781e14eaa3da (diff)
parent3165a97a06f891622b913714bc4f8ca54565f9cc (diff)
downloadpython-dmidecode-eb08fd406370a81172d7fdd0663233a5f140b784.tar.gz
python-dmidecode-eb08fd406370a81172d7fdd0663233a5f140b784.tar.xz
python-dmidecode-eb08fd406370a81172d7fdd0663233a5f140b784.zip
Merge commit 'nima/xml'
Conflicts: debian/changelog Had the same changelog entry in both xml and master branch, with a minor wording difference. Removed the duplicate and merged in the changelog entries from the XML branch src/dmidecode.c Merge process got confused by some functions which was not changed. Removed the code coming from the master branch and let the XML be the base. src/setup-dbg.py src/setup.py In the XML branch, the version of the python-dmidecode is now a function which retrieves the version number from src/version.h. Merged in this feature to master as well.
Diffstat (limited to 'examples/dmidump.py')
-rwxr-xr-xexamples/dmidump.py38
1 files changed, 37 insertions, 1 deletions
diff --git a/examples/dmidump.py b/examples/dmidump.py
index 161da44..a6c7bf7 100755
--- a/examples/dmidump.py
+++ b/examples/dmidump.py
@@ -3,6 +3,26 @@ import dmidecode
import sys
from pprint import pprint
+#. Test all functions using /dev/mem...
+print "*** bios ***\n"; dmidecode.bios()
+print "*** system ***\n"; dmidecode.system()
+print "*** system ***\n"; dmidecode.system()
+print "*** baseboard ***\n"; dmidecode.baseboard()
+print "*** chassis ***\n"; dmidecode.chassis()
+print "*** processor ***\n"; dmidecode.processor()
+print "*** memory ***\n"; dmidecode.memory()
+print "*** cache ***\n"; dmidecode.cache()
+print "*** connector ***\n"; dmidecode.connector()
+print "*** slot ***\n"; dmidecode.slot()
+
+#. Now test get/set of memory device file...
+print dmidecode.get_dev()
+print dmidecode.set_dev("private/mem-XXX");
+print dmidecode.get_dev()
+
+#. Test taking a dump...
+print dmidecode.dump()
+
#. Test reading the dump...
print "*** bios ***\n"; pprint(dmidecode.bios())
print "*** system ***\n"; pprint(dmidecode.system())
@@ -15,4 +35,20 @@ print "*** cache ***\n"; pprint(dmidecode.cache())
print "*** connector ***\n"; pprint(dmidecode.connector())
print "*** slot ***\n"; pprint(dmidecode.slot())
-_=[dmidecode.type(_) and pprint(dmidecode.type(_)) for _ in range(1,128)]
+sys.exit(0)
+print "*** bios ***\n"; 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:
+ pprint(v['data']['Size']),
+
+pprint(dmidecode.type('3'))
+pprint(dmidecode.type('bios'))