HOME


sh-3ll 1.0
DIR:/usr/local/lib64/python3.6/site-packages/numpy/distutils/__pycache__/
Upload File :
Current File : //usr/local/lib64/python3.6/site-packages/numpy/distutils/__pycache__/line_endings.cpython-36.pyc
3

���h��@sfdZddlZddlZddlZdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	e
dkrbeejd�dS)z9 Functions for converting from DOS to UNIX line endings

�NcCs�tjj|�rt|d�dSt|d��}|j�}WdQRXd|krNt|d�dStjdd|�}||kr�td|�t|d	��}|j|�WdQRX|St|d
�dS)zFReplace CRLF with LF in argument files.  Print names of changed files.z
Directory!N�rb�zBinary!z
�
z	dos2unix:�wb�ok)	�os�path�isdir�print�open�read�re�sub�write)�file�fp�data�newdata�f�r�=/tmp/pip-build-5_djhm0z/numpy/numpy/distutils/line_endings.py�dos2unix	s


rcCs:x4|D],}tjj||�}t|�}|dk	r|j|�qWdS)N)rr�joinr�append)�modified_files�dir_name�
file_namesr�	full_pathrrr�dos2unix_one_dirs

rcCsg}tjj|t|�|S)N)rr�walkr)rrrrr�dos2unix_dir%sr cCs�tjj|�rt|d�dSt|d��}|j�}WdQRXd|krNt|d�dStjdd|�}tjdd|�}||kr�td|�t|d	��}|j|�WdQRX|St|d
�dS)zFReplace LF with CRLF in argument files.  Print names of changed files.z
Directory!NrrzBinary!z
rz	unix2dos:rr)	rrr	r
rrr
rr)rrrrrrrr�unix2dos+s 


r!cCs:x4|D],}tjj||�}t|�|dk	r|j|�qWdS)N)rrrr!r)rrrrrrrr�unix2dos_one_dir@s

r"cCsg}tjj|t|�|S)N)rrrr")rrrrr�unix2dos_dirGsr#�__main__�)�__doc__rr
�sysrrr r!r"r#�__name__�argvrrrr�<module>s