AlkantarClanX12

Your IP : 3.142.252.203


Current Path : /proc/self/root/lib/python3.6/site-packages/dns/__pycache__/
Upload File :
Current File : //proc/self/root/lib/python3.6/site-packages/dns/__pycache__/wiredata.cpython-36.pyc

3

�b�W��@s^dZddlZddlZddlmZmZGdd�de�Ze�dd�ZGdd�de�Z	d	d
�Z
dS)zDNS Wire Data Helper�N�)�binary_type�string_typesc@s&eZdZdd�Zejdkr"dd�ZdS)�_SliceUnspecifiedBoundcCs|jS)N)�stop)�self�key�r	�/usr/lib/python3.6/wiredata.py�__getitem__ sz"_SliceUnspecifiedBound.__getitem__�cCs|jt||��S)N)r�slice)r�i�jr	r	r
�__getslice__$sz#_SliceUnspecifiedBound.__getslice__N)r)�__name__�
__module__�__qualname__r�sys�version_inforr	r	r	r
rs
rcs>eZdZ�fdd�Zejd
kr&dd�Zdd�Zdd	�Z�Z	S)�WireDatacs�y�t|t�r�|j}|j}tjdkrx|tkr2t|�}|dksB|dkrJtj	j
�||kr�tt|�j
|�tt|�j
|d�n6x4||fD](}|dkr�q�q�t|�t|�kr�tj	j
�q�Wttt|�j
t||���St|j��|Stk
r�tj	j
�YnXdS)Nrrr)r)�
isinstancer
�startrrr�_unspecified_bound�len�dns�	exception�	FormError�superrr�abs�	bytearray�unwrap�
IndexError)rrrr�index)�	__class__r	r
r-s,

zWireData.__getitem__rcCs|jt||��S)N)rr
)rrrr	r	r
rPszWireData.__getslice__ccsBd}x8y||V|d7}Wqtjjk
r8t�YqXqWdS)Nrr)rrr�
StopIteration)rrr	r	r
�__iter__Ss
zWireData.__iter__cCst|�S)N)r)rr	r	r
r!\szWireData.unwrap)r)
rrrrrrrr&r!�
__classcell__r	r	)r$r
r*s
"
	rcCsJt|t�r|St|t�r t|�St|t�r6t|j��Stdt|���dS)Nzunhandled type %s)rrrr�encode�
ValueError�type)Zwirer	r	r
�
maybe_wrap`s


r+)�__doc__rZ
dns.exceptionrZ_compatrrrrrr+r	r	r	r
�<module>s		6