%PDF- %PDF-
Mini Shell

Mini Shell

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

�

5��eE���dZddlmZmZGd�de�ZGd�de�ZGd�de�ZGd	�d
e�ZGd�de�Z	Gd
�de�Z
Gd�de�ZGd�de�ZGd�de�Z
Gd�de�ZGd�d�Zy)z�Common DNS Exceptions.

Dnspython modules may also define their own exceptions, which will
always be subclasses of ``DNSException``.
�)�Optional�Setc���eZdZUdZdZeeed<e�Z	e
eed<dZeeed<�fd�Zd�Z
d�Zd	�Z�fd
�Z�xZS)�DNSExceptiona�Abstract base class shared by all dnspython exceptions.

    It supports two basic modes of operation:

    a) Old/compatible mode is used if ``__init__`` was called with
    empty *kwargs*.  In compatible mode all *args* are passed
    to the standard Python Exception class as before and all *args* are
    printed by the standard ``__str__`` implementation.  Class variable
    ``msg`` (or doc string if ``msg`` is ``None``) is returned from ``str()``
    if *args* is empty.

    b) New/parametrized mode is used if ``__init__`` was called with
    non-empty *kwargs*.
    In the new mode *args* must be empty and all kwargs must match
    those set in class variable ``supp_kwargs``. All kwargs are stored inside
    ``self.kwargs`` and used in a new ``__str__`` implementation to construct
    a formatted message based on the ``fmt`` class variable, a ``string``.

    In the simplest case it is enough to override the ``supp_kwargs``
    and ``fmt`` class variables to get nice parametrized messages.
    N�msg�supp_kwargs�fmtc�&��|j|i|��|r(|jdi|��|_t|�|_nt�|_|j�|j|_|r
t�|� |�yt�|�!|j�y�N�)	�
_check_params�
_check_kwargs�kwargs�strr�dict�__doc__�super�__init__��self�argsr�	__class__s   ��//usr/lib/python3/dist-packages/dns/exception.pyrzDNSException.__init__7s|�������D�+�F�+��,�$�,�,�6�v�6�D�K��4�y�D�H��&�D�K��8�8���|�|�D�H���G��d�#��G��T�X�X�&�c�J�|s|rt|�t|�k7sJd��yy)zsOld exceptions supported only args and not kwargs.

        For sanity we do not allow to mix old and new behavior.z=keyword arguments are mutually exclusive with positional argsN)�bool)rrrs   rr
zDNSException._check_paramsGs8���6���:���"��
O�N�
O��rc�~�|r:t|j��|jk(sJd|jz��|S)Nz-following set of keyword args is required: %s)�set�keysr)rrs  rrzDNSException._check_kwargsPs@����F�K�K�M�"�d�&6�&6�6�
T�>�$�BR�BR�S�
T�6��
rc��i}|j�D]e\}}t|ttf�rEtt	t
|��||<t
||�dk(s�J||j�||<�a|||<�g|S)z�Format kwargs before printing them.

        Resulting dictionary has to have keys necessary for str.format call
        on fmt class variable.
        �)�items�
isinstance�listr�mapr�len�pop)rr�fmtargs�kw�datas     r�_fmt_kwargszDNSException._fmt_kwargsWsy��������	#�H�B���$��s��,�"�3�s�D�>�2�����w�r�{�#�q�(�")�"�+�/�/�"3�G�B�K�"����	#��rc���|jrD|jr8|jdi|j��}|jjdi|��St�|��Sr)rr	r+�formatr�__str__)rr(rs  �rr.zDNSException.__str__isP����;�;�4�8�8�&�d�&�&�5����5�G�"�4�8�8�?�?�-�W�-�-��7�?�$�$r)�__name__�
__module__�__qualname__rrrr�__annotations__rrrr	rr
rr+r.�
__classcell__�rs@rrrsU����,�C��#����E�K��S��!��C��#���'� O���$%�%rrc��eZdZdZy)�	FormErrorzDNS message is malformed.N�r/r0r1rrrrr6r6ss��#rr6c��eZdZdZy)�SyntaxErrorzText input is malformed.Nr7rrrr9r9w���"rr9c��eZdZdZy)�
UnexpectedEndzText input ended unexpectedly.Nr7rrrr<r<{s��(rr<c��eZdZdZy)�TooBigzThe DNS message is too big.Nr7rrrr>r>s��%rr>c�,��eZdZdZdhZdZ�fd�Z�xZS)�TimeoutzThe DNS operation timed out.�timeoutz7The DNS operation timed out after {timeout:.3f} secondsc�$��t�|�|i|��y�N)rrrs   �rrzTimeout.__init__�s���
���$�)�&�)r)r/r0r1rrr	rr3r4s@rr@r@�s���&��+�K�
C�C�*�*rr@c��eZdZdZy)�UnsupportedAlgorithmz&The DNSSEC algorithm is not supported.Nr7rrrrErE�s��0rrEc��eZdZdZy)�AlgorithmKeyMismatchz=The DNSSEC algorithm is not supported for the given key type.Nr7rrrrGrG�s��GrrGc��eZdZdZy)�ValidationFailurez The DNSSEC signature is invalid.Nr7rrrrIrI�s��*rrIc��eZdZdZy)�DeniedByPolicyzDenied by DNSSEC policy.Nr7rrrrKrK�r:rrKc��eZdZd�Zd�Zd�Zy)�ExceptionWrapperc��||_yrC)�exception_class)rrOs  rrzExceptionWrapper.__init__�s
��.��rc��|SrCr)rs r�	__enter__zExceptionWrapper.__enter__�s���rc�j�|�1t||j�s|jt|��|�y)NF)r#rOr)r�exc_type�exc_val�exc_tbs    r�__exit__zExceptionWrapper.__exit__�s1����
�7�D�<P�<P�(Q��&�&�s�7�|�4�'�A�rN)r/r0r1rrQrVrrrrMrM�s��/��rrMN)r�typingrr�	Exceptionrr6r9r<r>r@rErGrIrKrMrrr�<module>rYs���$�!�T%�9�T%�n$��$�#�,�#�)�K�)�&�\�&�	*�l�	*�1�<�1�H�/�H�+��+�#�\�#�
�
r

Zerion Mini Shell 1.0