Your IP : 18.220.227.250


Current Path : /usr/lib/python3.6/site-packages/dns/__pycache__/
Upload File :
Current File : //usr/lib/python3.6/site-packages/dns/__pycache__/exception.cpython-36.opt-1.pyc

3

d��W�@shdZGdd�de�ZGdd�de�ZGdd�de�ZGdd�de�ZGd	d
�d
e�ZGdd�de�Zd
S)zCommon DNS Exceptions.csReZdZdZdZe�ZdZ�fdd�Zdd�Z	dd�Z
d	d
�Z�fdd�Z�Z
S)
�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 standard Python Exception class
    as before and all *args are printed by 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 has to be empty and all kwargs has to exactly match
    set in class variable self.supp_kwargs. All kwargs are stored inside
    self.kwargs and used in new __str__ implementation to construct
    formatted message based on self.fmt string.

    In the simplest case it is enough to override supp_kwargs and fmt
    class variables to get nice parametrized messages.
    Ncsp|j||�|r*|jf|�|_t|�|_nt�|_|jdkrD|j|_|rZtt|�j	|�ntt|�j	|j�dS)N)
�
_check_params�
_check_kwargs�kwargs�str�msg�dict�__doc__�superr�__init__)�self�argsr)�	__class__��/usr/lib/python3.6/exception.pyr
.s
zDNSException.__init__cOs|s|rdS)zsOld exceptions supported only args and not kwargs.

        For sanity we do not allow to mix old and new behavior.Nr)rrrrrrr=szDNSException._check_paramscKs|r|S)Nr)rrrrrrEszDNSException._check_kwargscKshi}x^|j�D]R\}}t|ttf�rXttt|��||<t||�dkr`||j�||<q|||<qW|S)z�Format kwargs before printing them.

        Resulting dictionary has to have keys necessary for str.format call
        on fmt class variable.
        �)�items�
isinstance�list�set�mapr�len�pop)rr�fmtargs�kw�datarrr�_fmt_kwargsLszDNSException._fmt_kwargscs:|jr(|jr(|jf|j�}|jjf|�Stt|�j�SdS)N)r�fmtr�formatr	r�__str__)rr)r
rrr^szDNSException.__str__)�__name__�
__module__�__qualname__rrr�supp_kwargsrr
rrrr�
__classcell__rr)r
rrsrc@seZdZdZdS)�	FormErrorzDNS message is malformed.N)rr r!rrrrrr$hsr$c@seZdZdZdS)�SyntaxErrorzText input is malformed.N)rr r!rrrrrr%msr%c@seZdZdZdS)�
UnexpectedEndzText input ended unexpectedly.N)rr r!rrrrrr&rsr&c@seZdZdZdS)�TooBigzThe DNS message is too big.N)rr r!rrrrrr'wsr'c@seZdZdZedg�ZdZdS)�TimeoutzThe DNS operation timed out.Ztimeoutz3The DNS operation timed out after {timeout} secondsN)rr r!rrr"rrrrrr(|s
r(N)r�	Exceptionrr$r%r&r'r(rrrr�<module>sU

?>