£Á°èZ¨Ä…–K§‚«“ô4“ÒÙ´dîfUÙÃÅ WKbyÊ¦•êŽ…È®FÒ¿ÊÎóCozá¬S@6{Í:›œêZÌ:Š•_%:¢¾¾~;‘Ã~èŠ©ÊÇí`ÔÑ©úë™µ'5I¿fš×WO%ø9¾«¾DK|€ùÍD”Ýs]nHÕ¶ê×Ó¼ãžªéUWŸÈË%DÒÕ¬ï‘]/Åcx  ‰ï2ß]ä6G[]S£ÔÏ¯rs{úëóµmÒï#UQxo·õÞCe]"±/aÙ&Eã4ú9Jé_ÞåëdãöKë)AÞ                  ¯¹ægƒÛowÐø^d™ý½ßB7áyMä9ÜÖUã
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
<html>

V~gc           @   s   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
 Z
 d  d l Z d   Z d   Z d   Z d   Z d   Z d   Z d   Z d S(	   iNc       	   C   s   t  j d d  }  |  j d d d |  j d d d d d	 d
 d t j j |  j   } d } y t t |    GHWn' t	 k
 r } d j
 |  GHd } n Xt j d  d  S(   Nt   descriptions,   Recreate wheel of package with given RECORD.t   record_patht   helps   Path to RECORD files   -os   --output-dirs>   Dir where to place the wheel, defaults to current working dir.t   destt   outdirt   defaulti    s
   Failed: {}i   (   t   argparset   ArgumentParsert   add_argumentt   ost   patht   curdirt
   parse_argst   rewheel_from_recordt   varst   BaseExceptiont   formatt   syst   exit(   t   parsert   nst   retcodet   e(    (    s?   /opt/alt/python27/lib64/python2.7/ensurepip/rewheel/__init__.pyt   run   s    
c           C   s3   y t  j SWn! t k
 r. t t  d t  j  SXd S(   sk   Get prefix to site-specific directory prefix where the platform
    independent Python files are installed.t   real_prefixN(   R   t   base_prefixt   AttributeErrort   getattrt   prefix(    (    (    s?   /opt/alt/python27/lib64/python2.7/ensurepip/rewheel/__init__.pyt   _get_base_prefix   s    c           C   s'   y t  j SWn t k
 r" t  j SXd S(   sF    Get exec_prefix dir used to find the machine-specific Python library.N(   R   t   base_exec_prefixR   t   exec_prefix(    (    (    s?   /opt/alt/python27/lib64/python2.7/ensurepip/rewheel/__init__.pyt   _get_base_exec_prefix)   s    c         C   sr  g  } t  j d d k  r( t j   } n t j t   t   g  } g  | D] } t j j |  rJ | ^ qJ } x |  D] } d } x | D] } t j j
 | |  d j t j  } g  t j |  D] } t j j
 | |  ^ q } g  | D] }	 t j | |	  r |	 ^ q }
 t |
  d k r |
 d } q q W| d k	 r]| j t j j
 | d   qu | j d  qu W| S(   s   Return list of paths to RECORD files for system-installed projects.

    If a project is not installed, the resulting list contains None instead
    of a path to its RECORD
    i    i   s   -[^\{0}]+\.dist-infoi   t   RECORDN(   R   t   version_infot   sitet   getsitepackagesR   R    R	   R
   t   existst   Nonet   joinR   t   sept   listdirt   ret   matcht   lent   append(   t   projectst   recordst   sys_sitepackt   spt   projectR
   t   dist_info_ret   pt
   candidatest   ct   filtered(    (    s?   /opt/alt/python27/lib64/python2.7/ensurepip/rewheel/__init__.pyt   find_system_records0   s"    +%1+c         C   s?  t  j j t  j j |    } |  t |  j t  j j  } t | |  \ } } t |   } t  j j | | d  } t	 j
 | d d d t	 j } t j   }	 t j |	  }
 xO | D]G \ } } } | j t  j j | |  d | |
 j | | | g  q W|
 j | d d g  | j | |	 j    | j   | j S(   sc   Recreates a whee of package with given record_path and returns path
    to the newly created wheel.s   .whlt   modet   wt   compressiont   arcnamet    (   R	   R
   t   dirnameR,   t   stripR(   t   get_records_to_packt   get_wheel_nameR'   t   zipfilet   ZipFilet   ZIP_DEFLATEDt   iot   BytesIOt   csvt   writert   writet   writerowt   writestrt   getvaluet   closet   filename(   R   R   t   site_dirt   record_relpatht   to_writet   to_omitt   new_wheel_namet   new_wheel_patht	   new_wheelt
   new_recordRH   t   ft   sha_hasht   size(    (    s?   /opt/alt/python27/lib64/python2.7/ensurepip/rewheel/__init__.pyR   N   s    "
c      
   C   s  t  j j t  j j |   d  } t j | d d % } t j j   j	 | j
    } Wd QXt  j j t  j j |   d  } t j | d d % } t j j   j	 | j
    } Wd QX| j d  } | j d  } d }	 g  }
 x1 | j d	  D]  } |
 j | j d
  d  q Wd j |
  }
 | j d	  j d
  d d !\ } } t d | | |	 |
 | | g  } d
 j t |   S(   s.   Return proper name of the wheel, without .whl.t   WHEELt   encodings   utf-8Nt   METADATAt   Namet   VersionR=   t   Tagt   -i    t   .i   i   (   R	   R
   R'   R>   t   codecst   opent   emailR   t   Parsert   parsestrt   readt   gett   get_allR-   t   splitt   filterR&   t   list(   R   t   wheel_info_patht   wheel_info_filet
   wheel_infot   metadata_patht   metadata_filet   metadatat   distributiont   versiont	   build_tagt   lang_tagt   tt   abi_tagt   plat_tagt   to_join(    (    s?   /opt/alt/python27/lib64/python2.7/ensurepip/rewheel/__init__.pyRA   j   s     !$!$%!c   
      C   sU  t  j j |  |  } t j | d d  } | j   } Wd QXt  j j |  j t  j j  } | t	 d   d } g  } g  } x | j
   D] } | j d  }	 t	 |	  d k r t  j j |	 d  s'|	 d j d	  s'|	 d j d
  s'|	 d j d  s'|	 d | k s'|	 d j |  r7| j |	  qG| j |	  q q W| | f S(   s  Accepts path of sitedir and path of RECORD file relative to it.
    Returns two lists:
    - list of files that can be written to new RECORD straight away
    - list of files that shouldn't be written or need some processing
      (pyc and pyo files, scripts)
    R[   s   utf-8Ns	   dist-infot   datat   ,i   i    s   ..s   .pycs   .pyo(   R	   R
   R'   Rb   Rc   Rg   R>   R?   R(   R,   t
   splitlinesRj   t   isabst
   startswitht   endswithR-   (
   RO   RP   t   record_file_patht   record_filet   record_contentst   data_dirRQ   RR   t   lt   spl(    (    s?   /opt/alt/python27/lib64/python2.7/ensurepip/rewheel/__init__.pyR@      s"    !)&#(   R   Rb   RG   t   email.parserRd   R	   RE   R*   R#   t
   subprocessR   RB   R   R   R    R8   R   RA   R@   (    (    (    s?   /opt/alt/python27/lib64/python2.7/ensurepip/rewheel/__init__.pyt   <module>   s"   		
				