ó
OyTLc           @   s¦   d  d l  m Z d  d l m Z m Z d  d l m Z m Z 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 Z d e f d „  ƒ  YZ d S(	   iÿÿÿÿ(   t   easy_install(   t   convert_patht
   subst_vars(   t   Distributiont   PathMetadatat   normalize_path(   t   log(   t   DistutilsErrort   DistutilsOptionErrorNt   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>   /usr/lib/python2.7/dist-packages/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>   /usr/lib/python2.7/dist-packages/setuptools/command/develop.pyR      s
    			c         C   sù  |  j  d ƒ } | j r7 t d | j | j f ƒ ‚ 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 r!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   targett   p(    (    s>   /usr/lib/python2.7/dist-packages/setuptools/command/develop.pyR    '   s@    	

"'	$c         C   sÖ   |  j  d ƒ |  j d d d ƒ|  j  d ƒ |  j ƒ  t j r\ |  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(   NR   t	   build_extt   inplacei   s   Creating %s (link to %s)t   ws   
(   t   run_commandt   reinitialize_commandt   install_site_pyt
   setuptoolst   bootstrap_install_fromR    R   R   t   infoR*   R+   t   dry_runt   opent   writeR   R   t   closet   process_distributionR-   t   no_deps(   R   t   f(    (    s>   /usr/lib/python2.7/dist-packages/setuptools/command/develop.pyR   V   s    
		c         C   sé   t  j j |  j ƒ r­ t j d |  j |  j ƒ g  t |  j ƒ D] } | j ƒ  ^ q> } | |  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   R=   R+   R?   t   rstripR   R   t   warnR>   t   unlinkt
   update_pthR-   t   distributiont   scripts(   R   t   linet   contents(    (    s>   /usr/lib/python2.7/dist-packages/setuptools/command/develop.pyR   l   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_scriptsRJ   RK   R&   R'   R,   R   t   basenameR?   t   readRA   t   install_script(   R   R-   t   script_namet   script_pathRD   t   script_text(    (    s>   /usr/lib/python2.7/dist-packages/setuptools/command/develop.pyRO   {   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_optionst   Falset   command_consumes_argumentsR   R   R    R   R   RO   (    (    (    s>   /usr/lib/python2.7/dist-packages/setuptools/command/develop.pyR	      s   
				/		(   t   setuptools.command.easy_installR    t   distutils.utilR   R   t   pkg_resourcesR   R   R   t	   distutilsR   t   distutils.errorsR   R   R&   R;   R%   R	   (    (    (    s>   /usr/lib/python2.7/dist-packages/setuptools/command/develop.pyt   <module>   s   $