Your IP : 3.22.68.228


Current Path : /usr/lib64/python3.6/site-packages/yaml/__pycache__/
Upload File :
Current File : //usr/lib64/python3.6/site-packages/yaml/__pycache__/reader.cpython-36.pyc

3

<z�W��@sLddgZddlmZmZddlZddlZGdd�de�ZGdd�de�ZdS)�Reader�ReaderError�)�	YAMLError�Mark�Nc@seZdZdd�Zdd�ZdS)rcCs"||_||_||_||_||_dS)N)�name�	character�position�encoding�reason)�selfrr	rr
r�r
�/usr/lib64/python3.6/reader.py�__init__s
zReaderError.__init__cCsHt|jt�r,d|jt|j�|j|j|jfSd|j|j|j|jfSdS)Nz>'%s' codec can't decode byte #x%02x: %s
  in "%s", position %dz8unacceptable character #x%04x: %s
  in "%s", position %d)�
isinstancer�bytesr
�ordrrr	)rr
r
r�__str__!szReaderError.__str__N)�__name__�
__module__�__qualname__rrr
r
r
rrsc@sfeZdZdd�Zddd�Zddd�Zdd	d
�Zdd�Zd
d�Ze	j
d�Zdd�Zdd�Z
ddd�ZdS)rcCs�d|_d|_d|_d|_d|_d|_d|_d|_d|_d|_	d|_
d|_t|t
�rnd|_|j|�|d|_nHt|t�r�d|_||_|j�n(||_t|dd�|_d	|_d|_|j�dS)
NrT�z<unicode string>�z
<byte string>rz<file>F)r�stream�stream_pointer�eof�buffer�pointer�
raw_buffer�
raw_decoder
�index�line�columnr�str�check_printabler�determine_encoding�getattr)rrr
r
rr;s2



zReader.__init__rcCsDy|j|j|Stk
r>|j|d�|j|j|SXdS)Nr)rr�
IndexError�update)rr r
r
r�peekWs
zReader.peekrcCs4|j|t|j�kr|j|�|j|j|j|�S)N)r�lenrr()r�lengthr
r
r�prefix^s
z
Reader.prefixcCs�|j|dt|j�kr&|j|d�x�|r�|j|j}|jd7_|jd7_|dkst|dkr�|j|jdkr�|jd7_d|_n|dkr�|jd7_|d8}q(WdS)Nru	
…

�
�
ru)rr*rr(r r!r")rr+Zchr
r
r�forwardcszReader.forwardcCsF|jdkr(t|j|j|j|j|j|j�St|j|j|j|jdd�SdS)N)rrrr r!r"rr)rr
r
r�get_markrs

zReader.get_markcCs�x,|jr,|jdks"t|j�dkr,|j�qWt|jt�r�|jjtj�rXtj	|_
d|_n,|jjtj�rvtj
|_
d|_ntj|_
d|_|jd�dS)N�z	utf-16-lez	utf-16-bezutf-8r)rrr*�
update_rawrr�
startswith�codecs�BOM_UTF16_LE�utf_16_le_decoderr
�BOM_UTF16_BE�utf_16_be_decode�utf_8_decoder()rr
r
rr%zs"zReader.determine_encodingu[^	

 -~… -퟿-�]cCsP|jj|�}|rL|j�}|jt|j�|j|j�}t|j	|t
|�dd��dS)NZunicodez"special characters are not allowed)�
NON_PRINTABLE�search�groupr r*rr�startrrr)r�data�matchrr	r
r
rr$�szReader.check_printablecCs6|jdkrdS|j|jd�|_d|_�xt|j�|k�r0|jsH|j�|jdk	r�y|j|jd|j�\}}Wq�tk
r�}zP|j|j}|j	dk	r�|j
t|j�|j}n|j}t|j|||j
|j��WYdd}~Xq�Xn|j}t|�}|j|�|j|7_|j|d�|_|jr*|jd7_d|_Pq*WdS)Nr�strictr)rrrr*rr2r�UnicodeDecodeErrorr=rrrrr
rr$)rr+r>Z	converted�excrr	r
r
rr(�s6



 
z
Reader.update�cCsL|jj|�}|jdkr||_n|j|7_|jt|�7_|sHd|_dS)NT)r�readrrr*r)r�sizer>r
r
rr2�s
zReader.update_rawN)r)r)r)rC)rrrrr)r,r/r0r%�re�compiler:r$r(r2r
r
r
rr-s



)	�__all__�errorrrr4rFr�objectrr
r
r
r�<module>s

?>