관리-도구
편집 파일: dmidecode.cpython-36.pyc
3 ��uc� � @ s* d dl Z d dlT dZdZG dd� d�ZdS )� N)�*�n�dc @ s0 e Zd ZdZdd� Zdd� Zdd� Zdd � Zd S )�dmidecodeXMLz=Native Python API for retrieving dmidecode information as XMLc C s t | _d S )N)�DMIXML_NODE�restype)�self� r �!/usr/lib64/python3.6/dmidecode.py�__init__% s zdmidecodeXML.__init__c C s, |t krt | _n|tkr t| _ntd��dS )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)r r � DMIXML_DOC� TypeError)r �typer r r � SetResultType( s zdmidecodeXML.SetResultTypec C sT | j tkr$tjtd| j |d�d�}n,| j tkrHtjtd| j |d�d�}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)r r �libxml2�xmlNode�xmlapir �xmlDocr )r Zsectname�retr r r �QuerySection6 s zdmidecodeXML.QuerySectionc C sT | j tkr$tjtd| j |d�d�}n,| j tkrHtjtd| j |d�d�}ntd��|S )zI Queries the DMI data structure for a specific DMI type. �t)r r Ztypeid)r zInvalid result type value)r r r r r r r r )r Ztpidr r r r �QueryTypeIdI s zdmidecodeXML.QueryTypeIdN)�__name__� __module__�__qualname__�__doc__r r r r r r r r r "