관리-도구
편집 파일: line_endings.cpython-37.pyc
B ��Fd � @ sz d Z ddlmZmZmZ ddlZddlZddlZdd� Zdd� Z dd � Z d d� Zdd � Zdd� Z edkrve ejd � dS )z9 Functions for converting from DOS to UNIX line endings � )�division�absolute_import�print_functionNc C s� t j�| �rt| d� dS t| d��� }d|kr>t| d� dS t�dd|�}||kr~td| � t| d �}|�|� |� � | S t| 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�close)�file�data�newdata�f� r �O/opt/alt/python37/lib64/python3.7/site-packages/numpy/distutils/line_endings.py�dos2unix s r c C s: x4|D ],}t j�||�}t|�}|d k r| �|� qW d S )N)r r �joinr �append)�modified_files�dir_name� file_namesr � full_pathr r r �dos2unix_one_dir s r! c C s g }t j�| t|� |S )N)r r �walkr! )r r r r r �dos2unix_dir$ s r# c C s� t j�| �rt| d� dS t| d��� }d|kr>t| d� dS t�dd|�}t�dd|�}||kr�td| � t| d �}|�|� |� � | S t| d � dS )zFReplace LF with CRLF in argument files. Print names of changed files.z Directory!Nr r zBinary!z r z unix2dos:r r ) r r r r r r r r r r )r r r r r r r �unix2dos* s r$ c C s: x4|D ],}t j�||�}t|� |d k r| �|� qW d S )N)r r r r$ r )r r r r r r r r �unix2dos_one_dir? s r% c C s g }t j�| t|� |S )N)r r r"