ó
ÓnùWc           @   sõ   d  d l  Z  d  d l Z d  d l Z d  d l m Z d  d l Z d  d l m Z d  d l m	 Z	 d  d l
 m Z d  d l m Z d Z d
 d „ Z d e f d „  ƒ  YZ d
 d „ Z e d e j d e j ƒ ƒ e j g Z d e f d „  ƒ  YZ d S(   iÿÿÿÿN(   t   glob(   t   sdist(   t   convert_path(   t   log(   t	   svn_utilst   READMEs
   README.rsts
   README.txtt    c         c   s@   x9 t  j d ƒ D]( } x | j ƒ  |  ƒ D] } | Vq) Wq Wd S(   s%   Find all files under revision controls   setuptools.file_findersN(   t   pkg_resourcest   iter_entry_pointst   load(   t   dirnamet   ept   item(    (    s?   /var/www/html/venv/build/setuptools/setuptools/command/sdist.pyt   walk_revctrl   s    t	   re_finderc           B   s8   e  Z d  Z d „  d „ Z d „  Z d d „ Z e Z RS(   sc   
    Finder that locates files based on entries in a file matched by a
    regular expression.
    c         C   s   |  S(   N(    (   t   x(    (    s?   /var/www/html/venv/build/setuptools/setuptools/command/sdist.pyt   <lambda>   s    c         C   s%   | |  _  | |  _ t | ƒ |  _ d  S(   N(   t   patternt   postprocR   t   entries_path(   t   selft   pathR   R   (    (    s?   /var/www/html/venv/build/setuptools/setuptools/command/sdist.pyt   __init__   s    		c         c   s}   t  | d ƒ } z | j ƒ  } Wd  | j ƒ  XxI |  j j | ƒ D]5 } | j d ƒ } |  j | ƒ } t j | | ƒ Vq@ Wd  S(   Nt   rUi   (	   t   opent   readt   closeR   t   finditert   groupR   R   t   joinpath(   R   R
   t   filenamet   ft   datat   matchR   (    (    s?   /var/www/html/venv/build/setuptools/setuptools/command/sdist.pyt   _finder"   s    R   c         c   sš   t  j | |  j ƒ } t j j | ƒ s+ d  Sxh |  j | | ƒ D]T } t j j | ƒ r^ | Vq> t j j | ƒ r> x |  j | ƒ D] } | Vq€ Wq> q> Wd  S(   N(	   R   R   R   t   osR   t   isfileR"   t   isdirt   find(   R   R
   R   R   (    (    s?   /var/www/html/venv/build/setuptools/setuptools/command/sdist.pyR&   /   s    (   t   __name__t
   __module__t   __doc__R   R"   R&   t   __call__(    (    (    s?   /var/www/html/venv/build/setuptools/setuptools/command/sdist.pyR      s
   	c         c   s1   x* t  D]" } x | |  ƒ D] } | Vq Wq Wd S(   s   Primary svn_cvs entry pointN(   t   finders(   R
   t   finderR   (    (    s?   /var/www/html/venv/build/setuptools/setuptools/command/sdist.pyt   _default_revctrl>   s    s   CVS/Entriess   ^\w?/([^/]+)/R   c           B   sË   e  Z d  Z d d d d d f d g Z i  Z d
 „  Z d „  Z e j	 d k  pŠ d e j	 k oi d k  n pŠ d e j	 k oˆ d k  n Z
 e
 rœ e Z n  d „  Z d „  Z d „  Z d „  Z d „  Z RS(   s=   Smart sdist that finds anything supported by revision controls   formats=s6   formats for source distribution (comma-separated list)s	   keep-tempt   ks1   keep the distribution tree around after creating s   archive file(s)s	   dist-dir=t   dsF   directory to put the source distribution archive(s) in [default: dist]c         C   s  |  j  d ƒ |  j d ƒ } | j |  _ |  j j t j j | j d ƒ ƒ |  j ƒ  x! |  j	 ƒ  D] } |  j  | ƒ qa Wd d  l
 } d | j j k r£ |  j ƒ  n  |  j ƒ  t |  j d g  ƒ } x< |  j D]1 } d d | f } | | k rÌ | j | ƒ qÌ qÌ Wd  S(   Nt   egg_infos   SOURCES.txtiÿÿÿÿt   checkt
   dist_filesR   R   (   t   run_commandt   get_finalized_commandt   filelistt   appendR#   R   t   joinR0   t   check_readmet   get_sub_commandst   distutils.commandt   commandt   __all__t   check_metadatat   make_distributiont   getattrt   distributiont   archive_files(   R   t   ei_cmdt   cmd_namet	   distutilsR2   t   fileR    (    (    s?   /var/www/html/venv/build/setuptools/setuptools/command/sdist.pyt   run[   s     "

c         C   sC   y t  j |  ƒ Wn+ t j ƒ  d j j j d j ƒ  ‚  n Xd  S(   Ni   t   template(   t   _sdistt   read_templatet   syst   exc_infot   tb_nextt   tb_framet   f_localsR   (   R   (    (    s?   /var/www/html/venv/build/setuptools/setuptools/command/sdist.pyt   __read_template_hackt   s
    !i   i   i   i    i   i   c         C   so  t  |  j j g } xÂ | D]º } t | t ƒ r | } d } x: | D]2 } t j j | ƒ rA d } |  j j	 | ƒ PqA qA W| sÓ |  j
 d d j | ƒ ƒ qÓ q t j j | ƒ rÂ |  j j	 | ƒ q |  j
 d | ƒ q Wd d g } xH | D]@ } t t t j j t | ƒ ƒ ƒ } | rê |  j j | ƒ qê qê W|  j j ƒ  rÆ|  j d ƒ } |  j j | j ƒ  ƒ |  j j sÆxR | j D]D \ }	 }
 }	 } |  j j g  | D] } t j j |
 | ƒ ^ qšƒ qxWqÆn  |  j j ƒ  rý|  j d	 ƒ } |  j j | j ƒ  ƒ n  |  j j ƒ  r4|  j d
 ƒ } |  j j | j ƒ  ƒ n  |  j j ƒ  rk|  j d ƒ } |  j j | j ƒ  ƒ n  d  S(   Ni    i   s,   standard file not found: should have one of s   , s   standard file '%s' not founds   test/test*.pys	   setup.cfgt   build_pyt	   build_extt
   build_clibt   build_scripts(   t   READMESR@   t   script_namet
   isinstancet   tupleR#   R   t   existsR5   R6   t   warnR7   t   listt   filterR$   R    t   extendt   has_pure_modulesR4   t   get_source_filest   include_package_datat
   data_filest   has_ext_modulest   has_c_librariest   has_scripts(   R   t	   standardst   fnt   altst   got_itt   optionalR   t   filesRP   t   _t   src_dirt	   filenamesR   RQ   RR   RS   (    (    s?   /var/www/html/venv/build/setuptools/setuptools/command/sdist.pyt   add_defaults‰   sL    	!0c         C   sE   x> t  D] } t j j | ƒ r d  Sq W|  j d d j t  ƒ ƒ d  S(   Ns,   standard file not found: should have one of s   , (   RT   R#   R   RX   RY   R7   (   R   R   (    (    s?   /var/www/html/venv/build/setuptools/setuptools/command/sdist.pyR8   ¾   s
    c         C   sƒ   t  j |  | | ƒ t j j | d ƒ } t t d ƒ ri t j j | ƒ ri t j | ƒ |  j d | ƒ n  |  j	 d ƒ j
 | ƒ d  S(   Ns	   setup.cfgt   linkR0   (   RH   t   make_release_treeR#   R   R7   t   hasattrRX   t   unlinkt	   copy_fileR4   t   save_version_info(   R   t   base_dirRi   t   dest(    (    s?   /var/www/html/venv/build/setuptools/setuptools/command/sdist.pyRo   Ç   s    !c         C   sY   t  j j |  j ƒ s t St |  j d ƒ } z | j ƒ  } Wd  | j ƒ  X| d j ƒ  k S(   Nt   rbUs+   # file GENERATED by distutils, do NOT edit
(	   R#   R   R$   t   manifestt   FalseR   t   readlineR   t   encode(   R   t   fpt
   first_line(    (    s?   /var/www/html/venv/build/setuptools/setuptools/command/sdist.pyt   _manifest_is_not_generatedÔ   s    c         C   sÉ   t  j d |  j ƒ t |  j d ƒ } x“ | D]‹ } t j d k r y | j d ƒ } Wq t k
 r{ t  j d | ƒ q, q Xn  | j	 ƒ  } | j
 d ƒ s, | r§ q, n  |  j j | ƒ q, W| j ƒ  d S(	   sª   Read the manifest file (named by 'self.manifest') and use it to
        fill in 'self.filelist', the list of files to include in the source
        distribution.
        s   reading manifest file '%s'Rv   i   s   UTF-8s"   %r not UTF-8 decodable -- skippingt   #N(   i   (   R   t   infoRw   R   RJ   t   version_infot   decodet   UnicodeDecodeErrorRY   t   stript
   startswithR5   R6   R   (   R   Rw   t   line(    (    s?   /var/www/html/venv/build/setuptools/setuptools/command/sdist.pyt   read_manifestà   s    
N(   s   formats=Ns6   formats for source distribution (comma-separated list)(   s	   dist-dir=R/   sF   directory to put the source distribution archive(s) in [default: dist](   i   i   i   (   i   i    (   i   i   i   (   i   i   (   i   i   i   (   R'   R(   R)   t   Nonet   user_optionst   negative_optRF   t   _sdist__read_template_hackRJ   R€   t   has_leaky_handleRI   Rm   R8   Ro   R}   R†   (    (    (    s?   /var/www/html/venv/build/setuptools/setuptools/command/sdist.pyR   K   s*     					5				(   R   s
   README.rsts
   README.txt(   R#   t   reRJ   R    R   t   distutils.command.sdistR   RH   t   distutils.utilR   RD   R   t
   setuptoolsR   RT   R   t   objectR   R-   t   compilet   Mt
   svn_finderR+   (    (    (    s?   /var/www/html/venv/build/setuptools/setuptools/command/sdist.pyt   <module>   s   '