HEX
Server: LiteSpeed
System: Linux srv146.niagahoster.com 4.18.0-553.30.1.lve.el8.x86_64 #1 SMP Tue Dec 3 01:21:19 UTC 2024 x86_64
User: kodi1989 (1633)
PHP: 8.1.34
Disabled: symlink,shell_exec,exec,popen,system,dl,passthru,escapeshellarg,escapeshellcmd,show_source,pcntl_exec
Upload Files
File: //opt/alt/python37/lib/python3.7/site-packages/dns/__pycache__/rrset.cpython-37.pyc
B

��f�#�@sNdZddlmZmZmZmZmZmZddlZ	ddl
Z	ddlZ	ddlZ	Gdd�de	j
j�Zdee	jjefeee	jjefee	jjefeeee	jjee	jjeee	jjed�
dd	�Zee	jjefeee	jjefee	jjefeed
�dd�Zdee	jjefeee	jjee	jjed
�dd�Zee	jjefeeed�dd�ZdS)z)DNS RRsets (an RRset is a named rdataset)�)�Any�cast�
Collection�Dict�Optional�UnionNcs<eZdZdZddgZejjdfejj	ej
jejjejje
ej
jd��fdd�
Z�fdd	�Zd
d�Zdd
�Z�fdd�Zeeed��fdd�Zd ejj	ej
jejjejje
ej
jed��fdd�
Zd!e
ejj	eeeefed��fdd�
Zd"ee
ejje
ejj	eeefed��fdd�
Zejjd�dd�Z�Z S)#�RRseta6A 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)r	�rdclass�rdtype�coversr
cs t��|||�||_||_dS)zCreate a new RRset.N)�super�__init__r	r
)�selfr	rrr
r
)�	__class__��:/opt/alt/python37/lib/python3.7/site-packages/dns/rrset.pyr)s
zRRset.__init__cst���}|j|_|j|_|S)N)r�_cloner	r
)r�obj)rrrr7s
zRRset._clonecCs�|jdkrd}ndtj�|j�d}|jdk	rDdtj�|j�}nd}dt|j�dtj�|j�dtj�|j	�||d|�
�d	S)
Nr��(�)z delete=z<DNS � z RRset: �>)r
�dns�	rdatatype�to_textr
�
rdataclass�strr	rrZ_rdata_repr)rZctextZdtextrrr�__repr__=s

zRRset.__repr__cCs|��S)N)r)rrrr�__str__Tsz
RRset.__str__cs:t|t�r|j|jkr.dSnt|tjj�s.dSt��|�S)NF)�
isinstancerr	r�rdataset�Rdatasetr�__eq__)r�other)rrrr%Ws
zRRset.__eq__)�args�kwargs�returncs0t|dtjj�r|j||�St�j||�SdS)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.)
        rN)r"rr	�Name�
full_matchr�match)rr'r()rrrr,_szRRset.match)r	rrr
r
r)cs0t��|||�sdS|j|ks(|j|kr,dSdS)ztReturns ``True`` if this rrset matches the specified name, class,
        type, covers, and deletion state.
        FT)rr,r	r
)rr	rrr
r
)rrrr+ps
zRRset.full_matchT)�origin�
relativize�kwr)cst�j|j|||jf|�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*.
        )rrr	r
)rr-r.r/)rrrr�sz
RRset.to_text)�file�compressr-r/r)cst�j|j||||jf|�S)z�Convert 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
)rr0r1r-r/)rrrr2�sz
RRset.to_wire)r)cCstj�|jt|��S)zYConvert an RRset into an Rdataset.

        Returns a ``dns.rdataset.Rdataset``.
        )rr#�from_rdata_list�ttl�list)rrrr�to_rdataset�szRRset.to_rdataset)N)NT)NN)!�__name__�
__module__�__qualname__�__doc__�	__slots__rr�NONEr	r*r�
RdataClass�	RdataTyperrrr r!r%r�boolr,r+rrrZCompressType�intr2r#r$r6�
__classcell__rr)rrrs(	6$

rT)
r	r4rr�text_rdatas�
idna_codecr-r.�
relativize_tor)c	
Cs�t|t�rtjj|d|d�}tjj�|�}	tjj	�|�}
t
||	|
�}|�|�x2|D]*}tj�|j
|j|||||�}
|�|
�qTW|S)ayCreate 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)rC)r"rrr	�	from_textrr=�makerr>r�
update_ttl�rdatarr�add)r	r4rrrBrCr-r.rDZthe_rdclassZ
the_rdtype�r�t�rdrrr�from_text_list�s


rM)r	r4rrrBr)cGst||||ttt|��S)z�Create an RRset with the specified name, TTL, class, and type and with
    the specified rdatas in text format.

    Returns a ``dns.rrset.RRset`` object.
    )rMrrr)r	r4rrrBrrrrE�s
rE)r	r4�rdatasrCr)cCs~t|t�rtjj|d|d�}t|�dkr0td��d}x8|D]0}|dkr`t||j|j	�}|�
|�|�|�q:W|dk	szt�|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.

    N)rCrzrdata list must not be empty)
r"rrr	rE�len�
ValueErrorrrrrGrI�AssertionError)r	r4rNrCrJrLrrrr3�s


r3)r	r4rNr)cGst||tttjj|��S)z�Create an RRset with the specified name and TTL, and with
    the specified rdata objects.

    Returns a ``dns.rrset.RRset`` object.
    )r3rrrrH�Rdata)r	r4rNrrr�
from_rdatasrS)NNTN)N) r:�typingrrrrrrZdns.namerZdns.rdatasetZdns.rdataclassZdns.rendererr#r$rr	r*rr@rr=rr>Z	IDNACodecr?rMrErHrRr3rSrrrr�<module>s* %T"&