ó
¸ïìXc           @   si   d  d l  Z  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   s€   e  Z d  Z d „  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   s&   t  j j |  ƒ d  |  _ d  |  _ d  S(   N(   t   origR   t   initialize_optionst   Nonet	   multiarcht   install_layout(   t   self(    (    sB   /usr/lib/python2.7/dist-packages/setuptools/command/install_lib.pyR      s    	c         C   sg   t  j j |  ƒ |  j d d ƒ |  j d k rc t j d  d	 k rc d d  l } | j d ƒ |  _	 n  d  S(
   Nt   installR   t   debi   i   iÿÿÿÿt	   MULTIARCH(   s   install_layouts   install_layout(   i   i   (
   R   R   t   finalize_optionst   set_undefined_optionsR   t   syst   version_infot	   sysconfigt   get_config_varR   (   R   R   (    (    sB   /usr/lib/python2.7/dist-packages/setuptools/command/install_lib.pyR      s
    "c         C   s6   |  j  ƒ  |  j ƒ  } | d  k	 r2 |  j | ƒ n  d  S(   N(   t   buildR	   R   t   byte_compile(   R   t   outfiles(    (    sB   /usr/lib/python2.7/dist-packages/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   /usr/lib/python2.7/dist-packages/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   /usr/lib/python2.7/dist-packages/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   /usr/lib/python2.7/dist-packages/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   /usr/lib/python2.7/dist-packages/setuptools/command/install_lib.pyR   4   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   /usr/lib/python2.7/dist-packages/setuptools/command/install_lib.pyR   >   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%   R3   (   t   base(    (    sB   /usr/lib/python2.7/dist-packages/setuptools/command/install_lib.pyR   N   s    			i   i    c            s  | r | r | s t  ‚ ˆ j ƒ  ‰  ˆ  s\ d d  l } ˆ j | j _ t j j ˆ | | ƒ Sd d l	 m
 } d d l m ‰ g  ‰ ˆ j rê d d  l }	 |	 j d ƒ ‰ ˆ j ˆ j ˆ d ƒ rÉ d  ‰ qê d ˆ d  ˆ j ˆ d f ‰ n  ‡  ‡ ‡ ‡ ‡ ‡ f d †  }
 | | | |
 ƒ ˆ S(   Niÿÿÿÿ(   t   unpack_directory(   t   logt
   EXT_SUFFIXiýÿÿÿs   %s-%s%sc            s¯   | ˆ  k r  ˆ j  d | ƒ t Sˆ j r ˆ r | j ˆ ƒ r | j ˆ ƒ r | j ˆ ˆ ƒ } ˆ j d t j j | ƒ ƒ n  ˆ j d |  t j j	 | ƒ ƒ ˆ j
 | ƒ | S(   Ns/   Skipping installation of %s (namespace package)s   renaming extension to %ss   copying %s -> %s(   t   warnt   FalseR   t   endswitht   replacet   infoR#   R$   t   basenamet   dirnamet   append(   t   srct   dst(   t   excludet
   ext_suffixR9   t
   new_suffixR   R   (    sB   /usr/lib/python2.7/dist-packages/setuptools/command/install_lib.pyt   pf~   s    	.(   t   AssertionErrorR    t   distutils.dir_utilR   t   dir_utilt
   _multiarchR   R   t	   copy_treet   setuptools.archive_utilR8   t	   distutilsR9   R   R   R=   R   (   R   t   infilet   outfilet   preserve_modet   preserve_timest   preserve_symlinkst   levelRO   R8   R   RH   (    (   RE   RF   R9   RG   R   R   sB   /usr/lib/python2.7/dist-packages/setuptools/command/install_lib.pyRM   c   s$    		!c         C   sK   t  j j |  ƒ } |  j ƒ  } | rG g  | D] } | | k r+ | ^ q+ S| S(   N(   R   R   t   get_outputsR    (   R   t   outputsRE   t   f(    (    sB   /usr/lib/python2.7/dist-packages/setuptools/command/install_lib.pyRV      s
    #(   t   __name__t
   __module__t   __doc__R   R   R   R    R   t   staticmethodR   R   R   RM   RV   (    (    (    sB   /usr/lib/python2.7/dist-packages/setuptools/command/install_lib.pyR      s   					
	*(
   R#   R   R6   t	   itertoolsR    R   t   distutils.command.install_libt   commandR   R   (    (    (    sB   /usr/lib/python2.7/dist-packages/setuptools/command/install_lib.pyt   <module>   s
   