
[Y                 @   sl  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
 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  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)	Extension)DistributionFeature_get_unpatched)Requiresetupr   r   r   r   r   find_packagesTzlib2to3.fixes.c                s.  g  } t  |   d f 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   } | rI | j | |  | j | | | d f  qI qI Wq WxG t	 |  d g D]2  d d l
 m      f d d   | D } q 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).
     r   r   z__init__.pyZez_setup)fnmatchcasec                s%   g  |  ] }   |   s |  q S r   ).0item)r   patr   F/home/kubikplay/www/django_dtb/build/setuptools/setuptools/__init__.py
<listcomp>7   s   	 z!find_packages.<locals>.<listcomp>)r   poposlistdirpathjoinisdirisfileappendlistfnmatchr   )whereexclude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&   C   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,   r-   r   r   r   r.   I   s    zCommand.reinitialize_commandN)__name__
__module____qualname__r%   __doc__Zcommand_consumes_argumentsr&   r.   r   r   r   r   r   >   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   Z   s   	 zfindall.<locals>.<listcomp>)	r   walkcurdir
startswithsepextendfilterr   r   )dirZ	all_filesdirsfilesr   )r8   r   findallQ   s    ( rB   dont_write_bytecodeZPYTHONDONTWRITEBYTECODE)%r5   r   sysdistutils.core	distutilsdistutils.filelistr   r%   distutils.utilr   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:   rB   filelistgetattrboolenvirongetZ_dont_write_bytecoder   r   r   r   <module>   s2   			