B
    È S]á  ã               @   sD   d Z ddlZddlmZ ddlmZ ddlmZ G dd„ deƒZdS )zudistutils.command.install_scripts

Implements the Distutils 'install_scripts' command, for installing
Python scripts.é    N)ÚCommand)Úlog)ÚST_MODEc               @   sL   e Zd ZdZddddgZddgZdd	„ Zd
d„ Zdd„ Zdd„ Z	dd„ Z
dS )Úinstall_scriptsz%install scripts (Python or otherwise))zinstall-dir=Údzdirectory to install scripts to)z
build-dir=Úbz'build directory (where to install from))ÚforceÚfz-force installation (overwrite existing files))z
skip-buildNzskip the build stepsr   z
skip-buildc             C   s   d | _ d| _d | _d | _d S )Nr   )Úinstall_dirr   Ú	build_dirÚ
skip_build)Úself© r   ú2lib/python3.7/distutils/command/install_scripts.pyÚinitialize_options   s    z"install_scripts.initialize_optionsc             C   s    |   dd¡ |   dddd¡ d S )NZbuild)Úbuild_scriptsr   Zinstall)r   r
   )r   r   )r   r   )Zset_undefined_options)r   r   r   r   Úfinalize_options!   s
    z install_scripts.finalize_optionsc             C   s†   | j s|  d¡ |  | j| j¡| _tjdkr‚xT|  ¡ D ]H}| j	rNt
 d|¡ q6t |¡t dB d@ }t
 d||¡ t ||¡ q6W d S )Nr   Úposixzchanging mode of %sim  iÿ  zchanging mode of %s to %o)r   Zrun_commandZ	copy_treer   r
   ÚoutfilesÚosÚnameÚget_outputsZdry_runr   ÚinfoÚstatr   Úchmod)r   ÚfileÚmoder   r   r   Úrun)   s    

zinstall_scripts.runc             C   s   | j jp
g S )N)ZdistributionZscripts)r   r   r   r   Ú
get_inputs8   s    zinstall_scripts.get_inputsc             C   s
   | j pg S )N)r   )r   r   r   r   r   ;   s    zinstall_scripts.get_outputsN)Ú__name__Ú
__module__Ú__qualname__ZdescriptionZuser_optionsZboolean_optionsr   r   r   r   r   r   r   r   r   r      s   r   )	Ú__doc__r   Zdistutils.corer   Z	distutilsr   r   r   r   r   r   r   r   Ú<module>   s
   