a 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.9/site-packages/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 Invalid 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_typesectionZ_objr rrlibxml2ZxmlNodeZxmlapir ZxmlDocr)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)rrZtypeidrr r)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