
Xc           @   s@  d  Z  d d l m Z d d l m Z d d l m Z d d l m	 Z	 d d l Z d d l Z d d l
 Z
 d d l Z d d l 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 m Z d d l m Z d d l m Z d d l m Z d d l m Z m  Z  m! Z! m" Z" m# Z# m$ Z$ m% Z% m& Z& d d l' j( Z( d d l) m* Z* d d l+ m, Z, d   Z- d e f d     YZ. d e f d     YZ d e f d     YZ/ d   Z0 d   Z1 d   Z2 d   Z3 d   Z4 d   Z5 d   Z6 d   Z7 e8 d   Z9 d!   Z: d"   Z; d S(#   sU   setuptools.command.egg_info

Create a distribution's .egg-info directory and contentsi(   t   FileList(   t   DistutilsInternalError(   t   convert_path(   t   logN(   t   six(   t   map(   t   Command(   t   sdist(   t   walk_revctrl(   t   edit_config(   t	   bdist_egg(   t   parse_requirementst	   safe_namet   parse_versiont   safe_versiont   yield_linest
   EntryPointt   iter_entry_pointst   to_filename(   t   glob(   t	   packagingc         C   sj  d } |  j  t j j  } t j t j  } d | f } xt |  D]\ } } | t |  d k } | d k r | r | d 7} qG | d | | f 7} qG n  d } t |  }	 x| |	 k  rA| | }
 |
 d k r | | d 7} nJ|
 d	 k r| | 7} n1|
 d
 k r!| d } | |	 k  rB| | d k rB| d } n  | |	 k  rk| | d k rk| d } n  x* | |	 k  r| | d k r| d } qnW| |	 k r| t j |
  7} q4| | d | !} d } | d d k rd } | d } n  | t j |  7} | d | f 7} | } n | t j |
  7} | d 7} q W| sG | | 7} qG qG Wt j | d  S(   s   
    Translate a file path glob like '*.txt' in to a regular expression.
    This differs from fnmatch.translate which allows wildcards to match
    directory separators. It also knows about '**/' which matches any number of
    directories.
    t    s   [^%s]i   s   **s   .*s
   (?:%s+%s)*i    t   *t   ?t   [t   !t   ]t   ^s   [%s]s   \Z(?ms)(	   t   splitt   ost   patht   sept   ret   escapet	   enumeratet   lent   compile(   R   t   patt   chunksR   t
   valid_chart   ct   chunkt
   last_chunkt   it	   chunk_lent   chart   inner_it   innert
   char_class(    (    s?   /usr/lib/python2.7/dist-packages/setuptools/command/egg_info.pyt   translate_pattern$   sT    

	t   egg_infoc           B   s   e  Z d  Z d d d d g Z d g Z i d d
 6Z d   Z e d    Z e j	 d    Z d   Z
 d   Z e d  Z d   Z d   Z d   Z d   Z d   Z d   Z d   Z RS(   s+   create a distribution's .egg-info directorys	   egg-base=t   esL   directory containing .egg-info directories (default: top of the source tree)s   tag-datet   ds0   Add date stamp (e.g. 20050528) to version numbers
   tag-build=t   bs-   Specify explicit tag to add to version numbers   no-datet   Ds"   Don't include date stamp [default]c         C   sL   d  |  _ d  |  _ d  |  _ d  |  _ d  |  _ d |  _ t |  _ d  |  _	 d  S(   Ni    (
   t   Nonet   egg_namet   egg_versiont   egg_baseR2   t	   tag_buildt   tag_datet   Falset   broken_egg_infot   vtags(   t   self(    (    s?   /usr/lib/python2.7/dist-packages/setuptools/command/egg_info.pyt   initialize_options   s    							c         C   s   d  S(   N(    (   R@   (    (    s?   /usr/lib/python2.7/dist-packages/setuptools/command/egg_info.pyt   tag_svn_revision   s    c         C   s   d  S(   N(    (   R@   t   value(    (    s?   /usr/lib/python2.7/dist-packages/setuptools/command/egg_info.pyRB      s    c         C   sO   t  t d t  } |   } |  j   | d <d | d <t | t d |   d S(   s   
        Materialize the value of date into the
        build tag. Install build keys in a deterministic order
        to avoid arbitrary reordering on subsequent builds.
        t   OrderedDictR;   i    R<   R2   N(   t   getattrt   collectionst   dictt   tagsR	   (   R@   t   filenamet   odictR2   (    (    s?   /usr/lib/python2.7/dist-packages/setuptools/command/egg_info.pyt   save_version_info   s
    	
c         C   s  t  |  j j    |  _ |  j   |  _ |  j   |  _ t |  j  } yK t	 | t
 j j  } | ri d n d } t t | |  j |  j f   Wn3 t k
 r t j j d |  j |  j f   n X|  j d  k r|  j j } | p i  j d t j  |  _ n  |  j d  t |  j  d |  _ |  j t j k rXt j j |  j |  j  |  _ n  d |  j k rt|  j   n  |  j |  j j _ |  j j  } | d  k	 r| j! |  j j"   k r|  j | _# t |  j  | _$ d  |  j _  n  d  S(   Ns   %s==%ss   %s===%ss2   Invalid distribution name or version syntax: %s-%sR   R:   s	   .egg-infot   -(%   R   t   distributiont   get_nameR8   RH   R?   t   tagged_versionR9   R   t
   isinstanceR   t   versiont   Versiont   listR   t
   ValueErrort	   distutilst   errorst   DistutilsOptionErrorR:   R7   t   package_dirt   getR   t   curdirt   ensure_dirnameR   R2   R   t   joint   check_broken_egg_infot   metadatat   _patched_distt   keyt   lowert   _versiont   _parsed_version(   R@   t   parsed_versiont
   is_versiont   spect   dirst   pd(    (    s?   /usr/lib/python2.7/dist-packages/setuptools/command/egg_info.pyt   finalize_options   s8    !	!!$c         C   sl   | r |  j  | | |  nL t j j |  rh | d k rX | rX t j d | |  d S|  j |  n  d S(   s  Write `data` to `filename` or delete if empty

        If `data` is non-empty, this routine is the same as ``write_file()``.
        If `data` is empty but not ``None``, this is the same as calling
        ``delete_file(filename)`.  If `data` is ``None``, then this is a no-op
        unless `filename` exists, in which case a warning is issued about the
        orphaned file (if `force` is false), or deleted (if `force` is true).
        s$   %s not set in setup(), but %s existsN(   t
   write_fileR   R   t   existsR7   R   t   warnt   delete_file(   R@   t   whatRI   t   datat   force(    (    s?   /usr/lib/python2.7/dist-packages/setuptools/command/egg_info.pyt   write_or_delete_file   s    	c         C   sd   t  j d | |  t j r. | j d  } n  |  j s` t | d  } | j |  | j   n  d S(   s   Write `data` to `filename` (if not a dry run) after announcing it

        `what` is used in a log message to identify what is being written
        to the file.
        s   writing %s to %ss   utf-8t   wbN(	   R   t   infoR   t   PY3t   encodet   dry_runt   opent   writet   close(   R@   Rn   RI   Ro   t   f(    (    s?   /usr/lib/python2.7/dist-packages/setuptools/command/egg_info.pyRj      s    		c         C   s-   t  j d |  |  j s) t j |  n  d S(   s8   Delete `filename` (if not a dry run) after announcing its   deleting %sN(   R   Rs   Rv   R   t   unlink(   R@   RI   (    (    s?   /usr/lib/python2.7/dist-packages/setuptools/command/egg_info.pyRm      s    	c         C   sE   |  j  j   } |  j r4 | j |  j  r4 t |  St | |  j  S(   N(   RM   t   get_versionR?   t   endswithR   (   R@   RQ   (    (    s?   /usr/lib/python2.7/dist-packages/setuptools/command/egg_info.pyRO     s    
c         C   s   |  j  |  j  |  j j } xX t d  D]J } | j d |  | j   } | |  | j t j	 j
 |  j | j   q) Wt j	 j
 |  j d  } t j	 j |  r |  j |  n  |  j   d  S(   Ns   egg_info.writerst	   installers   native_libs.txt(   t   mkpathR2   RM   t   fetch_build_eggR   t   requiret   resolvet   nameR   R   R\   Rk   Rm   t   find_sources(   R@   R~   t   ept   writert   nl(    (    s?   /usr/lib/python2.7/dist-packages/setuptools/command/egg_info.pyt   run
  s    ,c         C   sB   d } |  j  r | |  j  7} n  |  j r> | t j d  7} n  | S(   NR   s   -%Y%m%d(   R;   R<   t   timet   strftime(   R@   RQ   (    (    s?   /usr/lib/python2.7/dist-packages/setuptools/command/egg_info.pyRH     s    		c         C   sJ   t  j j |  j d  } t |  j  } | | _ | j   | j |  _ d S(   s"   Generate SOURCES.txt manifest files   SOURCES.txtN(	   R   R   R\   R2   t   manifest_makerRM   t   manifestR   t   filelist(   R@   t   manifest_filenamet   mm(    (    s?   /usr/lib/python2.7/dist-packages/setuptools/command/egg_info.pyR   !  s
    	
c         C   s   |  j  d } |  j t j k r: t j j |  j |  } n  t j j |  r t j d d d d d | |  j	  |  j	 |  _
 | |  _	 n  d  S(   Ns	   .egg-infoRL   iN   s   
Note: Your current .egg-info directory has a '-' in its name;
this will not work correctly with "setup.py develop".

Please rename %s to %s to correct this problem.
(   R8   R:   R   RZ   R   R\   Rk   R   Rl   R2   R>   (   R@   t   bei(    (    s?   /usr/lib/python2.7/dist-packages/setuptools/command/egg_info.pyR]   )  s    (   s	   egg-base=R3   sL   directory containing .egg-info directories (default: top of the source tree)(   s   tag-dateR4   s0   Add date stamp (e.g. 20050528) to version number(   s
   tag-build=R5   s-   Specify explicit tag to add to version number(   s   no-dateR6   s"   Don't include date stamp [default](   t   __name__t
   __module__t   descriptiont   user_optionst   boolean_optionst   negative_optRA   t   propertyRB   t   setterRK   Ri   R=   Rq   Rj   Rm   RO   R   RH   R   R]   (    (    (    s?   /usr/lib/python2.7/dist-packages/setuptools/command/egg_info.pyR2   v   s*   		
			/						R    c           B   s   e  Z d    Z d   Z d   Z d   Z d   Z d   Z d   Z d   Z	 d   Z
 d	   Z d
   Z d   Z d   Z d   Z RS(   c         C   s  |  j  |  \ } } } } | d k rw |  j d d j |   x| D]( } |  j |  sH t j d |  qH qH Wnx| d k r |  j d d j |   xO| D]( } |  j |  s t j d |  q q Wn| d k r/|  j d	 d j |   x| D]( } |  j |  s t j d
 |  q q Wn| d k r|  j d d j |   x| D]( } |  j |  s\t j d |  q\q\Wnd| d k r|  j d | d j |  f  x5| D]. } |  j	 | |  st j d | |  qqWn | d k r[|  j d | d j |  f  x | D]. } |  j
 | |  s&t j d | |  q&q&Wn | d k r|  j d |  |  j |  st j d |  qnR | d k r|  j d |  |  j |  st j d |  qn t d |   d  S(   Nt   includes   include t    s%   warning: no files found matching '%s't   excludes   exclude s9   warning: no previously-included files found matching '%s's   global-includes   global-include s>   warning: no files found matching '%s' anywhere in distributions   global-excludes   global-exclude sR   warning: no previously-included files matching '%s' found anywhere in distributions   recursive-includes   recursive-include %s %ss:   warning: no files found matching '%s' under directory '%s's   recursive-excludes   recursive-exclude %s %ssN   warning: no previously-included files matching '%s' found under directory '%s't   grafts   graft s+   warning: no directories found matching '%s't   prunes   prune s6   no previously-included directories found matching '%s's'   this cannot happen: invalid action '%s'(   t   _parse_template_linet   debug_printR\   R   R   Rl   R   t   global_includet   global_excludet   recursive_includet   recursive_excludeR   R   R   (   R@   t   linet   actiont   patternst   dirt   dir_patternt   pattern(    (    s?   /usr/lib/python2.7/dist-packages/setuptools/command/egg_info.pyt   process_template_line<  sd    									c         C   sr   t  } xe t t |  j  d d d  D]D } | |  j |  r& |  j d |  j |  |  j | =t } q& q& W| S(   s   
        Remove all files from the file list that match the predicate.
        Return True if any matching files were removed
        i   is
    removing (   R=   t   rangeR#   t   filesR   t   True(   R@   t	   predicatet   foundR+   (    (    s?   /usr/lib/python2.7/dist-packages/setuptools/command/egg_info.pyt   _remove_files  s    &
c         C   sH   g  t  |  D] } t j j |  s | ^ q } |  j |  t |  S(   s#   Include files that match 'pattern'.(   R   R   R   t   isdirt   extendt   bool(   R@   R   Rz   R   (    (    s?   /usr/lib/python2.7/dist-packages/setuptools/command/egg_info.pyR     s    1c         C   s   t  |  } |  j | j  S(   s#   Exclude files that match 'pattern'.(   R1   R   t   match(   R@   R   R   (    (    s?   /usr/lib/python2.7/dist-packages/setuptools/command/egg_info.pyR     s    c         C   sf   t  j j | d |  } g  t | d t D] } t  j j |  s+ | ^ q+ } |  j |  t |  S(   sN   
        Include all files anywhere in 'dir/' that match the pattern.
        s   **t	   recursive(   R   R   R\   R   R   R   R   R   (   R@   R   R   t   full_patternRz   R   (    (    s?   /usr/lib/python2.7/dist-packages/setuptools/command/egg_info.pyR     s
    c         C   s.   t  t j j | d |   } |  j | j  S(   sM   
        Exclude any file anywhere in 'dir/' that match the pattern.
        s   **(   R1   R   R   R\   R   R   (   R@   R   R   R   (    (    s?   /usr/lib/python2.7/dist-packages/setuptools/command/egg_info.pyR     s    c         C   s)   t  j j |  } |  j |  t |  S(   s   Include all files from 'dir/'.(   RU   R   t   findallR   R   (   R@   R   R   (    (    s?   /usr/lib/python2.7/dist-packages/setuptools/command/egg_info.pyR     s    c         C   s+   t  t j j | d   } |  j | j  S(   s   Filter out files from 'dir/'.s   **(   R1   R   R   R\   R   R   (   R@   R   R   (    (    s?   /usr/lib/python2.7/dist-packages/setuptools/command/egg_info.pyR     s    c         C   sy   |  j  d k r |  j   n  t t j j d |   } g  |  j  D] } | j |  rA | ^ qA } |  j |  t	 |  S(   s   
        Include all files anywhere in the current directory that match the
        pattern. This is very inefficient on large file trees.
        s   **N(
   t   allfilesR7   R   R1   R   R   R\   R   R   R   (   R@   R   R   Rz   R   (    (    s?   /usr/lib/python2.7/dist-packages/setuptools/command/egg_info.pyR     s    +c         C   s+   t  t j j d |   } |  j | j  S(   sD   
        Exclude all files anywhere that match the pattern.
        s   **(   R1   R   R   R\   R   R   (   R@   R   R   (    (    s?   /usr/lib/python2.7/dist-packages/setuptools/command/egg_info.pyR     s    c         C   sN   | j  d  r | d  } n  t |  } |  j |  rJ |  j j |  n  d  S(   Ns   i(   R}   R   t
   _safe_pathR   t   append(   R@   t   itemR   (    (    s?   /usr/lib/python2.7/dist-packages/setuptools/command/egg_info.pyR     s
    c         C   s    |  j  j t |  j |   d  S(   N(   R   R   t   filterR   (   R@   t   paths(    (    s?   /usr/lib/python2.7/dist-packages/setuptools/command/egg_info.pyR     s    c         C   s"   t  t |  j |  j   |  _ d S(   s   
        Replace self.files with only safe paths

        Because some owners of FileList manipulate the underlying
        ``files`` attribute directly, this method must be called to
        repair those paths.
        N(   RS   R   R   R   (   R@   (    (    s?   /usr/lib/python2.7/dist-packages/setuptools/command/egg_info.pyt   _repair  s    c         C   s   d } t  j |  } | d  k r6 t j d |  t St  j | d  } | d  k rk t j | | d  t Sy, t j j	 |  s t j j	 |  r t
 SWn* t k
 r t j | | t j    n Xd  S(   Ns!   '%s' not %s encodable -- skippings'   '%s' in unexpected encoding -- skippings   utf-8(   t   unicode_utilst   filesys_decodeR7   R   Rl   R=   t
   try_encodeR   R   Rk   R   t   UnicodeEncodeErrort   syst   getfilesystemencoding(   R@   R   t   enc_warnt   u_patht	   utf8_path(    (    s?   /usr/lib/python2.7/dist-packages/setuptools/command/egg_info.pyR     s    $(   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   (    (    (    s?   /usr/lib/python2.7/dist-packages/setuptools/command/egg_info.pyR    9  s   	I				
								
R   c           B   se   e  Z d  Z d   Z d   Z d   Z d   Z d   Z d   Z e	 d    Z
 d   Z d	   Z RS(
   s   MANIFEST.inc         C   s(   d |  _  d |  _ d |  _ d |  _ d  S(   Ni   (   t   use_defaultsR   t   manifest_onlyt   force_manifest(   R@   (    (    s?   /usr/lib/python2.7/dist-packages/setuptools/command/egg_info.pyRA     s    			c         C   s   d  S(   N(    (   R@   (    (    s?   /usr/lib/python2.7/dist-packages/setuptools/command/egg_info.pyRi     s    c         C   s   t    |  _ t j j |  j  s. |  j   n  |  j   t j j |  j  rZ |  j	   n  |  j
   |  j j   |  j j   |  j   d  S(   N(   R    R   R   R   Rk   R   t   write_manifestt   add_defaultst   templatet   read_templatet   prune_file_listt   sortt   remove_duplicates(   R@   (    (    s?   /usr/lib/python2.7/dist-packages/setuptools/command/egg_info.pyR     s    

c         C   s"   t  j |  } | j t j d  S(   Nt   /(   R   R   t   replaceR   R   (   R@   R   (    (    s?   /usr/lib/python2.7/dist-packages/setuptools/command/egg_info.pyt   _manifest_normalize  s    c         C   sb   |  j  j   g  |  j  j D] } |  j |  ^ q } d |  j } |  j t |  j | f |  d S(   so   
        Write the file list in 'self.filelist' to the manifest file
        named by 'self.manifest'.
        s   writing manifest file '%s'N(   R   R   R   R   R   t   executeRj   (   R@   Rz   R   t   msg(    (    s?   /usr/lib/python2.7/dist-packages/setuptools/command/egg_info.pyR     s    (c         C   s&   |  j  |  s" t j |  |  n  d  S(   N(   t   _should_suppress_warningR   Rl   (   R@   R   (    (    s?   /usr/lib/python2.7/dist-packages/setuptools/command/egg_info.pyRl   !  s    c         C   s   t  j d |   S(   s;   
        suppress missing-file warnings from sdist
        s   standard file .*not found(   R    R   (   R   (    (    s?   /usr/lib/python2.7/dist-packages/setuptools/command/egg_info.pyR   %  s    c         C   s   t  j |   |  j j |  j  |  j j |  j  t t    } | r[ |  j j |  n" t	 j
 j |  j  r} |  j   n  |  j d  } |  j j | j  d  S(   NR2   (   R   R   R   R   R   R   RS   R   R   R   R   Rk   t   read_manifestt   get_finalized_commandR   R2   (   R@   t   rcfilest   ei_cmd(    (    s?   /usr/lib/python2.7/dist-packages/setuptools/command/egg_info.pyR   ,  s    c         C   sy   |  j  d  } |  j j   } |  j j | j  |  j j |  t j t j	  } |  j j
 d | d | d d d  S(   Nt   builds   (^|s   )(RCS|CVS|\.svn)t   is_regexi   (   R   RM   t   get_fullnameR   R   t
   build_baseR    R!   R   R   t   exclude_pattern(   R@   R   t   base_dirR   (    (    s?   /usr/lib/python2.7/dist-packages/setuptools/command/egg_info.pyR   8  s    (   R   R   R   RA   Ri   R   R   R   Rl   t   staticmethodR   R   R   (    (    (    s?   /usr/lib/python2.7/dist-packages/setuptools/command/egg_info.pyR     s   							c         C   sG   d j  |  } | j d  } t |  d   } | j |  Wd QXd S(   s{   Create a file with the specified name and write 'contents' (a
    sequence of strings without line terminators) to it.
    s   
s   utf-8Rr   N(   R\   Ru   Rw   Rx   (   RI   t   contentsRz   (    (    s?   /usr/lib/python2.7/dist-packages/setuptools/command/egg_info.pyRj   B  s    c         C   s   t  j d |  |  j s |  j j } |  j | j | _ } |  j | j | _ } z | j	 |  j
  Wd  | | | _ | _ Xt |  j d d   } t j |  j
 |  n  d  S(   Ns
   writing %st   zip_safe(   R   Rs   Rv   RM   R^   R9   RQ   R8   R   t   write_pkg_infoR2   RE   R7   R
   t   write_safety_flag(   t   cmdt   basenameRI   R^   t   oldvert   oldnamet   safe(    (    s?   /usr/lib/python2.7/dist-packages/setuptools/command/egg_info.pyR   O  s    	c         C   s&   t  j j |  r" t j d  n  d  S(   Nss   WARNING: 'depends.txt' is not used by setuptools 0.6!
Use the install_requires/extras_require setup() args instead.(   R   R   Rk   R   Rl   (   R   R   RI   (    (    s?   /usr/lib/python2.7/dist-packages/setuptools/command/egg_info.pyt   warn_depends_obsoletea  s    c         C   sA   t  | p d  } d   } t | t |   } |  j |  d  S(   Nc         S   s   |  d S(   Ns   
(    (   R   (    (    s?   /usr/lib/python2.7/dist-packages/setuptools/command/egg_info.pyt   <lambda>k  s    (    (   R   R   t   sortedt
   writelines(   t   streamt   reqst   linest	   append_cr(    (    s?   /usr/lib/python2.7/dist-packages/setuptools/command/egg_info.pyt   _write_requirementsi  s    	c         C   s   |  j  } t j   } t | | j  | j p1 i  } x> t |  D]0 } | j d j t	      t | | |  qA W|  j
 d | | j    d  S(   Ns   
[{extra}]
t   requirements(   RM   R   t   StringIOR   t   install_requirest   extras_requireR   Rx   t   formatt   varsRq   t   getvalue(   R   R   RI   t   distRo   R   t   extra(    (    s?   /usr/lib/python2.7/dist-packages/setuptools/command/egg_info.pyt   write_requirementsp  s    	c         C   s9   t    } t | |  j j  |  j d | | j    d  S(   Ns   setup-requirements(   R   R   RM   t   setup_requiresRq   R   (   R   R   RI   Ro   (    (    s?   /usr/lib/python2.7/dist-packages/setuptools/command/egg_info.pyt   write_setup_requirements{  s    	c         C   se   t  j g  |  j j   D] } | j d d  d ^ q  } |  j d | d j t |   d  d  S(   Nt   .i   i    s   top-level namess   
(   RG   t   fromkeysRM   t   iter_distribution_namesR   Rj   R\   R   (   R   R   RI   t   kt   pkgs(    (    s?   /usr/lib/python2.7/dist-packages/setuptools/command/egg_info.pyt   write_toplevel_names  s    2c         C   s   t  |  | | t  d  S(   N(   t	   write_argR   (   R   R   RI   (    (    s?   /usr/lib/python2.7/dist-packages/setuptools/command/egg_info.pyt   overwrite_arg  s    c         C   sg   t  j j |  d } t |  j | d   } | d  k	 rM d j |  d } n  |  j | | | |  d  S(   Ni    s   
(   R   R   t   splitextRE   RM   R7   R\   Rq   (   R   R   RI   Rp   t   argnameRC   (    (    s?   /usr/lib/python2.7/dist-packages/setuptools/command/egg_info.pyR    s
    c         C   s   |  j  j } t | t j  s* | d  k r3 | } n | d  k	 r g  } x t | j    D]n \ } } t | t j  s t j	 | |  } d j
 t t t | j      } n  | j d | | f  qX Wd j
 |  } n  |  j d | | t  d  S(   Ns   
s	   [%s]
%s

R   s   entry points(   RM   t   entry_pointsRP   R   t   string_typesR7   R   t   itemsR   t   parse_groupR\   R   t   strt   valuesR   Rq   R   (   R   R   RI   R   Ro   t   sectionR   (    (    s?   /usr/lib/python2.7/dist-packages/setuptools/command/egg_info.pyt   write_entries  s    	'c          C   s}   t  j d t  t j j d  ry t j d  C }  x9 |  D]1 } t j	 d |  } | r; t
 | j d   Sq; WWd QXn  d S(   sd   
    Get a -r### off of PKG-INFO Version in case this is an sdist of
    a subversion revision.
    s$   get_pkg_info_revision is deprecated.s   PKG-INFOs   Version:.*-r(\d+)\s*$i   Ni    (   t   warningsRl   t   DeprecationWarningR   R   Rk   t   ioRw   R    R   t   intt   group(   Rz   R   R   (    (    s?   /usr/lib/python2.7/dist-packages/setuptools/command/egg_info.pyt   get_pkg_info_revision  s     (<   t   __doc__t   distutils.filelistR    t	   _FileListt   distutils.errorsR   t   distutils.utilR   RU   R   R   R    R   R  R  R   RF   t   setuptools.externR   t   setuptools.extern.six.movesR   t
   setuptoolsR   t   setuptools.command.sdistR   R   t   setuptools.command.setoptR	   t   setuptools.commandR
   t   pkg_resourcesR   R   R   R   R   R   R   R   t   setuptools.unicode_utilsR   t   setuptools.globR   t   pkg_resources.externR   R1   R2   R   Rj   R   R   R   R   R   R  R  R=   R  R  R  (    (    (    s?   /usr/lib/python2.7/dist-packages/setuptools/command/egg_info.pyt   <module>   sN   :	RI							
		