ó
ÓnùWc           @   sŠ  d  Z  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 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	 m Z d e f d „  ƒ  YZ d e f d „  ƒ  YZ d e
 f d „  ƒ  YZ d „  Z d „  Z  d „  Z! d „  Z" d „  Z# d „  Z$ e% d „ Z& d „  Z' d „  Z( d S(   sU   setuptools.command.egg_info

Create a distribution's .egg-info directory and contentsiÿÿÿÿN(   t   Command(   t   log(   t   sdist(   t
   basestring(   t	   svn_utils(   t   convert_path(   t   FileList(   t   parse_requirementst	   safe_namet   parse_versiont   safe_versiont   yield_linest
   EntryPointt   iter_entry_pointst   to_filename(   t   walk_revctrlt   egg_infoc           B   s»   e  Z d  Z d d  d! d" d# d$ g Z d d g Z i d d 6d d 6Z d „  Z d „  Z d „  Z e	 d „ Z
 d „  Z d „  Z d „  Z d „  Z d „  Z e 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-svn-revisiont   rs,   Add subversion revision ID to version numbers   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-svn-revisiont   Rs*   Don't add subversion revision ID [default]s   no-datet   Ds"   Don't include date stamp [default]c         C   sU   d  |  _ d  |  _ d  |  _ d  |  _ d  |  _ d |  _ d |  _ t |  _	 d  |  _
 d  S(   Ni    (   t   Nonet   egg_namet   egg_versiont   egg_baseR   t	   tag_buildt   tag_svn_revisiont   tag_datet   Falset   broken_egg_infot   vtags(   t   self(    (    sB   /var/www/html/venv/build/setuptools/setuptools/command/egg_info.pyt   initialize_options)   s    								c      	   C   sK   d d l  m } t d t d d d d d |  j ƒ  ƒ ƒ } | | | ƒ d  S(   Niÿÿÿÿ(   t   edit_configR   R   i    R   R   (   t   setuptools.command.setoptR#   t   dictt   tags(   R!   t   filenameR#   t   values(    (    sB   /var/www/html/venv/build/setuptools/setuptools/command/egg_info.pyt   save_version_info4   s    c         C   s±  t  |  j j ƒ  ƒ |  _ |  j ƒ  |  _ |  j ƒ  |  _ y$ t t	 d |  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 r"t j j |  j |  j ƒ |  _ n  d |  j k r>|  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==%ss2   Invalid distribution name or version syntax: %s-%st    R   s	   .egg-infot   -("   R   t   distributiont   get_nameR   R&   R    t   tagged_versionR   t   listR   t
   ValueErrort	   distutilst   errorst   DistutilsOptionErrorR   R   t   package_dirt   gett   ost   curdirt   ensure_dirnameR   R   t   patht   joint   check_broken_egg_infot   metadatat   versiont   _patched_distt   keyt   lowert   _versionR	   t   _parsed_version(   R!   t   dirst   pd(    (    sB   /var/www/html/venv/build/setuptools/setuptools/command/egg_info.pyt   finalize_options?   s2    !	!! $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_fileR6   R9   t   existsR   R   t   warnt   delete_file(   R!   t   whatR'   t   datat   force(    (    sB   /var/www/html/venv/build/setuptools/setuptools/command/egg_info.pyt   write_or_delete_fileg   s    	c         C   sj   t  j d | | ƒ t j d k r4 | j d ƒ } n  |  j sf 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 %si   s   utf-8t   wbN(   i   (	   R   t   infot   syst   version_infot   encodet   dry_runt   opent   writet   close(   R!   RJ   R'   RK   t   f(    (    sB   /var/www/html/venv/build/setuptools/setuptools/command/egg_info.pyRF   {   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   RO   RS   R6   t   unlink(   R!   R'   (    (    sB   /var/www/html/venv/build/setuptools/setuptools/command/egg_info.pyRI   ‰   s    	c         C   sE   |  j  j ƒ  } |  j r4 | j |  j ƒ r4 t | ƒ St | |  j ƒ S(   N(   R,   t   get_versionR    t   endswithR
   (   R!   R=   (    (    sB   /var/www/html/venv/build/setuptools/setuptools/command/egg_info.pyR.      s    
c         C   sµ   |  j  |  j ƒ |  j j } xN t d ƒ D]@ } | j d | ƒ } | |  | 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   mkpathR   R,   t   fetch_build_eggR   t   loadt   nameR6   R9   R:   RG   RI   t   find_sources(   R!   R[   t   ept   writert   nl(    (    sB   /var/www/html/venv/build/setuptools/setuptools/command/egg_info.pyt   run—   s    ,c         C   s’   d } |  j  r | |  j  7} n  |  j rc t j j d ƒ sL t j j d ƒ rc | d |  j ƒ  7} n  |  j rŽ d d  l } | | j d ƒ 7} n  | S(   NR*   s   .svns   PKG-INFOs   -r%siÿÿÿÿs   -%Y%m%d(	   R   R   R6   R9   RG   t   get_svn_revisionR   t   timet   strftime(   R!   R=   Rf   (    (    sB   /var/www/html/venv/build/setuptools/setuptools/command/egg_info.pyR&   ¥   s    		$	c           C   s   t  t j j t j ƒ j ƒ  ƒ S(   N(   t   strR   t   SvnInfoR^   R6   R7   t   get_revision(    (    (    sB   /var/www/html/venv/build/setuptools/setuptools/command/egg_info.pyRe   ±   s    c         C   sJ   t  j j |  j d ƒ } t |  j ƒ } | | _ | j ƒ  | j |  _ d S(   s"   Generate SOURCES.txt manifest files   SOURCES.txtN(	   R6   R9   R:   R   t   manifest_makerR,   t   manifestRd   t   filelist(   R!   t   manifest_filenamet   mm(    (    sB   /var/www/html/venv/build/setuptools/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-infoR+   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.
(   R   R   R6   R7   R9   R:   RG   R   RH   R   R   (   R!   t   bei(    (    sB   /var/www/html/venv/build/setuptools/setuptools/command/egg_info.pyR;   ½   s    (   s	   egg-base=R   sL   directory containing .egg-info directories (default: top of the source tree)(   s   tag-svn-revisionR   s,   Add subversion revision ID to version number(   s   tag-dateR   s0   Add date stamp (e.g. 20050528) to version number(   s
   tag-build=R   s-   Specify explicit tag to add to version number(   s   no-svn-revisionR   s*   Don't add subversion revision ID [default](   s   no-dateR   s"   Don't include date stamp [default](   t   __name__t
   __module__t   descriptiont   user_optionst   boolean_optionst   negative_optR"   R)   RE   R   RM   RF   RI   R.   Rd   R&   t   staticmethodRe   R`   R;   (    (    (    sB   /var/www/html/venv/build/setuptools/setuptools/command/egg_info.pyR      s0     	

			(						R   c           B   s   e  Z d  Z d „  Z RS(   s@   File list that accepts only existing, platform-independent pathsc         C   s  | j  d ƒ r | d  } n  t | ƒ } t j d k rÙ yD t j j | ƒ sg t j j | j d ƒ ƒ rz |  j j	 | ƒ n  Wqþ t
 k
 rÕ t j j | j d ƒ ƒ r¹ |  j j	 | ƒ qÖ t j d | t j ƒ  ƒ qþ Xn% t j j | ƒ rþ |  j j	 | ƒ n  d  S(   Ns   iÿÿÿÿi   s   utf-8s!   '%s' not %s encodable -- skipping(   i   (   RZ   R   RP   RQ   R6   R9   RG   RR   t   filest   appendt   UnicodeEncodeErrorR   RH   t   getfilesystemencoding(   R!   t   itemR9   (    (    sB   /var/www/html/venv/build/setuptools/setuptools/command/egg_info.pyRy   Ï   s    -(   Rq   Rr   t   __doc__Ry   (    (    (    sB   /var/www/html/venv/build/setuptools/setuptools/command/egg_info.pyR   Ì   s   Rk   c           B   sM   e  Z d  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z	 RS(   s   MANIFEST.inc         C   s(   d |  _  d |  _ d |  _ d |  _ d  S(   Ni   (   t   use_defaultst   prunet   manifest_onlyt   force_manifest(   R!   (    (    sB   /var/www/html/venv/build/setuptools/setuptools/command/egg_info.pyR"   è   s    			c         C   s   d  S(   N(    (   R!   (    (    sB   /var/www/html/venv/build/setuptools/setuptools/command/egg_info.pyRE   î   s    c         C   s™   t  ƒ  |  _ t j j |  j ƒ s. |  j ƒ  n  |  j j ƒ  |  j ƒ  t j j |  j	 ƒ rg |  j
 ƒ  n  |  j ƒ  |  j j ƒ  |  j j ƒ  |  j ƒ  d  S(   N(   R   Rm   R6   R9   RG   Rl   t   write_manifestt   findallt   add_defaultst   templatet   read_templatet   prune_file_listt   sortt   remove_duplicates(   R!   (    (    sB   /var/www/html/venv/build/setuptools/setuptools/command/egg_info.pyRd   ñ   s    

c         C   së   t  j d k r~ g  } xW |  j j D]I } y | j d ƒ Wn" t k
 r] t j d | ƒ q" X| j | ƒ q" W| |  j _ n  |  j j } t	 j
 d k rÄ g  | D] } | j t	 j
 d ƒ ^ q  } n  |  j t |  j | f d |  j ƒ d S(   s²   Write the file list in 'self.filelist' (presumably as filled in
        by 'add_defaults()' and 'read_template()') to the manifest file
        named by 'self.manifest'.
        i   s   utf-8s$   '%s' not UTF-8 encodable -- skippingt   /s   writing manifest file '%s'N(   i   (   RP   RQ   Rm   Rx   RR   Rz   R   RH   Ry   R6   t   sept   replacet   executeRF   Rl   (   R!   Rx   t   fileRW   (    (    sB   /var/www/html/venv/build/setuptools/setuptools/command/egg_info.pyR‚   þ   s    +c         C   s&   | j  d ƒ s" t j |  | ƒ n  d  S(   Ns   standard file not found:(   t
   startswithR   RH   (   R!   t   msg(    (    sB   /var/www/html/venv/build/setuptools/setuptools/command/egg_info.pyRH     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 d d | j ƒd  S(   NR   t   *t   prefix(   R   R„   Rm   Ry   R…   Rl   R/   R   t   extendR6   R9   RG   t   read_manifestt   get_finalized_commandt   include_patternR   (   R!   t   rcfilest   ei_cmd(    (    sB   /var/www/html/venv/build/setuptools/setuptools/command/egg_info.pyR„     s    c         C   s   |  j  d ƒ } |  j j ƒ  } |  j j d  d | j ƒ|  j j d  d | ƒt j t	 j
 ƒ } |  j j | d | d d ƒd  S(   Nt   buildR’   s   (RCS|CVS|\.svn)t   is_regexi   (   R•   R,   t   get_fullnameRm   t   exclude_patternR   t
   build_baset   ret   escapeR6   R‹   (   R!   R™   t   base_dirR‹   (    (    sB   /var/www/html/venv/build/setuptools/setuptools/command/egg_info.pyR‡   %  s    (
   Rq   Rr   R…   R"   RE   Rd   R‚   RH   R„   R‡   (    (    (    sB   /var/www/html/venv/build/setuptools/setuptools/command/egg_info.pyRk   ä   s   						c         C   sZ   d j  | ƒ } t j d k r0 | j d ƒ } n  t |  d ƒ } | j | ƒ | j ƒ  d S(   s{   Create a file with the specified name and write 'contents' (a
    sequence of strings without line terminators) to it.
    s   
i   s   utf-8RN   N(   i   (   R:   RP   RQ   RR   RT   RU   RV   (   R'   t   contentsRW   (    (    sB   /var/www/html/venv/build/setuptools/setuptools/command/egg_info.pyRF   .  s    c         C   s»   t  j d | ƒ |  j s· |  j j } |  j | j | _ } |  j | j | _ } z | j	 |  j
 ƒ Wd  | | | _ | _ Xt |  j d d  ƒ } d d l m } | j |  j
 | ƒ n  d  S(   Ns
   writing %st   zip_safeiÿÿÿÿ(   t	   bdist_egg(   R   RO   RS   R,   R<   R   R=   R   R_   t   write_pkg_infoR   t   getattrR   t   setuptools.commandR£   t   write_safety_flag(   t   cmdt   basenameR'   R<   t   oldvert   oldnamet   safeR£   (    (    sB   /var/www/html/venv/build/setuptools/setuptools/command/egg_info.pyR¤   9  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.(   R6   R9   RG   R   RH   (   R¨   R©   R'   (    (    sB   /var/www/html/venv/build/setuptools/setuptools/command/egg_info.pyt   warn_depends_obsoleteJ  s    c      	   C   s–   |  j  } d j t | j p d ƒ ƒ g } xI | j p9 i  j ƒ  D]2 \ } } | j d | d j t | ƒ ƒ f ƒ q@ W|  j d | d j | ƒ ƒ d  S(   Ns   
s	   

[%s]
%st   requirementsR*   (    (   R,   R:   R   t   install_requirest   extras_requiret   itemsRy   RM   (   R¨   R©   R'   t   distRK   t   extrat   reqs(    (    sB   /var/www/html/venv/build/setuptools/setuptools/command/egg_info.pyt   write_requirementsR  s
    	!"*c         C   s_   t  j g  |  j j ƒ  D] } | j d d ƒ d ^ q ƒ } |  j d | d j | ƒ d ƒ d  S(   Nt   .i   i    s   top-level namess   
(   R%   t   fromkeysR,   t   iter_distribution_namest   splitRF   R:   (   R¨   R©   R'   t   kt   pkgs(    (    sB   /var/www/html/venv/build/setuptools/setuptools/command/egg_info.pyt   write_toplevel_namesY  s    2c         C   s   t  |  | | t ƒ d  S(   N(   t	   write_argt   True(   R¨   R©   R'   (    (    sB   /var/www/html/venv/build/setuptools/setuptools/command/egg_info.pyt   overwrite_argc  s    c         C   sg   t  j j | ƒ d } t |  j | d  ƒ } | d  k	 rM d j | ƒ d } n  |  j | | | | ƒ d  S(   Ni    s   
(   R6   R9   t   splitextR¥   R,   R   R:   RM   (   R¨   R©   R'   RL   t   argnamet   value(    (    sB   /var/www/html/venv/build/setuptools/setuptools/command/egg_info.pyR½   f  s
    c         C   sä   |  j  j } t | t ƒ s' | d  k r0 | } nš | d  k	 rÊ g  } xs | j ƒ  D]e \ } } t | t ƒ s t j | | ƒ } d j t	 t
 | j ƒ  ƒ ƒ } n  | j d | | f ƒ qO Wd j | ƒ } n  |  j d | | t ƒ d  S(   Ns   
s	   [%s]
%s

R*   s   entry points(   R,   t   entry_pointst
   isinstanceR   R   R±   R   t   parse_groupR:   t   mapRh   R(   Ry   RM   R¾   (   R¨   R©   R'   Ra   RK   t   sectionR¡   (    (    sB   /var/www/html/venv/build/setuptools/setuptools/command/egg_info.pyt   write_entriesm  s    	!c          C   sn   t  j j d ƒ rj t d d ƒ }  x9 |  D]1 } t j d | ƒ } | r( t | j d ƒ ƒ Sq( W|  j ƒ  n  d S(   Ns   PKG-INFOt   rUs   Version:.*-r(\d+)\s*$i   i    (	   R6   R9   RG   RT   Rž   t   matcht   intt   groupRV   (   RW   t   lineRÊ   (    (    sB   /var/www/html/venv/build/setuptools/setuptools/command/egg_info.pyt   get_pkg_info_revision}  s    ()   R}   R6   Rž   RP   t
   setuptoolsR    t   distutils.errorsR1   R   t   setuptools.command.sdistR   t   setuptools.compatR   R   t   distutils.utilR   t   distutils.filelistR   t	   _FileListt   pkg_resourcesR   R   R	   R
   R   R   R   R   R   R   Rk   RF   R¤   R­   Rµ   R¼   R¿   R   R½   RÈ   RÎ   (    (    (    sB   /var/www/html/venv/build/setuptools/setuptools/command/egg_info.pyt   <module>   s2   :¶J					
		