Your IP : 18.191.178.145


Current Path : /opt/alt/python36/lib64/python3.6/distutils/__pycache__/
Upload File :
Current File : //opt/alt/python36/lib64/python3.6/distutils/__pycache__/text_file.cpython-36.opt-2.pyc

3

��2a�0�@s"ddlZddlZGdd�d�ZdS)�Nc@speZdZdddddddd�Zddd�Zdd	�Zd
d�Zddd
�Zddd�Zddd�Z	dd�Z
dd�Zdd�ZdS)�TextFile�r�strict)�strip_comments�skip_blanks�	lstrip_ws�	rstrip_ws�
join_lines�
collapse_join�errorsNcKs�|dkr|dkrtd��x>|jj�D]0}||krBt||||�q$t|||j|�q$Wx&|j�D]}||jkrbtd|��qbW|dkr�|j|�n||_||_d|_g|_	dS)Nz7you must supply either or both of 'filename' and 'file'zinvalid TextFile option '%s'r)
�RuntimeError�default_options�keys�setattr�KeyError�open�filename�file�current_line�linebuf)�selfrr�options�opt�r�./opt/alt/python36/lib64/python3.6/text_file.py�__init__Ns
zTextFile.__init__cCs&||_tj|jd|jd�|_d|_dS)N�r)rr)r�iorrrr)rrrrrrosz
TextFile.opencCs$|j}d|_d|_d|_|j�dS)N)rrr�close)rrrrrrvs
zTextFile.closecCsjg}|dkr|j}|j|jd�t|ttf�rD|jdt|��n|jd|�|jt|��dj|�S)Nz, z
lines %d-%d: z	line %d: �)r�appendr�
isinstance�list�tuple�str�join)r�msg�lineZoutmsgrrr�	gen_errorszTextFile.gen_errorcCstd|j||���dS)Nzerror: )�
ValueErrorr()rr&r'rrr�error�szTextFile.errorcCs tjjd|j||�d�dS)Nz	warning: �
)�sys�stderr�writer()rr&r'rrr�warn�sz
TextFile.warncCs|jr|jd}|jd=|Sd}�x�|jj�}|dkr:d}|jr�|r�|jd�}|d
krXnX|dksp||ddkr�|ddkr�dp�d}|d|�|}|j�dkr�q$n|jdd�}|jo�|�r |dkr�|jd�|S|j	r�|j
�}||}t|jt
��r|jdd|jd<n|j|jdg|_n:|dk�r.dSt|jt
��rN|jdd|_n|jd|_|j�rt|j�rt|j�}n"|j�r�|j
�}n|j�r�|j�}|dk�s�|dk�r�|j�r�q$|j�r�|ddk�r�|dd�}q$|dd�d
k�r�|dd�d}q$|SdS)Nrr�#r�\r+z\#z2continuation line immediately precedes end-of-file�z\
���r3r3r3r3r3���r4)rr�readliner�find�strip�replacer	r/r
�lstripr!rr"rr�rstripr)rr'Zbuildup_line�posZeolrrrr5�sf




	



zTextFile.readlinecCs,g}x"|j�}|dkr|S|j|�qWdS)N)r5r )r�linesr'rrr�	readlinesszTextFile.readlinescCs|jj|�dS)N)rr )rr'rrr�
unreadlineszTextFile.unreadline)NN)N)N)N)
�__name__�
__module__�__qualname__r
rrrr(r*r/r5r=r>rrrrr
s ;
!	



x
r)r,rrrrrr�<module>s

?>