3 uc @s*ddlZddlTdZdZGdddZdS)N)*ndc@s0eZdZdZddZddZddZdd Zd S) dmidecodeXMLz=Native Python API for retrieving dmidecode information as XMLcCs t|_dS)N) DMIXML_NODErestype)selfr !/usr/lib64/python3.6/dmidecode.py__init__%szdmidecodeXML.__init__cCs,|tkrt|_n|tkr t|_ntddS)z Sets the result type of queries. The value can be DMIXML_NODE or DMIXML_DOC, which will return an libxml2::xmlNode or libxml2::xmlDoc object, respectively zInvalid result type valueT)rr DMIXML_DOC TypeError)rtyper r r SetResultType(s zdmidecodeXML.SetResultTypecCsT|jtkr$tjtd|j|dd}n,|jtkrHtjtd|j|dd}ntd|S)z Queries the DMI data structure for a given section name. A section can often contain several DMI type elements s) query_type result_typeZsection)_objzInvalid result type value)rrlibxml2xmlNodexmlapir xmlDocr )rZsectnameretr r r QuerySection6s  zdmidecodeXML.QuerySectioncCsT|jtkr$tjtd|j|dd}n,|jtkrHtjtd|j|dd}ntd|S)zI Queries the DMI data structure for a specific DMI type. t)rrZtypeid)rzInvalid result type value)rrrrrr rr )rZtpidrr r r QueryTypeIdIs  zdmidecodeXML.QueryTypeIdN)__name__ __module__ __qualname____doc__r rrrr r r r r"s r)rZ dmidecodemodrr rr r r r s