File: genSmbiosDefs.py

package info (click to toggle)
libsmbios 2.0.3.dfsg-1.1
  • links: PTS
  • area: main
  • in suites: squeeze, wheezy
  • size: 3,768 kB
  • ctags: 2,016
  • sloc: cpp: 14,292; sh: 9,408; xml: 3,820; makefile: 454; ansic: 402; python: 157
file content (23 lines) | stat: -rwxr-xr-x 585 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/usr/bin/python
# vim:expandtab:autoindent:tabstop=4:shiftwidth=4:filetype=python:


import sys
import xml.dom.minidom

import HelperXml

def main():
    try:
        doc = xml.dom.minidom.parse( sys.argv[1]  )
        elem = HelperXml.getNodeElement( doc, "STRUCTUREDEFS" )
        for node in elem.childNodes:
            if node.nodeName == "STRUCTURE":
                print node.getAttribute("description").replace(" ", "_"), " = ", 
                print node.getAttribute( "type" ), ","
    except (IOError, KeyError):
        pass


if __name__ == "__main__":
        main()