ó
b-äQc           @   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  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/site-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/site-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/site-packages/setuptools/command/develop.pyR    '   s@    	

"'	$c         C   s·  t  j d k 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 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(   Ni   t   use_2to3t   build_pyt   inplacei    R   R+   t	   build_exti   s   Creating %s (link to %s)t   ws   
(   i   (    t   syst   version_infot   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>   /usr/lib/python2.7/site-packages/setuptools/command/develop.pyR   V   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   RG   R+   RI   t   rstripRK   R   R   t   warnRH   t   unlinkt
   update_pthR-   R=   t   scripts(   R   t   egg_link_filet   linet   contents(    (    s>   /usr/lib/python2.7/site-packages/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=   RW   R&   R'   R,   R   t   basenameRI   t   readRK   t   install_script(   R   R-   t   script_namet   script_pathRQ   t   script_text(    (    s>   /usr/lib/python2.7/site-packages/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>   /usr/lib/python2.7/site-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:   RE   R%   R	   (    (    (    s>   /usr/lib/python2.7/site-packages/setuptools/command/develop.pyt   <module>   s   0