관리-도구
편집 파일: resolver.cpython-36.pyc
3 >D�W�� � @ s� d Z ddlZddlZddlZddlZyddlZW n ek rL ddlZY nX ddl Z ddlZ ddlZ ddl Z ddlZ ddlZ ddlZ ddlZ ddlZ ddlZ ddlZ ddlZ ddlmZmZ ejdkr�yddlZW n ek r� ddlZY nX G dd� de jj�ZG dd � d e jj�Ze jj Z G d d� de jj�Z!G dd � d e jj�Z"G dd� de jj�Z#G dd� de jj�Z$G dd� de jj�Z%G dd� de&�Z'G dd� de&�Z(G dd� de&�Z)G dd� de&�Z*G dd� de&�Z+da,dd� Z-d d!� Z.e j/j0e j1j2d"dd#dfd$d%�Z3e j1j2d"dfd&d'�Z4ej5ej6gej7ej8giZ9da:ej;Z<ej=Z>ej?Z@ejAZBejCZDejEZFddejGdddfd(d)�ZHd8d*d+�ZId9d,d-�ZJd.d/� ZKd0d1� ZLd2d3� ZMd:d4d5�ZNd6d7� ZOdS );z{DNS stub resolver. @var default_resolver: The default resolver object @type default_resolver: dns.resolver.Resolver object� N� )�xrange�string_types�win32c sV e Zd ZdZeddg�ZdZddd�Z� fdd�Zd d � Z e e dd�Z d d� Z� ZS )�NXDOMAINz"The DNS query name does not exist.�qnames� responsesNc C s\ t |tttf�std��t|�dkr,td��|d kr:i }nt |t�sLtd��t||d�}|S )Nz#qnames must be a list, tuple or setr z(qnames must contain at least one elementz(responses must be a dict(qname=response))r r )� isinstance�list�tuple�set�AttributeError�len�dict)�selfr r �kwargs� r �/usr/lib/python3.6/resolver.py� _check_kwargs9 s zNXDOMAIN._check_kwargsc s^ d| j krtt| �j� S | j d }t|�dkr4d}n| jd d� }djtt|��}d||f S )Nr r zNone of DNS query names existz, z%s: %s���) r �superr �__str__r �__doc__�join�map�str)r r �msg)� __class__r r r E s zNXDOMAIN.__str__c C s� d| j krtd��tjj}tjj}d }xj| j d D ]\}| j d | }x4|jD ]*}|j|ksL|j |krfqL|j d jj� }qLW |d k r2tj j|�S q2W | j d d S )Nr zparametrized exception requiredr r )r � TypeError�dns� rdataclass�IN� rdatatype�CNAME�answer�rdtype�rdclass�items�target�to_text�name� from_text)r r! r# �cname�qname�responser$ r r r �canonical_nameP s zNXDOMAIN.canonical_namez%Return the unresolved canonical name.)�docc C s| t | jjdg ��}t| jjdi ��}|jjdi �}x<|jjdg �D ]*}||krX|j|� ||krB|| ||<