ó
ú2ec           @  s¤   d  d l  m Z d  d l Z d  d l Z d  d l m Z d  d l m Z d Z d Z	 d d e e	 e
 e d  Z e d k r  d  d l Z e j e d e
   n  d S(   i˙˙˙˙(   t   print_functionN(   t   fnmatchcase(   t   convert_paths   *.pys   *.pycs
   *$py.classs   *~s   .*s   *.bakt   CVSt   _darcss   ./builds   ./dists   EGG-INFOs
   *.egg-infot   .t    c         C  s4  i  } t  |   d | | f g } x| r/| j d  \ }  } } } xät j |   D]Ó}	 t j j |  |	  }
 t j j |
  rt } xe | D]] } t |	 |  sź |
 j	   | j	   k r t
 } | rč t d |
 | f d t j n  Pq q W| rü qU n  t j j t j j |
 d   r]| r]| s3|	 } n | d |	 } | j |
 d | t f  q(| j |
 | |	 d | | f  qU | s| rU t } xe | D]] } t |	 |  sČ|
 j	   | j	   k rt
 } | rôt d |
 | f d t j n  PqqW| rqU n  | j | g   j | |	  qU qU Wq$ W| S(	   sj  
    Return a dictionary suitable for use in ``package_data``
    in a distutils ``setup.py`` file.

    The dictionary looks like::

        {'package': [files]}

    Where ``files`` is a list of all the files in that package that
    don't match anything in ``exclude``.

    If ``only_in_packages`` is true, then top-level directories that
    are not packages won't be included (but directories under packages
    will).

    Directories matching any pattern in ``exclude_directories`` will
    be ignored; by default directories with leading ``.``, ``CVS``,
    and ``_darcs`` will be ignored.

    If ``show_ignored`` is true, then all the files that aren't
    included in package data are shown on stderr (for debugging
    purposes).

    Note patterns use wildcards, or can be exact paths (including
    leading ``./``), and all searching is case-insensitive.
    R   i    s"   Directory %s ignored by pattern %st   files   __init__.pyR   t   /s   File %s ignored by pattern %s(   R   t   popt   ost   listdirt   patht   joint   isdirt   FalseR   t   lowert   Truet   printt   syst   stderrt   isfilet   appendt
   setdefault(   t   wheret   packaget   excludet   exclude_directoriest   only_in_packagest   show_ignoredt   outt   stackt   prefixt   namet   fnt   bad_namet   patternt   new_package(    (    s=   /usr/local/lib/python2.7/dist-packages/paste/util/finddata.pyt   find_package_data   sN    !	!	$(t   __main__R   (   s   *.pys   *.pycs
   *$py.classs   *~s   .*s   *.bak(   s   .*R   R   s   ./builds   ./dists   EGG-INFOs
   *.egg-info(   t
   __future__R    R
   R   t   fnmatchR   t   distutils.utilR   t   standard_excludet   standard_exclude_directoriesR   R   R&   t   __name__t   pprint(    (    (    s=   /usr/local/lib/python2.7/dist-packages/paste/util/finddata.pyt   <module>   s     G