
    ,h#                        d Z ddlmZmZmZmZmZmZ ddlZ	ddl
Z	ddlZ	ddlZ	 G d de	j                  j                        Z	 	 	 	 ddee	j                   j"                  ef   dedee	j(                  j*                  ef   d	ee	j,                  j.                  ef   d
ee   dee	j                   j0                     dee	j                   j"                     dedee	j                   j"                     defdZdee	j                   j"                  ef   dedee	j(                  j*                  ef   d	ee	j,                  j.                  ef   d
edefdZ	 ddee	j                   j"                  ef   dedee	j8                  j:                     dee	j                   j0                     def
dZdee	j                   j"                  ef   dededefdZy)z)DNS RRsets (an RRset is a named rdataset)    )Any
CollectionDictOptionalUnioncastNc                       e Zd ZdZddgZej                  j                  dfdej                  j                  dej                  j                  dej                  j                  dej                  j                  deej                  j                     f
 fdZ fd	Zd
 Zd Z fdZdededef fdZ	 ddej                  j                  dej                  j                  dej                  j                  dej                  j                  deej                  j                     def fdZ	 	 ddeej                  j                     dedeeef   def fdZ	 	 ddedeej                  j4                     deej                  j                     deeef   def
 fdZdej:                  j<                  fdZ xZ S )RRseta6  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deletingNrdclassrdtypecoversc                 D    t         |   |||       || _        || _        y)zCreate a new RRset.N)super__init__r   r   selfr   r   r   r   r   	__class__s         K/var/www/html/Resume-Scraper/venv/lib/python3.12/site-packages/dns/rrset.pyr   zRRset.__init__(   s$     	&&1	     c                 h    t         |          }| j                  |_        | j                  |_        |S N)r   _cloner   r   )r   objr   s     r   r   zRRset._clone6   s*    gn99}}
r   c                    | j                   dk(  rd}n/dt        j                  j                  | j                         z   dz   }| j                  -dt        j
                  j                  | j                        z   }nd}dt        | j                        z   dz   t        j
                  j                  | j                        z   dz   t        j                  j                  | j                        z   |z   |z   dz   | j                         z   d	z   S )
Nr    ()z delete=z<DNS  z RRset: >)r   dns	rdatatypeto_textr   
rdataclassstrr   r   r   _rdata_repr)r   ctextdtexts      r   __repr__zRRset.__repr__<   s    ;;!E#--//<<sBE==$!7!7!FFEE$))n nn$$T\\23 	
 mm##DKK01     	! 
	
r   c                 "    | j                         S r   )r$   r   s    r   __str__zRRset.__str__S   s    ||~r   c                     t        |t              r| j                  |j                  k7  r&yt        |t        j                  j
                        syt        |   |      S )NF)
isinstancer
   r   r"   rdatasetRdatasetr   __eq__)r   otherr   s     r   r2   zRRset.__eq__V   sF    eU#yyEJJ&E3<<#8#89w~e$$r   argskwargsreturnc                     t        |d   t        j                  j                        r | j                  |i |S t        |   |i |S )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   r4   r5   r   s      r   r:   zRRset.match^   sE     d1gsxx}}-"4??D3F337=$1&11r   c                 h    t         |   |||      sy| j                  |k7  s| j                  |k7  ryy)ztReturns ``True`` if this rrset matches the specified name, class,
        type, covers, and deletion state.
        FT)r   r:   r   r   r   s         r   r9   zRRset.full_matcho   s5     w}Wff599 9r   origin
relativizekwc                 R    t        |   | j                  ||| j                  fi |S )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   r<   r=   r>   r   s       r   r$   zRRset.to_text   s/    , wIIvz4==
<>
 	
r   filecompressc                 T    t        |   | j                  |||| j                  fi |S )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   r@   rA   r<   r>   r   s        r   rC   zRRset.to_wire   s1     wIItXvt}}
@B
 	
r   c                 h    t         j                  j                  | j                  t	        |             S )zYConvert an RRset into an Rdataset.

        Returns a ``dns.rdataset.Rdataset``.
        )r"   r0   from_rdata_listttllistr,   s    r   to_rdatasetzRRset.to_rdataset   s#    
 ||++DHHd4jAAr   r   )NT)NN)!__name__
__module____qualname____doc__	__slots__r"   r#   NONEr   r8   r%   
RdataClass	RdataTyper   r   r   r*   r-   r2   r   boolr:   r9   r   r&   r$   CompressTypeintrC   r0   r1   rH   __classcell__)r   s   @r   r
   r
      s    $I +.--*<*<8<!hhmm! **! ''	!
 ''! 3>>445!
.%23 2# 2$ 2. 9=hhmm ** ''	
 '' 3>>445 
* +/
'
 
 38n	

 

: 59*.	

 388001
 '	

 38n
 

*BS\\22 Br   r
   r   rF   r   r   text_rdatas
idna_codecr<   r=   relativize_tor6   c	           
         t        | t              r"t        j                  j	                  | d|      } t        j
                  j                  j                  |      }t        j                  j                  j                  |      }t        | ||      }	|	j                  |       |D ]L  }
t        j                  j	                  |	j                  |	j                  |
||||      }|	j                  |       N |	S )ay  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rV   )r/   r&   r"   r   	from_textr%   rO   maker#   rP   r
   
update_ttlrdatar   r   add)r   rF   r   r   rU   rV   r<   r=   rW   rtrds               r   from_text_listrb      s    : $xx!!$!Dnn'',,W5G]]$$))&1FdGV$ALL YY  IIqxxFJz
 	
b		
 Hr   c           
      J    t        | |||t        t        t           |            S )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.
    )rb   r   r   r&   )r   rF   r   r   rU   s        r   rZ   rZ      s'     c7FDC+$F r   rdatasc                 @   t        | t              r"t        j                  j	                  | d|      } t        |      dk(  rt        d      d}|D ]G  }|2t        | |j                  |j                        }|j                  |       |j                  |       I |J |S )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.

    NrY   r   zrdata list must not be empty)r/   r&   r"   r   rZ   len
ValueErrorr
   r   r   r\   r^   )r   rF   rd   rV   r_   ra   s         r   rE   rE      s    " $xx!!$!D
6{a788A 9dBJJ		2ALL	b		
 =Hr   c                 n    t        | |t        t        t        j                  j
                     |            S )zCreate an RRset with the specified name and TTL, and with
    the specified rdata objects.

    Returns a ``dns.rrset.RRset`` object.
    )rE   r   r   r"   r]   Rdata)r   rF   rd   s      r   
from_rdatarj     s'     4d:ciioo+F&OPPr   )NNTNr   ) rL   typingr   r   r   r   r   r   dns.namer"   dns.rdataclassdns.rdatasetdns.rendererr0   r1   r
   r   r8   r&   rS   r%   rO   r#   rP   	IDNACodecrQ   rb   rZ   r]   ri   rE   rj    r   r   <module>rr      s(  $ 0 ? ?    ZBCLL!! ZBF 04&*-1(
s"
#(	( 3>>,,c12( #--))3./	(
 C( ++,( SXX]]#( ( CHHMM*( (V
s"
#	 3>>,,c12 #--))3./	
  , 04	
s"
#	 syy' ++,	
 @QU388==#-. QS Q3 Q5 Qr   