ó
.¿”Wc           @   s]   d  d l  Z  d  d l Z d  d l m Z m Z d  d l j j Z d e j f d „  ƒ  YZ d S(   iÿÿÿÿN(   t   productt   starmapt   install_libc           B   sn   e  Z d  Z d „  Z d „  Z d „  Z e d „  ƒ Z d „  Z e d „  ƒ Z	 d d d d d	 „ Z
 d
 „  Z RS(   s9   Don't add compiled flags to filenames of non-Python filesc         C   s6   |  j  ƒ  |  j ƒ  } | d  k	 r2 |  j | ƒ n  d  S(   N(   t   buildt   installt   Nonet   byte_compile(   t   selft   outfiles(    (    sB   /tmp/pip-build-Q3rTTP/setuptools/setuptools/command/install_lib.pyt   run
   s    
c            sG   ‡  f d †  ˆ  j  ƒ  Dƒ } t | ˆ  j ƒ  ƒ } t t ˆ  j | ƒ ƒ S(   s—   
        Return a collections.Sized collections.Container of paths to be
        excluded for single_version_externally_managed installations.
        c         3   s+   |  ]! } ˆ  j  | ƒ D] } | Vq q d  S(   N(   t   _all_packages(   t   .0t   ns_pkgt   pkg(   R   (    sB   /tmp/pip-build-Q3rTTP/setuptools/setuptools/command/install_lib.pys	   <genexpr>   s   (   t   _get_SVEM_NSPsR    t   _gen_exclusion_pathst   setR   t   _exclude_pkg_path(   R   t   all_packagest
   excl_specs(    (   R   sB   /tmp/pip-build-Q3rTTP/setuptools/setuptools/command/install_lib.pyt   get_exclusions   s    c         C   s,   | j  d ƒ | g } t j j |  j | Œ S(   sw   
        Given a package name and exclusion path within that package,
        compute the full exclusion path.
        t   .(   t   splitt   ost   patht   joint   install_dir(   R   R   t   exclusion_patht   parts(    (    sB   /tmp/pip-build-Q3rTTP/setuptools/setuptools/command/install_lib.pyR      s    c         c   s.   x' |  r) |  V|  j  d ƒ \ }  } } q Wd S(   sn   
        >>> list(install_lib._all_packages('foo.bar.baz'))
        ['foo.bar.baz', 'foo.bar', 'foo']
        R   N(   t
   rpartition(   t   pkg_namet   sept   child(    (    sB   /tmp/pip-build-Q3rTTP/setuptools/setuptools/command/install_lib.pyR
   '   s    	c         C   s<   |  j  j s g  S|  j d ƒ } | j } | r8 |  j  j Sg  S(   s‰   
        Get namespace packages (list) but only for
        single_version_externally_managed installations and empty otherwise.
        R   (   t   distributiont   namespace_packagest   get_finalized_commandt!   single_version_externally_managed(   R   t   install_cmdt   svem(    (    sB   /tmp/pip-build-Q3rTTP/setuptools/setuptools/command/install_lib.pyR   1   s
    	c          c   si   d Vd Vd Vt  t d ƒ s" d St j j d d t j ƒ  ƒ }  |  d V|  d	 V|  d
 V|  d Vd S(   sk   
        Generate file paths to be excluded for namespace packages (bytecode
        cache files).
        s   __init__.pys   __init__.pycs   __init__.pyot   get_tagNt   __pycache__s	   __init__.s   .pycs   .pyos
   .opt-1.pycs
   .opt-2.pyc(   t   hasattrt   impR   R   R   R'   (   t   base(    (    sB   /tmp/pip-build-Q3rTTP/setuptools/setuptools/command/install_lib.pyR   A   s    			i   i    c   	         s   | r | r | s t  ‚ |  j ƒ  ‰  ˆ  sA t j j |  | | ƒ Sd d l m } d d l m ‰ g  ‰ ‡  ‡ ‡ f d †  } | | | | ƒ ˆ S(   Niÿÿÿÿ(   t   unpack_directory(   t   logc            sP   | ˆ  k r  ˆ j  d | ƒ t Sˆ j d |  t j j | ƒ ƒ ˆ j | ƒ | S(   Ns/   Skipping installation of %s (namespace package)s   copying %s -> %s(   t   warnt   Falset   infoR   R   t   dirnamet   append(   t   srct   dst(   t   excludeR-   R   (    sB   /tmp/pip-build-Q3rTTP/setuptools/setuptools/command/install_lib.pyt   pfg   s    	(	   t   AssertionErrorR   t   origR   t	   copy_treet   setuptools.archive_utilR,   t	   distutilsR-   (	   R   t   infilet   outfilet   preserve_modet   preserve_timest   preserve_symlinkst   levelR,   R6   (    (   R5   R-   R   sB   /tmp/pip-build-Q3rTTP/setuptools/setuptools/command/install_lib.pyR9   V   s    
c         C   sK   t  j j |  ƒ } |  j ƒ  } | rG g  | D] } | | k r+ | ^ q+ S| S(   N(   R8   R   t   get_outputsR   (   R   t   outputsR5   t   f(    (    sB   /tmp/pip-build-Q3rTTP/setuptools/setuptools/command/install_lib.pyRB   t   s
    #(   t   __name__t
   __module__t   __doc__R	   R   R   t   staticmethodR
   R   R   R9   RB   (    (    (    sB   /tmp/pip-build-Q3rTTP/setuptools/setuptools/command/install_lib.pyR      s   			
	(	   R   R*   t	   itertoolsR    R   t   distutils.command.install_libt   commandR   R8   (    (    (    sB   /tmp/pip-build-Q3rTTP/setuptools/setuptools/command/install_lib.pyt   <module>   s   