ÿØÿà JFIF      ÿÛ „ 	 ( %!1!%)+//.383,7(-.+



-%%-////---/-.+/--+------/------/--0+--/-/-----.-----ÿÀ  ¥2" ÿÄ               ÿÄ J  	     ! 1AQ"aq2‘#BR‚¡ÁÑ3br’¢±Âð$CSƒ²á4c“%DsÓñÿÄ              ÿÄ *        !1AQa‘"2q3±ð#b¡ÿÚ   ? ¼QxJQaÍuò¸Zö Úü8,ÐÚú
"SSn<rçù–´âE—^ªBÖ9À\†¸ÔÁT­ÃÛ5
ëd´³Í#Ý;Þ38œî ¶H£M:wÎ3…³…âpÔF&‚FK¸9„â4àGEõªfÿ ‘ñ(ßw­pŽF|È¥ù®häðÍÑ¶¹‘[ÒinÙW¶ùñY˜Q{›K"išÒ[Ú8žë\F¹@-?v"ÔU”,ìöžkÿ {I‡£šÍ?e
ríV
..............................................................................................................................................................................
.............................................................................                                                  
                                                                                                                                                                                     ÿØÿà JFIF      ÿÛ „ 	 ( %!1!%)+//.383,7(-.+



-%%-////---/-.+/--+------/------/--0+--/-/-----.-----ÿÀ  ¥2" ÿÄ               ÿÄ J  	     ! 1AQ"aq2‘#BR‚¡ÁÑ3br’¢±Âð$CSƒ²á4c“%DsÓñÿÄ              ÿÄ *        !1AQa‘"2q3±ð#b¡ÿÚ   ? ¼QxJQaÍuò¸Zö Úü8,ÐÚú
"SSn<rçù–´âE—^ªBÖ9À\†¸ÔÁT­ÃÛ5
ëd´³Í#Ý;Þ38œî ¶H£M:wÎ3…³…âpÔF&‚FK¸9„â4àGEõªfÿ ‘ñ(ßw­pŽF|È¥ù®häðÍÑ¶¹‘[ÒinÙW¶ùñY˜Q{›K"išÒ[Ú8žë\F¹@-?v"ÔU”,ìöžkÿ {I‡£šÍ?e
ríV
..............................................................................................................................................................................
.............................................................................                                                  
                                                                                                                                                                                     3
bW                 @   s<   d Z ddlmZ ddlZddlZddlZG dd deZdS )z)DNS nodes.  A node is a set of rdatasets.    )StringIONc               @   s   e Zd ZdZdgZdd Zdd Zdd Zd	d
 Zdd Z	dd Z
dd ZejjdfddZejjdfddZejjfddZdd ZdS )NodezA DNS node.

    A node is a set of rdatasets

    @ivar rdatasets: the node's rdatasets
    @type rdatasets: list of dns.rdataset.Rdataset objects	rdatasetsc             C   s
   g | _ dS )zInitialize a DNS node.
        N)r   )self r   /usr/lib/python3.6/node.py__init__$   s    zNode.__init__c             K   sP   t  }x8| jD ].}t|dkr|j|j|f| |jd qW |j dd S )a+  Convert a node to text format.

        Each rdataset at the node is printed.  Any keyword arguments
        to this method are passed on to the rdataset's to_text() method.
        @param name: the owner name of the rdatasets
        @type name: dns.name.Name object
        @rtype: string
        r   
N   )r   r   lenwriteto_textgetvalue)r   namekwsrdsr   r   r   r   *   s    
zNode.to_textc             C   s   dt t|  d S )Nz
<DNS node >)strid)r   r   r   r   __repr__;   s    zNode.__repr__c             C   s@   x| j D ]}||j krdS qW x|j D ]}|| j kr&dS q&W dS )zSTwo nodes are equal if they have the same rdatasets.

        @rtype: bool
        FT)r   )r   otherZrdr   r   r   __eq__>   s    

zNode.__eq__c             C   s   | j | S )N)r   )r   r   r   r   r   __ne__N   s    zNode.__ne__c             C   s
   t | jS )N)r   r   )r   r   r   r   __len__Q   s    zNode.__len__c             C   s
   t | jS )N)iterr   )r   r   r   r   __iter__T   s    zNode.__iter__Fc             C   sH   x | j D ]}|j|||r|S qW |s*ttjj||}| j j| |S )a  Find an rdataset matching the specified properties in the
        current node.

        @param rdclass: The class of the rdataset
        @type rdclass: int
        @param rdtype: The type of the rdataset
        @type rdtype: int
        @param covers: The covered type.  Usually this value is
        dns.rdatatype.NONE, but if the rdtype is dns.rdatatype.SIG or
        dns.rdatatype.RRSIG, then the covers value will be the rdata
        type the SIG/RRSIG covers.  The library treats the SIG and RRSIG
        types as if they were a family of
        types, e.g. RRSIG(A), RRSIG(NS), RRSIG(SOA).  This makes RRSIGs much
        easier to work with than if RRSIGs covering different rdata
        types were aggregated into a single RRSIG rdataset.
        @type covers: int
        @param create: If True, create the rdataset if it is not found.
        @type create: bool
        @raises KeyError: An rdataset of the desired type and class does
        not exist and I{create} is not True.
        @rtype: dns.rdataset.Rdataset object
        )r   matchKeyErrordnsrdatasetRdatasetappend)r   rdclassrdtypecoverscreater   r   r   r   find_rdatasetW   s    zNode.find_rdatasetc             C   s2   y| j ||||}W n tk
r,   d}Y nX |S )aE  Get an rdataset matching the specified properties in the
        current node.

        None is returned if an rdataset of the specified type and
        class does not exist and I{create} is not True.

        @param rdclass: The class of the rdataset
        @type rdclass: int
        @param rdtype: The type of the rdataset
        @type rdtype: int
        @param covers: The covered type.
        @type covers: int
        @param create: If True, create the rdataset if it is not found.
        @type create: bool
        @rtype: dns.rdataset.Rdataset object or None
        N)r(   r   )r   r$   r%   r&   r'   r   r   r   r   get_rdatasety   s
    
zNode.get_rdatasetc             C   s&   | j |||}|dk	r"| jj| dS )az  Delete the rdataset matching the specified properties in the
        current node.

        If a matching rdataset does not exist, it is not an error.

        @param rdclass: The class of the rdataset
        @type rdclass: int
        @param rdtype: The type of the rdataset
        @type rdtype: int
        @param covers: The covered type.
        @type covers: int
        N)r)   r   remove)r   r$   r%   r&   r   r   r   r   delete_rdataset   s    zNode.delete_rdatasetc             C   s:   t |tjjstd| j|j|j|j | j	j
| dS )a8  Replace an rdataset.

        It is not an error if there is no rdataset matching I{replacement}.

        Ownership of the I{replacement} object is transferred to the node;
        in other words, this method does not store a copy of I{replacement}
        at the node, it stores I{replacement} itself.
        zreplacement is not an rdatasetN)
isinstancer    r!   r"   
ValueErrorr+   r$   r%   r&   r   r#   )r   Zreplacementr   r   r   replace_rdataset   s
    
zNode.replace_rdatasetN)__name__
__module____qualname____doc__	__slots__r   r   r   r   r   r   r   r    Z	rdatatypeZNONEr(   r)   r+   r.   r   r   r   r   r      s   !r   )	r2   ior   Zdns.rdatasetr    Zdns.rdatatypeZdns.rendererobjectr   r   r   r   r   <module>   s
   