AlkantarClanX12

Your IP : 3.149.232.87


Current Path : /opt/alt/python38/lib64/python3.8/__pycache__/
Upload File :
Current File : //opt/alt/python38/lib64/python3.8/__pycache__/fileinput.cpython-38.opt-2.pyc

U

i�fu9�@s�ddlZddlZdddddddd	d
ddd
gZdad!ddd�dd�Zdd�Zdd�Zdd�Zdd�Zdd�Z	dd�Z
dd	�Zdd
�ZGdd�d�Z
dd�Zd"dd
�Zdd�Zed kr�e�dS)#�N�input�close�nextfile�filename�lineno�
filelineno�fileno�isfirstline�isstdin�	FileInput�hook_compressed�hook_encodedF��r��mode�openhookcCs(trtjrtd��t|||||d�atS)Nzinput() already activer)�_state�_file�RuntimeErrorr)�files�inplace�backuprr�r�./opt/alt/python38/lib64/python3.8/fileinput.pyrSs
cCst}da|r|��dS�N)rr)�staterrrr`scCststd��t��S�Nzno active input())rrrrrrrrhs
cCststd��t��Sr)rrrrrrrrvscCststd��t��Sr)rrrrrrrrscCststd��t��Sr)rrrrrrrr�scCststd��t��Sr)rrrrrrrr�scCststd��t��Sr)rrr	rrrrr	�scCststd��t��Sr)rrr
rrrrr
�sc@s�eZdZd(ddd�dd�Zdd	�Zd
d�Zdd
�Zdd�Zdd�Zdd�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zd d!�Zd"d#�Zd$d%�Zd&d'�ZdS))rNFrrrcCst|t�r|f}nBt|tj�r,t�|�f}n(|dkrBtjdd�}|sLd}nt|�}||_||_	||_
d|_d|_d|_
d|_d|_d|_d|_d|_|dkr�td��d|kr�ddl}|�dtd	�||_d|kr�|�d
d�nd|_|�r|r�td��t|��std
��||_dS)N�)�-rF)rZrU�U�rbz=FileInput opening mode must be one of 'r', 'rU', 'U' and 'rb'r z'U' mode is deprecated�r�wz4FileInput cannot use an opening hook in inplace modez#FileInput openhook must be callable)�
isinstance�str�os�PathLike�fspath�sys�argv�tuple�_files�_inplace�_backup�_savestdout�_output�	_filename�_startlineno�_filelinenor�_isstdin�_backupfilename�
ValueError�warnings�warn�DeprecationWarning�_mode�replace�_write_mode�callable�	_openhook)�selfrrrrrr7rrr�__init__�sH
�
zFileInput.__init__cCs|��dSr�r�r?rrr�__del__�szFileInput.__del__cCsz|��W5d|_XdS)Nr)r,rrBrrrr�szFileInput.closecCs|SrrrBrrr�	__enter__�szFileInput.__enter__cCs|��dSrrA)r?�type�value�	tracebackrrr�__exit__�szFileInput.__exit__cCs|SrrrBrrr�__iter__�szFileInput.__iter__cCs6|��}|r|jd7_|S|js(t�|��qdS�Nr)�	_readliner3r�
StopIterationr�r?�linerrr�__next__�szFileInput.__next__cCsXddl}|jdtdd�||��kr,td��z
|��WStk
rRtd��YnXdS)NrzTSupport for indexing FileInput objects is deprecated. Use iterator protocol instead.r")�
stacklevelzaccessing lines out of orderzend of input reached)r7r8r9rrrOrL�
IndexError)r?�ir7rrr�__getitem__s�
zFileInput.__getitem__cCs�|j}d|_|r|t_|j}d|_z|r0|�
�W5|j}d|_z|`Wntk
r\YnXz|rr|jsr|�
�W5|j}d|_|r�|js�zt	�
|�Wntk
r�YnXd|_XXdS)NF)r/r)�stdoutr0rrK�AttributeErrorr5r.r&�unlink�OSErrorr4r)r?Z
savestdout�output�fileZbackupfilenamerrrrs4

zFileInput.nextfilecCs6|��}|r|jd7_|S|js(|S|��qdSrJ)rKr3rrrMrrr�readline.szFileInput.readlinecCs�|jsd|jkrdSdS|jd|_|jdd�|_|��|_d|_d|_d|_d|_|jdkr�d|_d|jkr�t	t
jd	t
j�|_nt
j|_d
|_�nT|j�r�t
�|j�|jp�d|_zt
�|j�Wntk
r�YnXt
�|j|j�t|j|j�|_zt
�|j���j}Wn&tk
�r8t|j|j�|_YntXt
jt
jBt
jB}tt
d��rb|t
jO}t
�|j||�}t
�||j�|_zt
�|j|�Wntk
�r�YnXt
j |_!|jt
_ n,|j"�r�|�"|j|j�|_nt|j|j�|_|jj#|_$|�$�S)
N�b�rrrFrz<stdin>�bufferTz.bak�O_BINARY)%r,r:r1rr2r3rr4r5�getattrr)�stdinr-r&r(r.rVrW�rename�open�fstatr�st_moder<r0�O_CREAT�O_WRONLY�O_TRUNC�hasattrr^�fdopen�chmodrTr/r>rZrK)r?Zpermr�fdrrrrK9s\




�


zFileInput._readlinecCs|jSr)r1rBrrrrrszFileInput.filenamecCs|j|jSr)r2r3rBrrrruszFileInput.linenocCs|jSr�r3rBrrrrxszFileInput.filelinenocCs4|jr,z|j��WStk
r(YdSXndSdS)N���)rrr6rBrrrr{s
zFileInput.filenocCs
|jdkSrJrlrBrrrr	�szFileInput.isfirstlinecCs|jSr)r4rBrrrr
�szFileInput.isstdin)NFr)�__name__�
__module__�__qualname__r@rCrrDrHrIrOrSrrZrKrrrrr	r
rrrrr�s(
�)9	cCsVtj�|�d}|dkr,ddl}|�||�S|dkrHddl}|�||�St||�SdS)Nrz.gzrz.bz2)r&�path�splitext�gziprb�bz2ZBZ2File)rrZextrsrtrrrr�scs��fdd�}|S)Ncst||��d�S)N��encoding�errors)rb)rrrurrr�szhook_encoded.<locals>.openhookr)rvrwrrrurr
�scCs�ddl}d}d}|�tjdd�d�\}}|D] \}}|dkrBd}|dkr.|}q.t|||d�D]b}|d	d�d
kr~|dd	�}|d	d�dkr�|dd	�}tdt�t�t�t�r�d
p�d|f�q^tdt�t�t�f�dS)NrFrzib:z-iTz-b)rrrm�
�
z%d: %s[%d]%s %s�*rz
%d: %s[%d])	�getoptr)r*r�printrrrr	)r{rrZopts�args�o�arNrrr�_test�s&�
r��__main__)NFr)N)r)r&�__all__rrrrrrrrr	r
rrr
r�rnrrrr�<module>Ks2�
	

			^