
    ui                         S r SSKrSSKrSSKrSSKr " S S\R                  R                  5      r  S	S jr	S r
S
S jrS rg)z)DNS RRsets (an RRset is a named rdataset)    Nc                      ^  \ rS rSrSrSS/r\R                  R                  S4U 4S jjr	U 4S jr
S rS	 rU 4S
 jrU 4S jr SU 4S jjrSU 4S jjrSU 4S jjrS rSrU =r$ )RRset   a  A DNS RRset (named rdataset).

RRset inherits from Rdataset, and RRsets can be treated as
Rdatasets in most cases.  There are, however, a few notable
exceptions.  RRsets have different to_wire() and to_text() method
arguments, reflecting the fact that RRsets always have an owner
name.
namedeletingNc                 >   > [         TU ]  X#U5        Xl        XPl        g)zCreate a new RRset.N)super__init__r   r   selfr   rdclassrdtypecoversr   	__class__s         @/home/kodi/.kodi/addons/script.module.dnspython/lib/dns/rrset.pyr
   RRset.__init__(   s     	&1	     c                 h   > [         TU ]  5       nU R                  Ul        U R                  Ul        U$ N)r	   _cloner   r   )r   objr   s     r   r   RRset._clone0   s*    gn99}}
r   c                    U R                   S:X  a  SnO/S[        R                  R                  U R                   5      -   S-   nU R                  b-  S[        R
                  R                  U R                  5      -   nOSnS[        U R                  5      -   S-   [        R
                  R                  U R                  5      -   S-   [        R                  R                  U R                  5      -   U-   U-   S-   U R                  5       -   S	-   $ )
Nr    ()z delete=z<DNS  z RRset: >)r   dns	rdatatypeto_textr   
rdataclassstrr   r   r   _rdata_repr)r   ctextdtexts      r   __repr__RRset.__repr__6   s    ;;!E#--//<<sBE==$!7!7!FFEETYY'#-~~%%dll3469:}}$$T[[1249:<AB  !,,./ 255 	5r   c                 "    U R                  5       $ r   )r!   r   s    r   __str__RRset.__str__D   s    ||~r   c                    > [        U[        5      (       a  U R                  UR                  :w  a  gO*[        U[        R                  R
                  5      (       d  g[        TU ]  U5      $ )NF)
isinstancer   r   r   rdatasetRdatasetr	   __eq__)r   otherr   s     r   r1   RRset.__eq__G   sQ    eU##yyEJJ& 'E3<<#8#899w~e$$r   c                    > [        US   [        R                  R                  5      (       a  U R                  " U0 UD6$ [
        TU ]  " U0 UD6$ )a  Does this rrset match the specified attributes?

Behaves as :py:func:`full_match()` if the first argument is a
``dns.name.Name``, and as :py:func:`dns.rdataset.Rdataset.match()`
otherwise.

(This behavior fixes a design mistake where the signature of this
method became incompatible with that of its superclass.  The fix
makes RRsets matchable as Rdatasets while preserving backwards
compatibility.)
r   )r.   r   r   Name
full_matchr	   match)r   argskwargsr   s      r   r7   RRset.matchO   sF     d1gsxx}}--??D3F337=$1&11r   c                 t   > [         TU ]  X#U5      (       d  gU R                  U:w  d  U R                  U:w  a  gg)zdReturns ``True`` if this rrset matches the specified name, class,
type, covers, and deletion state.
FT)r	   r7   r   r   r   s         r   r6   RRset.full_match`   s6    
 w}Wf5599 9r   c                 R   > [         TU ]  " U R                  XU R                  40 UD6$ )a  Convert the RRset into DNS zone file format.

See ``dns.name.Name.choose_relativity`` for more information
on how *origin* and *relativize* determine the way names
are emitted.

Any additional keyword arguments are passed on to the rdata
``to_text()`` method.

*origin*, a ``dns.name.Name`` or ``None``, the origin for relative
names.

*relativize*, a ``bool``.  If ``True``, names will be relativized
to *origin*.
)r	   r!   r   r   )r   origin
relativizekwr   s       r   r!   RRset.to_textm   s-    " wtyy&#}}4024 	4r   c                 T   > [         TU ]  " U R                  XUU R                  40 UD6$ )zConvert the RRset to wire format.

All keyword arguments are passed to ``dns.rdataset.to_wire()``; see
that function for details.

Returns an ``int``, the number of records emitted.
)r	   to_wirer   r   )r   filecompressr>   r@   r   s        r   rC   RRset.to_wire   s/     wtyy$&#}}4024 	4r   c                 h    [         R                  R                  U R                  [	        U 5      5      $ )zIConvert an RRset into an Rdataset.

Returns a ``dns.rdataset.Rdataset``.
)r   r/   from_rdata_listttllistr*   s    r   to_rdatasetRRset.to_rdataset   s#    
 ||++DHHd4jAAr   )r   r   r   )NT)NN)__name__
__module____qualname____firstlineno____doc__	__slots__r   r    NONEr
   r   r'   r+   r1   r7   r6   r!   rC   rK   __static_attributes____classcell__)r   s   @r   r   r      sb     $I58]]5G5G!5%2$ "	4(4B Br   r   c	           
         [        U [        5      (       a  [        R                  R	                  U SUS9n [        R
                  R                  R                  U5      n[        R                  R                  R                  U5      n[        XU5      n	U	R                  U5        U HK  n
[        R                  R	                  U	R                  U	R                  XUX5      nU	R                  U5        MM     U	$ )aM  Create an RRset with the specified name, TTL, class, and type, and with
the specified list of rdatas in text format.

*idna_codec*, a ``dns.name.IDNACodec``, specifies the IDNA
encoder/decoder to use; if ``None``, the default IDNA 2003
encoder/decoder is used.

*origin*, a ``dns.name.Name`` (or ``None``), the
origin to use for relative names.

*relativize*, a ``bool``.  If true, name will be relativized.

*relativize_to*, a ``dns.name.Name`` (or ``None``), the origin to use
when relativizing names.  If not set, the *origin* value will be used.

Returns a ``dns.rrset.RRset`` object.
N
idna_codec)r.   r#   r   r   	from_textr"   
RdataClassmaker    	RdataTyper   
update_ttlrdatar   r   add)r   rI   r   r   text_rdatasrX   r>   r?   relativize_tortrds               r   from_text_listre      s    * $xx!!$!Dnn'',,W5G]]$$))&1FdV$ALLYY  AHHa!.<	b	  Hr   c                     [        XX#U5      $ )zCreate an RRset with the specified name, TTL, class, and type and with
the specified rdatas in text format.

Returns a ``dns.rrset.RRset`` object.
)re   )r   rI   r   r   r`   s        r   rY   rY      s     $WkBBr   c                 B   [        U [        5      (       a  [        R                  R	                  U SUS9n [        U5      S:X  a  [        S5      eSnU HH  nUc1  [        XR                  UR                  5      nUR                  U5        UR                  U5        MJ     U$ )a  Create an RRset with the specified name and TTL, and with
the specified list of rdata objects.

*idna_codec*, a ``dns.name.IDNACodec``, specifies the IDNA
encoder/decoder to use; if ``None``, the default IDNA 2003
encoder/decoder is used.

Returns a ``dns.rrset.RRset`` object.

NrW   r   zrdata list must not be empty)r.   r#   r   r   rY   len
ValueErrorr   r   r   r]   r_   )r   rI   rdatasrX   rb   rd   s         r   rH   rH      s     $xx!!$!D
6{a788A9dJJ		2ALL	b		 
 Hr   c                     [        XU5      $ )z~Create an RRset with the specified name and TTL, and with
the specified rdata objects.

Returns a ``dns.rrset.RRset`` object.
)rH   )r   rI   rj   s      r   
from_rdatarl      s     4f--r   )NNTNr   )rQ   dns.namer   dns.rdatasetdns.rdataclassdns.rendererr/   r0   r   re   rY   rH   rl    r   r   <module>rr      sR   $ 0    zBCLL!! zB| =A!%DC4.r   