
    uim                     <    S r SSKrSSKrSSKrSSKr " S S5      rg)z)DNS nodes.  A node is a set of rdatasets.    Nc                       \ rS rSrSrS/rS rS rS rS r	S r
S	 rS
 r\R                  R                  S4S jr\R                  R                  S4S jr\R                  R                  4S jrS rSrg)Node   zA Node is a set of rdatasets.	rdatasetsc                     / U l         g Nr   selfs    ?/home/kodi/.kodi/addons/script.module.dnspython/lib/dns/node.py__init__Node.__init__!   s	        c                     [         R                  " 5       nU R                   HG  n[        U5      S:  d  M  UR	                  UR
                  " U40 UD65        UR	                  S5        MI     UR                  5       SS $ )zConvert 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.

*name*, a ``dns.name.Name`` or ``str``, the owner name of the
rdatasets.

Returns a ``str``.

r   
N)ioStringIOr   lenwriteto_textgetvalue)r   namekwsrdss        r   r   Node.to_text%   sb     KKM>>C3x!|D/B/0 " zz|CR  r   c                 6    S[        [        U 5      5      -   S-   $ )Nz
<DNS node >)stridr
   s    r   __repr__Node.__repr__9   s    c"T(m+c11r   c                     U R                    H  nX!R                   ;  d  M    g   UR                    H  nX R                   ;  d  M    g   g)NFTr	   )r   otherrds      r   __eq__Node.__eq__<   sA     ..B( ! //B' " r   c                 .    U R                  U5      (       + $ r   )r'   )r   r%   s     r   __ne__Node.__ne__H   s    ;;u%%%r   c                 ,    [        U R                  5      $ r   )r   r   r
   s    r   __len__Node.__len__K   s    4>>""r   c                 ,    [        U R                  5      $ r   )iterr   r
   s    r   __iter__Node.__iter__N   s    DNN##r   Fc                     U R                    H  nUR                  XU5      (       d  M  Us  $    U(       d  [        e[        R                  R                  X5      nU R                   R                  U5        U$ )as  Find an rdataset matching the specified properties in the
current node.

*rdclass*, an ``int``, the class of the rdataset.

*rdtype*, an ``int``, the type of the rdataset.

*covers*, an ``int`` or ``None``, 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.

*create*, a ``bool``.  If True, create the rdataset if it is not found.

Raises ``KeyError`` if an rdataset of the desired type and class does
not exist and *create* is not ``True``.

Returns a ``dns.rdataset.Rdataset``.
)r   matchKeyErrordnsrdatasetRdatasetappendr   rdclassrdtypecoverscreater   s         r   find_rdatasetNode.find_rdatasetQ   s]    6 >>Cyy&11
 " Nll##G4c"
r   c                 R     U R                  XX45      nU$ ! [         a    Sn U$ f = f)ag  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 *create* is not ``True``.

*rdclass*, an ``int``, the class of the rdataset.

*rdtype*, an ``int``, the type of the rdataset.

*covers*, an ``int``, 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.

*create*, a ``bool``.  If True, create the rdataset if it is not found.

Returns a ``dns.rdataset.Rdataset`` or ``None``.
N)r?   r5   r:   s         r   get_rdatasetNode.get_rdatasetu   s;    4	$$WfEC 
  	C
	s    &&c                 f    U R                  XU5      nUb  U R                  R                  U5        gg)a  Delete the rdataset matching the specified properties in the
current node.

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

*rdclass*, an ``int``, the class of the rdataset.

*rdtype*, an ``int``, the type of the rdataset.

*covers*, an ``int``, the covered type.
N)rB   r   remove)r   r;   r<   r=   r   s        r   delete_rdatasetNode.delete_rdataset   s2     8?NN!!#& r   c                 v   [        U[        R                  R                  5      (       d  [	        S5      e[        U[        R
                  R                  5      (       a  UR                  5       nU R                  UR                  UR                  UR                  5        U R                  R                  U5        g)a  Replace an rdataset.

It is not an error if there is no rdataset matching *replacement*.

Ownership of the *replacement* object is transferred to the node;
in other words, this method does not store a copy of *replacement*
at the node, it stores *replacement* itself.

*replacement*, a ``dns.rdataset.Rdataset``.

Raises ``ValueError`` if *replacement* is not a
``dns.rdataset.Rdataset``.
zreplacement is not an rdatasetN)
isinstancer6   r7   r8   
ValueErrorrrsetRRsetto_rdatasetrF   r;   r<   r=   r   r9   )r   replacements     r   replace_rdatasetNode.replace_rdataset   s     +s||'<'<===>>k399??33 &113K[00+2D2D(//	1k*r   r	   N)__name__
__module____qualname____firstlineno____doc__	__slots__r   r   r"   r'   r*   r-   r1   r6   	rdatatypeNONEr?   rB   rF   rO   __static_attributes__ r   r   r   r      sx    'I!(2
&#$ 58MM4F4F""H 47==3E3E!@ 7:mm6H6H '"+r   r   )rU   r   dns.rdatasetr6   dns.rdatatypedns.rendererr   rZ   r   r   <module>r^      s"   $ 0 	   b+ b+r   