î
]á[\á  ã               @   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   ú7/usr/lib/python3.4/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)NZbuildÚbuild_scriptsr   Zinstallr   r   r   r   )r   z	build_dir)zinstall_scriptszinstall_dir)úforcer   )ú
skip_buildr   )Zset_undefined_options)r   r   r   r   Úfinalize_options!   s
    	z install_scripts.finalize_optionsc             C   s»   |  j  s |  j d ƒ n  |  j |  j |  j ƒ |  _ t j d k r· xq |  j ƒ  D]` } |  j	 rr t
 j d | ƒ qP t j | ƒ t d Bd @} t
 j d | | ƒ t j | | ƒ qP Wn  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_outputs)r   r   r   )r	   r
   r   )zforcer   r   )r   Nr   )Ú__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
   