ó
¨9Vc           @   s°   d  d l  m Z d  d l m Z d  d l m Z m Z d  d l Z d  d l Z d  d l	 m
 Z
 m Z m Z d  d l m Z d  d l m Z d  d l Z d e f d	     YZ d S(
   i˙˙˙˙(   t   convert_path(   t   log(   t   DistutilsErrort   DistutilsOptionErrorN(   t   Distributiont   PathMetadatat   normalize_path(   t   easy_install(   t   PY3t   developc           B   ss   e  Z d  Z d Z e j d d g Z e j d g Z e Z	 d   Z
 d   Z d	   Z d
   Z d   Z d   Z RS(   s   Set up package for developments%   install package in 'development mode't	   uninstallt   us   Uninstall this source packages	   egg-path=s-   Set the path to be used in the .egg-link filec         C   s7   |  j  r t |  _ |  j   n
 |  j   |  j   d  S(   N(   R
   t   Truet   multi_versiont   uninstall_linkt   install_for_developmentt   warn_deprecated_options(   t   self(    (    s>   /tmp/pip-build-5Z5nTX/setuptools/setuptools/command/develop.pyt   run   s
    		
c         C   s5   d  |  _ d  |  _ t j |   d  |  _ d |  _ d  S(   Nt   .(   t   NoneR
   t   egg_pathR   t   initialize_optionst
   setup_patht   always_copy_from(   R   (    (    s>   /tmp/pip-build-5Z5nTX/setuptools/setuptools/command/develop.pyR   #   s
    			c         C   s  |  j  d  } | j rC d } | j | j f } t | |   n  | j g |  _ t j |   |  j   |  j	   |  j
 j t j d   t j j |  j | j d  |  _ | j |  _ |  j d  k rä t j j | j  |  _ n  t |  j  } t t j j |  j |  j   } | | k r3t d |   n  t | t | t j j | j   d | j |  _ |  j j t j d  } | t j k r§d | j d  d	 } n  | |  _ t t j j |  j |  j |   } | t t j  k rt d
 | t t j    n  d  S(   Nt   egg_infos-   Please rename %r to %r before using 'develop's   *.eggs	   .egg-linksA   --egg-path must be a relative path from the install directory to t   project_namet   /s   ../i   sG   Can't get a consistent path to setup script from installation directory(    t   get_finalized_commandt   broken_egg_infoR   R   t   egg_namet   argsR   t   finalize_optionst   expand_basedirst   expand_dirst   package_indext   scant   globt   ost   patht   joint   install_dirt   egg_linkt   egg_baseR   R   t   abspathR   R   R   R   t   distt   replacet   sept   curdirt   countR   (   R   t   eit   templateR   t   targetR   t   p(    (    s>   /tmp/pip-build-5Z5nTX/setuptools/setuptools/command/develop.pyR    *   sF    	

	$c         C   sŽ  t  rŘ t |  j d t  rŘ |  j d d d |  j d  |  j d  } t | j  } |  j d d | |  j d  |  j d d d |  j d  |  j d  } | |  _	 | |  j
 _ t | | j  |  j
 _ n- |  j d  |  j d d d |  j d  |  j   t j r4|  j t j  d  t _ n  t j d	 |  j |  j  |  j st |  j d
  } | j |  j	 d |  j  | j   n  |  j d  |  j
 |  j  d  S(   Nt   use_2to3t   build_pyt   inplacei    R   R+   t	   build_exti   s   Creating %s (link to %s)t   ws   
(   R   t   getattrt   distributiont   Falset   reinitialize_commandt   run_commandR   R   t	   build_libR   R-   t   locationR   R   t	   _providert   install_site_pyt
   setuptoolst   bootstrap_install_fromR   R   R   t   infoR*   R+   t   dry_runt   opent   writeR   t   closet   process_distributiont   no_deps(   R   t   bpy_cmdt
   build_patht   ei_cmdt   f(    (    s>   /tmp/pip-build-5Z5nTX/setuptools/setuptools/command/develop.pyR   X   s4    	
		c         C   sů   t  j j |  j  r˝ t j d |  j |  j  t |  j  } g  | D] } | j   ^ qD } | j	   | |  j
 g |  j
 |  j g f k r t j d |  d  S|  j s˝ t  j |  j  q˝ n  |  j sŮ |  j |  j  n  |  j j rő t j d  n  d  S(   Ns   Removing %s (link to %s)s$   Link points to %s: uninstall aborteds5   Note: you must uninstall or replace scripts manually!(   R&   R'   t   existsR*   R   RF   R+   RH   t   rstripRJ   R   R   t   warnRG   t   unlinkt
   update_pthR-   R<   t   scripts(   R   t   egg_link_filet   linet   contents(    (    s>   /tmp/pip-build-5Z5nTX/setuptools/setuptools/command/develop.pyR      s    
		c         C   s˛   | |  j  k	 r t j |  |  S|  j |  x |  j j p> g  D]k } t j j t	 |   } t j j
 |  } t | d  } | j   } | j   |  j | | | |  q? Wd  S(   Nt   rU(   R-   R   t   install_egg_scriptst   install_wrapper_scriptsR<   RV   R&   R'   R,   R    t   basenameRH   t   readRJ   t   install_script(   R   R-   t   script_namet   script_pathRP   t   script_text(    (    s>   /tmp/pip-build-5Z5nTX/setuptools/setuptools/command/develop.pyR[      s    
(   s	   uninstallR   s   Uninstall this source packageN(   s	   egg-path=Ns-   Set the path to be used in the .egg-link file(   t   __name__t
   __module__t   __doc__t   descriptionR   t   user_optionsR   t   boolean_optionsR=   t   command_consumes_argumentsR   R   R    R   R   R[   (    (    (    s>   /tmp/pip-build-5Z5nTX/setuptools/setuptools/command/develop.pyR	      s   
			.	.	(   t   distutils.utilR    t	   distutilsR   t   distutils.errorsR   R   R&   R%   t   pkg_resourcesR   R   R   t   setuptools.command.easy_installR   t   setuptools.compatR   RD   R	   (    (    (    s>   /tmp/pip-build-5Z5nTX/setuptools/setuptools/command/develop.pyt   <module>   s   