File: //proc/self/root/opt/alt/python37/lib/python3.7/site-packages/dns/__pycache__/node.cpython-37.pyc
B
��fz1 � @ s� d Z ddlmZmZmZ ddlZddlZddlZddl Zddl
ZddlZddlZddl
ZddlZejjhZejjejjejjhZdd� ZejG dd� dej��ZG dd � d �ZejjG d
d� de��ZdS )z)DNS nodes. A node is a set of rdatasets.� )�Any�Dict�OptionalNc C s || kp|t jjko|| kS )N)�dns� rdatatypeZRRSIG)Zrdtypes�rdtype�covers� r �9/opt/alt/python37/lib/python3.7/site-packages/dns/node.py�_matches_type_or_its_signature. s r c @ sR e Zd ZdZdZdZdZeej j
ej j
d d�dd��Zeejj
d d�d d
��ZdS )�NodeKindzRdatasets in nodesr � � )r r �returnc C s. t t||�rtjS t t||�r$tjS tjS d S )N)r �_cname_typesr �CNAME�_neutral_types�NEUTRAL�REGULAR)�clsr r r r r
�classify: s
zNodeKind.classify)�rdatasetr c C s | � |j|j�S )N)r r r )r r r r r
�classify_rdatasetE s zNodeKind.classify_rdatasetN)�__name__�
__module__�__qualname__�__doc__r r r �classmethodr r � RdataTyper r �Rdatasetr r r r r
r 2 s r c @ s( e Zd ZdZdgZdd� Zejje e
ef e
d�dd�Zdd � Z
d
d� Zdd
� Zdd� Zdd� Zdd� Zejjdfejjejjejjeejjd�dd�Zejjdfejjejjejjeeejj d�dd�Zejjfejjejjejjdd�dd�Zejjdd�dd �Ze d!�d"d#�Z!ed!�d$d%�Z"dS )&�Nodea� A Node is a set of rdatasets.
A node is either a CNAME node or an "other data" node. A CNAME
node contains only CNAME, KEY, NSEC, and NSEC3 rdatasets along with their
covering RRSIG rdatasets. An "other data" node contains any
rdataset other than a CNAME or RRSIG(CNAME) rdataset. When
changes are made to a node, the CNAME or "other data" state is
always consistent with the update, i.e. the most recent change
wins. For example, if you have a node which contains a CNAME
rdataset, and then add an MX rdataset to it, then the CNAME
rdataset will be deleted. Likewise if you have a node containing
an MX rdataset and add a CNAME rdataset, the MX rdataset will be
deleted.
� rdatasetsc C s
g | _ d S )N)r! )�selfr r r
�__init__] s z
Node.__init__)�name�kwr c K sR t �� }x8| jD ].}t|�dkr|�|j|f|�� |�d� qW |�� dd� 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.
*name*, a ``dns.name.Name``, the owner name of the
rdatasets.
Returns a ``str``.
r �
N���)�io�StringIOr! �len�write�to_text�getvalue)r"