ó
OyTLc           @   sb   d  d l  m Z d  d l m Z m Z m Z d  d l Z d  d l m	 Z	 d e f d     YZ d S(   i˙˙˙˙(   t   install_scripts(   t   Distributiont   PathMetadatat   ensure_directoryN(   t   logR    c           B   s,   e  Z d  Z d   Z d   Z d d  Z RS(   s;   Do normal script install, plus any egg_info wrapper scriptsc         C   s   t  j |   t |  _ d  S(   N(   t   _install_scriptst   initialize_optionst   Falset   no_ep(   t   self(    (    sF   /usr/lib/python2.7/dist-packages/setuptools/command/install_scripts.pyR   
   s    c   	      C   s  d d l  m } d d l  m } |  j d  |  j j rI t j |   n	 g  |  _ |  j	 r_ d  S|  j
 d  } t | j t | j | j  | j | j  } |  j
 d  } t | d |  } t |  j
 d  d t  } x' | | | |  D] } |  j |   qę Wd  S(	   Ni˙˙˙˙(   t   get_script_args(   t   sys_executablet   egg_infot   build_scriptst
   executablet   bdist_wininstt   _is_running(   t   setuptools.command.easy_installR
   R   t   run_commandt   distributiont   scriptsR   t   runt   outfilesR   t   get_finalized_commandR   t   egg_baseR   R   t   egg_namet   egg_versiont   getattrR   t   write_script(	   R	   R
   R   t   ei_cmdt   distt   bs_cmdR   t
   is_wininstt   args(    (    sF   /usr/lib/python2.7/dist-packages/setuptools/command/install_scripts.pyR      s$    		t   tc         G   s   d d l  m } t j d | |  j  t j j |  j |  } |  j j	 |  |  j
 s t |  t | d |  } | j |  | j   | | d  n  d S(   s1   Write an executable file to the scripts directoryi˙˙˙˙(   t   chmods   Installing %s script to %st   wií  N(   R   R#   R   t   infot   install_dirt   ost   patht   joinR   t   appendt   dry_runR   t   opent   writet   close(   R	   t   script_namet   contentst   modet   ignoredR#   t   targett   f(    (    sF   /usr/lib/python2.7/dist-packages/setuptools/command/install_scripts.pyR   (   s    	

(   t   __name__t
   __module__t   __doc__R   R   R   (    (    (    sF   /usr/lib/python2.7/dist-packages/setuptools/command/install_scripts.pyR       s   		(
   t!   distutils.command.install_scriptsR    R   t   pkg_resourcesR   R   R   R'   t	   distutilsR   (    (    (    sF   /usr/lib/python2.7/dist-packages/setuptools/command/install_scripts.pyt   <module>   s   