
(°há  ã               @   s\   d  Z  d d l Z d d l m Z d d l m Z d d l m Z Gd 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               @   sp   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)úinstall-dir=Údúdirectory to install scripts toú
build-dir=Úbú'build directory (where to install from)ÚforceÚfú-force installation (overwrite existing files)ú
skip-buildNúskip the build stepsc             C   s(   d  |  _  d |  _ d  |  _ d  |  _ d  S)Nr   )Úinstall_dirr   Ú	build_dirÚ
skip_build)Úself© r   úS/tmp/pip-build-kmztzv_d/setuptools/setuptools/_distutils/command/install_scripts.pyÚinitialize_options   s    			z"install_scripts.initialize_optionsc             C   s*   |  j  d d	 ƒ |  j  d d
 d d ƒ d  S)NÚbuildÚbuild_scriptsr   Úinstallr   r   r   r   )zbuild_scriptsz	build_dir)zinstall_scriptszinstall_dir)úforcer   )ú
skip_buildr   )Úset_undefined_options)r   r   r   r   Úfinalize_options!   s
    	z install_scripts.finalize_optionsc             C   sµ   |  j  s |  j d ƒ |  j |  j |  j ƒ |  _ t j d k r± xn |  j ƒ  D]` } |  j	 ro t
 j d | ƒ qM t j | ƒ t d Bd @} t
 j d | | ƒ t j | | ƒ qM Wd  S)Nr   Úposixzchanging mode of %sim  iÿ  zchanging mode of %s to %o)r   Úrun_commandÚ	copy_treer   r   ÚoutfilesÚosÚnameÚget_outputsÚdry_runr   ÚinfoÚstatr   Úchmod)r   ÚfileÚmoder   r   r   Úrun)   s    		zinstall_scripts.runc             C   s   |  j  j p g  S)N)ÚdistributionÚ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_outputs)r   r   r   )r	   r
   r   )zforcer   r   )r   Nr   )Ú__name__Ú
__module__Ú__qualname__ÚdescriptionÚuser_optionsÚboolean_optionsr   r   r,   r/   r%   r   r   r   r   r      s   	r   )	Ú__doc__r#   Údistutils.corer   Ú	distutilsr   r(   r   r   r   r   r   r   Ú<module>   s
   