î
É X]  ã               @   s  d  Z  d d l Z d d l Z d d l Z d d l Z d d l m Z d d l m	 Z	 d d l
 m Z d d l Z d d l m Z d d l m Z m Z m Z d d l m Z d	 d
 d d d d d g Z e j j Z d Z d Z d g Z d f  f  d d „ Z e j j Z e e ƒ Z Gd d „  d e ƒ Z e e j _ e j d d „ Z  e  e j! _  e" e d e# e j$ j% d ƒ ƒ ƒ Z& d S)z@Extensions to the 'distutils' for large or complex distributionsé    N)ÚCommand)Úconvert_path)Úfnmatchcase)Ú	Extension)ÚDistributionÚFeatureÚ_get_unpatched)ÚRequireÚsetupr   r   r   r   r	   Úfind_packagesTzlib2to3.fixesÚ.c       	         s[  g  } t  |  ƒ d f g } t | ƒ } t | ƒ d d g } xí | r,| j d ƒ \ }  } xË t j |  ƒ D]º } t j j |  | ƒ } d | k oÂ t j j | ƒ oÂ t j j t j j | d ƒ ƒ } | rk | | ‰ | sû t	 ‡ f d d †  | Dƒ ƒ r%| j
 ˆ ƒ | j
 | ˆ d f ƒ q%qk qk Wq@ Wx' | D] ‰  ‡  f d	 d
 †  | Dƒ } q4W| S)a  Return a list all Python packages found within directory 'where'

    'where' should be supplied as a "cross-platform" (i.e. URL-style) path; it
    will be converted to the appropriate local path syntax.  'exclude' is a
    sequence of package names to exclude; '*' can be used as a wildcard in the
    names, such that 'foo.*' will exclude all subpackages of 'foo' (but not
    'foo' itself).

    'include' is a sequence of package names to include.  If it's specified,
    only the named packages will be included.  If it's not specified, all found
    packages will be included.  'include' can contain shell style wildcard
    patterns just like 'exclude'.

    The list of included packages is built up first and then any explicitly
    excluded packages are removed from it.
    Ú Zez_setupz*__pycache__r   r   z__init__.pyc             3   s   |  ] } t  ˆ  | ƒ Vq d  S)N)r   )Ú.0Úpat)Úpkg_name© úE/home/ubuntu/projects/ifolica/build/setuptools/setuptools/__init__.pyú	<genexpr>@   s    z find_packages.<locals>.<genexpr>c                s%   g  |  ] } t  | ˆ  ƒ s | ‘ q Sr   )r   )r   Úitem)r   r   r   ú
<listcomp>D   s   	 z!find_packages.<locals>.<listcomp>)r   ÚlistÚpopÚosÚlistdirÚpathÚjoinÚisdirÚisfileÚanyÚappend)	ÚwhereÚexcludeÚincludeÚoutÚstackÚprefixÚnameÚfnZlooks_like_packager   )r   r   r   r      s(    	!
%c               @   s:   e  Z d  Z e j Z d Z d d „  Z d d d „ Z d S)r   Fc             K   sA   t  j |  | ƒ x* | j ƒ  D] \ } } t |  | | ƒ q Wd  S)N)Ú_CommandÚ__init__ÚitemsÚsetattr)ÚselfÚdistÚkwÚkÚvr   r   r   r)   P   s    zCommand.__init__r   c             K   sF   t  j |  | | ƒ } x* | j ƒ  D] \ } } t | | | ƒ q" W| S)N)r(   Úreinitialize_commandr*   r+   )r,   ÚcommandÚreinit_subcommandsr.   Úcmdr/   r0   r   r   r   r1   V   s    zCommand.reinitialize_commandN)Ú__name__Ú
__module__Ú__qualname__r(   Ú__doc__Zcommand_consumes_argumentsr)   r1   r   r   r   r   r   K   s   	c                s¦   g  } x™ t  j |  ƒ D]ˆ \ ‰  } } ˆ  t  j k sM ˆ  j t  j t  j ƒ r` ˆ  d d … ‰  n  ˆ  r‚ ‡  f d d †  | Dƒ } n  | j t t  j j | ƒ ƒ q W| S)z^Find all files under 'dir' and return the list of full filenames
    (relative to 'dir').
    é   Nc                s%   g  |  ] } t  j j ˆ  | ƒ ‘ q Sr   )r   r   r   )r   Úf)Úbaser   r   r   g   s   	 zfindall.<locals>.<listcomp>)	r   ÚwalkÚcurdirÚ
startswithÚsepÚextendÚfilterr   r   )ÚdirZ	all_filesÚdirsÚfilesr   )r;   r   Úfindall^   s    ( rE   Údont_write_bytecodeZPYTHONDONTWRITEBYTECODE)'r8   r   ÚsysÚdistutils.coreÚ	distutilsÚdistutils.filelistr   r(   Údistutils.utilr   Úfnmatchr   Zsetuptools.versionÚ
setuptoolsZsetuptools.extensionr   Zsetuptools.distr   r   r   Zsetuptools.dependsr	   Ú__all__ÚversionÚ__version__Zbootstrap_install_fromZrun_2to3_on_doctestsZlib2to3_fixer_packagesr   Úcorer
   r=   rE   ÚfilelistÚgetattrÚboolÚenvironÚgetZ_dont_write_bytecoder   r   r   r   Ú<module>   s4   		(	