
Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­
<!DOCTYPE html>
<html>
ó
•�abc           @  s‡  d  d l  m 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	 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 d l m Z m Z d d l m Z m Z m Z m Z m Z d d l m Z d d l m  Z  m! Z! d d	 l" m# Z# m$ Z$ m% Z% m& Z& m' Z' m( Z( m) Z) m* Z* m+ Z+ d d
 l, m- Z- m. Z. e j/ e0 ƒ Z1 e2 a3 e4 e d ƒ r»d Z5 n9 e j6 j7 d ƒ rÖd Z5 n e j6 d k rîd Z5 n d Z5 e j8 d ƒ Z9 e9 rd e j: d  Z9 n  d e9 Z; e5 e9 Z< e j" j= ƒ  j> d d ƒ j> d d ƒ Z? e j8 d ƒ Z@ e@ oze@ j7 d ƒ r’e@ j> d d ƒ Z@ n d „  ZA eA ƒ  Z@ [A e jB d e jC e jD Bƒ ZE e jB d e jC e jD Bƒ ZF e jB d ƒ ZG e jB d ƒ ZH d  ZI d! ZJ e jK d" k r$d# „  ZL n	 d$ „  ZL d% eM f d& „  ƒ  YZN eN ƒ  ZO d' eM f d( „  ƒ  YZP d) „  ZQ eQ ƒ  ZR [Q e2 d* „ ZS d S(+   iÿÿÿÿ(   t   unicode_literalsN(   t   message_from_filei   (   t   __version__t   DistlibException(   t	   sysconfigt   ZipFilet   fsdecodet	   text_typet   filter(   t   InstalledDistribution(   t   Metadatat   METADATA_FILENAME(	   t   FileOperatort   convert_patht	   CSVReadert	   CSVWritert   Cachet   cached_propertyt   get_cache_baset   read_exportst   tempdir(   t   NormalizedVersiont   UnsupportedVersionErroru   pypy_version_infou   ppu   javau   jyu   cliu   ipu   cpu   py_version_nodotu   %s%si   u   pyu   -u   _u   .u   SOABIu   cpython-c          C  s|   d t  g }  t j d ƒ r+ |  j d ƒ n  t j d ƒ rJ |  j d ƒ n  t j d ƒ d k ro |  j d ƒ n  d	 j |  ƒ S(
   Nu   cpu   Py_DEBUGu   du   WITH_PYMALLOCu   mu   Py_UNICODE_SIZEi   u   uu    (   t
   VER_SUFFIXR   t   get_config_vart   appendt   join(   t   parts(    (    s=   /usr/lib/python2.7/site-packages/pip/_vendor/distlib/wheel.pyt   _derive_abi;   s    uz   
(?P<nm>[^-]+)
-(?P<vn>\d+[^-]*)
(-(?P<bn>\d+[^-]*))?
-(?P<py>\w+\d+(\.\w+\d+)*)
-(?P<bi>\w+)
-(?P<ar>\w+(\.\w+)*)
\.whl$
u7   
(?P<nm>[^-]+)
-(?P<vn>\d+[^-]*)
(-(?P<bn>\d+[^-]*))?$
s   \s*#![^\r\n]*s   ^(\s*#!("[^"]+"|\S+))\s+(.*)$s   #!pythons	   #!pythonwu   /c         C  s   |  S(   N(    (   t   o(    (    s=   /usr/lib/python2.7/site-packages/pip/_vendor/distlib/wheel.pyt   <lambda>]   t    c         C  s   |  j  t j d ƒ S(   Nu   /(   t   replacet   ost   sep(   R   (    (    s=   /usr/lib/python2.7/site-packages/pip/_vendor/distlib/wheel.pyR   _   R   t   Mounterc           B  s8   e  Z d  „  Z d „  Z d „  Z d d „ Z d „  Z RS(   c         C  s   i  |  _  i  |  _ d  S(   N(   t   impure_wheelst   libs(   t   self(    (    s=   /usr/lib/python2.7/site-packages/pip/_vendor/distlib/wheel.pyt   __init__c   s    	c         C  s!   | |  j  | <|  j j | ƒ d  S(   N(   R$   R%   t   update(   R&   t   pathnamet
   extensions(    (    s=   /usr/lib/python2.7/site-packages/pip/_vendor/distlib/wheel.pyt   addg   s    c         C  sI   |  j  j | ƒ } x0 | D]( \ } } | |  j k r |  j | =q q Wd  S(   N(   R$   t   popR%   (   R&   R)   R*   t   kt   v(    (    s=   /usr/lib/python2.7/site-packages/pip/_vendor/distlib/wheel.pyt   removek   s    c         C  s"   | |  j  k r |  } n d  } | S(   N(   R%   t   None(   R&   t   fullnamet   patht   result(    (    s=   /usr/lib/python2.7/site-packages/pip/_vendor/distlib/wheel.pyt   find_moduleq   s    	c         C  s›   | t  j k r t  j | } nx | |  j k rA t d | ƒ ‚ n  t j | |  j | ƒ } |  | _ | j d d ƒ } t | ƒ d k r— | d | _	 n  | S(   Nu   unable to find extension for %su   .i   i    (
   t   syst   modulesR%   t   ImportErrort   impt   load_dynamict
   __loader__t   rsplitt   lent   __package__(   R&   R1   R3   R   (    (    s=   /usr/lib/python2.7/site-packages/pip/_vendor/distlib/wheel.pyt   load_modulex   s    	N(   t   __name__t
   __module__R'   R+   R/   R0   R4   R>   (    (    (    s=   /usr/lib/python2.7/site-packages/pip/_vendor/distlib/wheel.pyR#   b   s
   			t   Wheelc           B  s  e  Z d  Z d Z d Z d e e d „ Z e d „  ƒ Z	 e d „  ƒ Z
 e d „  ƒ Z e d „  ƒ Z d „  Z e d	 „  ƒ Z d
 „  Z d d „ Z d „  Z d „  Z d „  Z d d d „ Z d „  Z d „  Z d „  Z d „  Z d „  Z e d „ Z d „  Z d „  Z d d „ Z RS(   u@   
    Class to build and install from Wheel files (PEP 427).
    i   u   sha256c         C  sÄ  | |  _  | |  _ d |  _ t g |  _ d g |  _ d g |  _ t j ƒ  |  _	 | d k r{ d |  _ d |  _ |  j |  _ nEt j | ƒ } | rá | j d ƒ } | d |  _ | d j d d	 ƒ |  _ | d
 |  _ |  j |  _ nß t j j | ƒ \ } } t j | ƒ } | s!t d | ƒ ‚ n  | r?t j j | ƒ |  _	 n  | |  _ | j d ƒ } | d |  _ | d |  _ | d
 |  _ | d j d ƒ |  _ | d j d ƒ |  _ | d j d ƒ |  _ d S(   uB   
        Initialise an instance using a (valid) filename.
        u    u   noneu   anyu   dummyu   0.1u   nmu   vnu   _u   -u   bnu   Invalid name or filename: %ru   pyu   .u   biu   arN(   t   signt   should_verifyt   buildvert   PYVERt   pyvert   abit   archR!   t   getcwdt   dirnameR0   t   namet   versiont   filenamet	   _filenamet   NAME_VERSION_REt   matcht	   groupdictR    R2   t   splitt   FILENAME_RER   t   abspath(   R&   RM   RB   t   verifyt   mt   infoRJ   (    (    s=   /usr/lib/python2.7/site-packages/pip/_vendor/distlib/wheel.pyR'   �   sB    						c         C  s‡   |  j  r d |  j  } n d } d j |  j ƒ } d j |  j ƒ } d j |  j ƒ } |  j j d d ƒ } d |  j | | | | | f S(   uJ   
        Build and return a filename from the various components.
        u   -u    u   .u   _u   %s-%s%s-%s-%s-%s.whl(   RD   R   RF   RG   RH   RL   R    RK   (   R&   RD   RF   RG   RH   RL   (    (    s=   /usr/lib/python2.7/site-packages/pip/_vendor/distlib/wheel.pyRM   ¹   s    	c         C  s+   t  j j |  j |  j ƒ } t  j j | ƒ S(   N(   R!   R2   R   RJ   RM   t   isfile(   R&   R2   (    (    s=   /usr/lib/python2.7/site-packages/pip/_vendor/distlib/wheel.pyt   existsÊ   s    c         c  sN   xG |  j  D]< } x3 |  j D]( } x |  j D] } | | | f Vq* Wq Wq
 Wd  S(   N(   RF   RG   RH   (   R&   RF   RG   RH   (    (    s=   /usr/lib/python2.7/site-packages/pip/_vendor/distlib/wheel.pyt   tagsÏ   s    c         C  s8  t  j j |  j |  j ƒ } d |  j |  j f } d | } t j d ƒ } t	 | d ƒ �Ù } |  j
 | ƒ } | d j d d ƒ } t g  | D] } t | ƒ ^ q‹ ƒ }	 |	 d k  r» d }
 n t }
 yI t j | |
 ƒ } | j | ƒ �" } | | ƒ } t d	 | ƒ } Wd  QXWn! t k
 r-t d
 |
 ƒ ‚ n XWd  QX| S(   Nu   %s-%su   %s.dist-infou   utf-8u   ru   Wheel-Versionu   .i   u   METADATAt   fileobju$   Invalid wheel, because %s is missing(   i   i   (   R!   R2   R   RJ   RM   RK   RL   t   codecst	   getreaderR   t   get_wheel_metadataRR   t   tuplet   intR   t	   posixpatht   openR
   t   KeyErrort
   ValueError(   R&   R)   t   name_vert   info_dirt   wrappert   zft   wheel_metadatat   wvt   it   file_versiont   fnt   metadata_filenamet   bft   wfR3   (    (    s=   /usr/lib/python2.7/site-packages/pip/_vendor/distlib/wheel.pyt   metadataÖ   s(    
%	c         C  su   d |  j  |  j f } d | } t j | d ƒ } | j | ƒ �( } t j d ƒ | ƒ } t | ƒ } Wd  QXt | ƒ S(   Nu   %s-%su   %s.dist-infou   WHEELu   utf-8(	   RK   RL   Ra   R   Rb   R\   R]   R   t   dict(   R&   Rh   Re   Rf   Rn   Ro   Rp   t   message(    (    s=   /usr/lib/python2.7/site-packages/pip/_vendor/distlib/wheel.pyR^   î   s    
c         C  sF   t  j j |  j |  j ƒ } t | d ƒ � } |  j | ƒ } Wd  QX| S(   Nu   r(   R!   R2   R   RJ   RM   R   R^   (   R&   R)   Rh   R3   (    (    s=   /usr/lib/python2.7/site-packages/pip/_vendor/distlib/wheel.pyRW   ÷   s    c         C  s  t  j | ƒ } | r  | j ƒ  } | |  | | } } d | j ƒ  k rQ t } n t } t j | ƒ } | rƒ d | j ƒ  d } n d } | | } | | } ns | j d ƒ } | j d ƒ }	 | d k  sÖ | |	 k rß d }
 n& | | | d !d	 k rÿ d	 }
 n d }
 t |
 | } | S(
   Nt   pythonwt    iÿÿÿÿR   s   s   
i    i   s   
(	   t
   SHEBANG_RERP   t   endt   lowert   SHEBANG_PYTHONWt   SHEBANG_PYTHONt   SHEBANG_DETAIL_REt   groupst   find(   R&   t   dataRV   Rw   t   shebangt   data_after_shebangt   shebang_pythont   argst   crt   lft   term(    (    s=   /usr/lib/python2.7/site-packages/pip/_vendor/distlib/wheel.pyt   process_shebangþ   s,    	
		c         C  sŒ   | d  k r |  j } n  y t t | ƒ } Wn! t k
 rN t d | ƒ ‚ n X| | ƒ j ƒ  } t j | ƒ j	 d ƒ j
 d ƒ } | | f S(   Nu   Unsupported hash algorithm: %rt   =u   ascii(   R0   t	   hash_kindt   getattrt   hashlibt   AttributeErrorR   t   digestt   base64t   urlsafe_b64encodet   rstript   decode(   R&   R~   Rˆ   t   hasherR3   (    (    s=   /usr/lib/python2.7/site-packages/pip/_vendor/distlib/wheel.pyt   get_hash  s    !c         C  s~   t  | ƒ } t t j j | | ƒ ƒ } | j | d d f ƒ | j ƒ  t | ƒ �% } x | D] } | j | ƒ q] WWd  QXd  S(   Nu    (	   t   listt   to_posixR!   R2   t   relpathR   t   sortR   t   writerow(   R&   t   recordst   record_patht   baset   pt   writert   row(    (    s=   /usr/lib/python2.7/site-packages/pip/_vendor/distlib/wheel.pyt   write_record'  s    
c         C  sô   g  } | \ } } t  t |  j ƒ } xs | D]k \ } }	 t |	 d ƒ � }
 |
 j ƒ  } Wd  QXd |  j | ƒ } t j j |	 ƒ } | j	 | | | f ƒ q+ Wt j j
 | d ƒ }	 |  j | |	 | ƒ t t j j
 | d ƒ ƒ } | j	 | |	 f ƒ d  S(   Nu   rbu   %s=%su   RECORD(   R‰   RŠ   Rˆ   Rb   t   readR’   R!   R2   t   getsizeR   R   Rž   R”   (   R&   RW   t   libdirt   archive_pathsR˜   t   distinfoRf   R‘   t   apR›   t   fR~   RŒ   t   size(    (    s=   /usr/lib/python2.7/site-packages/pip/_vendor/distlib/wheel.pyt   write_records0  s    c      	   C  s\   t  | d t j ƒ �A } x7 | D]/ \ } } t j d | | ƒ | j | | ƒ q WWd  QXd  S(   Nu   wu   Wrote %s to %s in wheel(   R   t   zipfilet   ZIP_DEFLATEDt   loggert   debugt   write(   R&   R)   R¢   Rh   R¤   R›   (    (    s=   /usr/lib/python2.7/site-packages/pip/_vendor/distlib/wheel.pyt	   build_zip@  s    c   !   
     sò  | d k r i  } n  t t ‡  f d †  d$ ƒ ƒ d } | d k rg d } t g } t g } t g } n! d } t g } d g } d g } | j d	 | ƒ |  _ | j d
 | ƒ |  _	 | j d | ƒ |  _
 ˆ  | }	 d |  j |  j f }
 d |
 } d |
 } g  } xKd% D]C} | ˆ  k r qn  ˆ  | } t j j | ƒ rxt j | ƒ D]ø \ } } } xæ | D]Þ } t t j j | | ƒ ƒ } t j j | | ƒ } t t j j | | | ƒ ƒ } | j | | f ƒ | d k rb| j d ƒ rbt | d ƒ � } | j ƒ  } Wd QX|  j | ƒ } t | d ƒ � } | j | ƒ Wd QXqbqbWqLWqqW|	 } d } xt j | ƒ D]÷ \ } } } | | k róxU t | ƒ D]G \ } } t | ƒ } | j d ƒ r“t j j | | ƒ } | | =Pq“q“W| sót d ƒ ‚ n  xl | D]d } t | ƒ j d& ƒ rqún  t j j | | ƒ } t t j j | | ƒ ƒ } | j | | f ƒ qúWqkWt j | ƒ } xf | D]^ } | d' k r|t t j j | | ƒ ƒ } t t j j | | ƒ ƒ } | j | | f ƒ q|q|Wd | pí|  j d t d  | g } x4 |  j  D]) \ } } } | j d! | | | f ƒ qWt j j | d ƒ } t | d" ƒ � } | j d# j | ƒ ƒ Wd QXt t j j | d ƒ ƒ } | j | | f ƒ |  j! | | f |	 | ƒ t j j |  j" |  j# ƒ }  |  j$ |  | ƒ |  S((   u‰   
        Build a wheel from files in specified paths, and use any specified tags
        when determining the name of the wheel.
        c           s
   |  ˆ  k S(   N(    (   R   (   t   paths(    s=   /usr/lib/python2.7/site-packages/pip/_vendor/distlib/wheel.pyR   N  R   u   purelibu   platlibi    u   falseu   trueu   noneu   anyu   pyveru   abiu   archu   %s-%su   %s.datau   %s.dist-infou   datau   headersu   scriptsu   .exeu   rbNu   wbu
   .dist-infou(   .dist-info directory expected, not foundu   .pycu   .pyou   RECORDu	   INSTALLERu   SHAREDu   WHEELu   Wheel-Version: %d.%du   Generator: distlib %su   Root-Is-Purelib: %su   Tag: %s-%s-%su   wu   
(   u   purelibu   platlib(   u   datau   headersu   scripts(   u   .pycu   .pyo(   u   RECORDu	   INSTALLERu   SHAREDu   WHEEL(%   R0   R“   R   t   IMPVERt   ABIt   ARCHRE   t   getRF   RG   RH   RK   RL   R!   R2   t   isdirt   walkR   R   R•   R”   R   t   endswithRb   RŸ   R†   R¬   t	   enumeratet   AssertionErrort   listdirt   wheel_versionR   RZ   R§   RJ   RM   R­   (!   R&   R®   RZ   R¹   t   libkeyt   is_puret   default_pyvert   default_abit   default_archR¡   Re   t   data_dirRf   R¢   t   keyR2   t   roott   dirst   filesRm   R›   t   rpR¤   R¥   R~   R£   Rk   t   dnRi   RF   RG   RH   R)   (    (   R®   s=   /usr/lib/python2.7/site-packages/pip/_vendor/distlib/wheel.pyt   buildF  s”    	"					



%c   C      K  sŸ	  | j  } | j d ƒ } | j d t ƒ } t j j |  j |  j ƒ } d |  j |  j	 f } d | }	 d | }
 t
 j |
 t ƒ } t
 j |
 d ƒ } t
 j |
 d ƒ } t j d ƒ } t | d	 ƒ �Ö} | j | ƒ � } | | ƒ } t | ƒ } Wd
 QX| d j d d ƒ } t g  | D] } t | ƒ ^ qƒ } | |  j k rY| rY| |  j | ƒ n  | d d k rv| d } n
 | d } i  } | j | ƒ �D } t d | ƒ �, } x" | D] } | d } | | | <q±WWd
 QXWd
 QXt
 j |	 d ƒ } t
 j |
 d ƒ } t
 j |	 d d ƒ } t d | ƒ } t | _ t j }  g  }! t j ƒ  }" |" | _ d
 | _ z*yøx—| j  ƒ  D]‰}# |# j }$ t! |$ t" ƒ r”|$ }% n |$ j# d ƒ }% |% j$ d ƒ r¸qmn  | |% } | d røt% |# j& ƒ | d k røt' d |% ƒ ‚ n  | d r|| d j d d ƒ \ }& }' | j |$ ƒ � } | j( ƒ  }( Wd
 QX|  j) |( |& ƒ \ }) }* |* |' k r|t' d |$ ƒ ‚ q|n  | r­|% j* | | f ƒ r­t+ j, d |% ƒ qmn  |% j* | ƒ oÉ|% j$ d ƒ }+ |% j* | ƒ r|% j d d ƒ \ }) }, }- t j j | |, t- |- ƒ ƒ }. n3 |% | | f k r0qmn  t j j | t- |% ƒ ƒ }. |+ sW| j |$ ƒ � } | j. | |. ƒ Wd
 QX|! j/ |. ƒ | rõ| d rõt |. d ƒ �J } | j( ƒ  }( |  j) |( |& ƒ \ }) }/ |/ |* k rìt' d  |. ƒ ‚ n  Wd
 QXn  |  rö|. j$ d! ƒ röy  | j0 |. ƒ }0 |! j/ |0 ƒ WqTt1 k
 rPt+ j2 d" d# t ƒqTXqöqmt j j3 t- |$ ƒ ƒ }1 t j j |" |1 ƒ }2 | j |$ ƒ � } | j. | |2 ƒ Wd
 QXt j j |. ƒ \ }3 }1 |3 | _ | j4 |1 ƒ }4 | j5 |4 ƒ |! j6 |4 ƒ qmW| rt+ j, d$ ƒ d
 }5 n:d
 }6 |  j7 d } | d% k r0t
 j |
 d& ƒ }7 yÅ | j |7 ƒ � } t8 | ƒ }8 Wd
 QXi  }6 x” d8 D]Œ }9 d) |9 }: |: |8 k r{i  |6 d* |9 <}; x[ |8 |: j9 ƒ  D]F }< d+ |< j: |< j; f }= |< j< ró|= d, |< j< 7}= n  |= |; |< j <qºWq{q{WWq©t1 k
 r,t+ j2 d- ƒ q©Xny yX | j | ƒ �C } | | ƒ } t= j> | ƒ j d. ƒ }6 |6 r�|6 j d/ ƒ }6 n  Wd
 QXWn t1 k
 r¨t+ j2 d0 ƒ n X|6 rÌ|6 j d1 i  ƒ }> |6 j d2 i  ƒ }? |> sß|? rÌ| j d d ƒ }@ t j j? |@ ƒ st@ d3 ƒ ‚ n  |@ | _ xF |> jA ƒ  D]8 \ }: }< d4 |: |< f }A | j4 |A ƒ }4 | j5 |4 ƒ q(W|? rÉi t d( 6}B xL |? jA ƒ  D]; \ }: }< d4 |: |< f }A | j4 |A |B ƒ }4 | j5 |4 ƒ q„WqÉqÌn  t j j | |
 ƒ } tB | ƒ }5 tC | ƒ } | d =| d =| | d5 <|5 jD | | ƒ } | r9	|! j/ | ƒ n  |5 jE |! | d6 | ƒ |5 SWn+ t1 k
 r‚	t+ jF d7 ƒ | jG ƒ  ‚  n XWd
 tH jI |" ƒ XWd
 QXd
 S(9   uÁ  
        Install a wheel to the specified paths. If kwarg ``warner`` is
        specified, it should be a callable, which will be called with two
        tuples indicating the wheel version of this software and the wheel
        version in the file, if there is a discrepancy in the versions.
        This can be used to issue any warnings to raise any exceptions.
        If kwarg ``lib_only`` is True, only the purelib/platlib files are
        installed, and the headers, scripts, data and dist-info metadata are
        not written.

        The return value is a :class:`InstalledDistribution` instance unless
        ``options.lib_only`` is True, in which case the return value is ``None``.
        u   warneru   lib_onlyu   %s-%su   %s.datau   %s.dist-infou   WHEELu   RECORDu   utf-8u   rNu   Wheel-Versionu   .i   u   Root-Is-Purelibu   trueu   purelibu   platlibt   streami    u    u   scriptst   dry_runu   /RECORD.jwsi   u   size mismatch for %su   =u   digest mismatch for %su   lib_only: skipping %su   .exeu   /u   rbu   digest mismatch on write for %su   .pyu   Byte-compilation failedt   exc_infou   lib_only: returning Noneu   1.0u   entry_points.txtu   consoleu   guiu
   %s_scriptsu   wrap_%su   %s:%su    %suA   Unable to read legacy script metadata, so cannot generate scriptsu
   extensionsu   python.commandsu8   Unable to read JSON metadata, so cannot generate scriptsu   wrap_consoleu   wrap_guiu   Valid script path not specifiedu   %s = %su   libu   prefixu   installation failed.(   u   consoleu   gui(J   RÈ   R²   t   FalseR!   R2   R   RJ   RM   RK   RL   Ra   R   R\   R]   R   Rb   R   RR   R_   R`   R¹   R   R   t   Truet   recordR5   t   dont_write_bytecodet   tempfilet   mkdtempt
   source_dirR0   t
   target_dirt   infolistt
   isinstanceR   R�   Rµ   t   strt	   file_sizeR   RŸ   R’   t
   startswithRª   R«   R   t   copy_streamR   t   byte_compilet	   Exceptiont   warningt   basenamet   maket   set_executable_modet   extendRW   R   t   valuest   prefixt   suffixt   flagst   jsont   loadR³   Rd   t   itemsR	   Rr   t   write_shared_locationst   write_installed_filest	   exceptiont   rollbackt   shutilt   rmtree(C   R&   R®   t   makert   kwargsRÈ   t   warnert   lib_onlyR)   Re   R¿   Rf   t   metadata_namet   wheel_metadata_namet   record_nameRg   Rh   t   bwfRp   Rs   Rj   Rk   Rl   R¡   R˜   Ro   t   readerR�   R›   t   data_pfxt   info_pfxt
   script_pfxt   fileopt   bct   outfilest   workdirt   zinfot   arcnamet	   u_arcnamet   kindt   valueR~   t   _RŒ   t	   is_scriptt   whereRÄ   t   outfilet	   newdigestt   pycRm   t   worknameRÅ   t	   filenamest   distt   commandst   ept   epdataRÀ   R-   t   dR.   t   st   console_scriptst   gui_scriptst
   script_dirt   scriptt   options(    (    s=   /usr/lib/python2.7/site-packages/pip/_vendor/distlib/wheel.pyt   install®  sD   	

%

	
		 		
#
"		
		

c         C  sG   t  d  k rC t j j t ƒ  t d ƒ t j d  ƒ } t	 | ƒ a  n  t  S(   Nu   dylib-cachei   (
   t   cacheR0   R!   R2   R   R   RÔ   R5   RL   R   (   R&   Rš   (    (    s=   /usr/lib/python2.7/site-packages/pip/_vendor/distlib/wheel.pyt   _get_dylib_cache’  s
    c         C  sî  t  j j |  j |  j ƒ } d |  j |  j f } d | } t j | d ƒ } t j	 d ƒ } g  } t
 | d ƒ �w} y\| j | ƒ �G} | | ƒ }	 t j |	 ƒ }
 |  j ƒ  } | j | ƒ } t  j j | j | ƒ } t  j j | ƒ sù t  j | ƒ n  xÍ |
 j ƒ  D]¿ \ } } t  j j | t | ƒ ƒ } t  j j | ƒ sHt } nQ t  j | ƒ j } t j j | ƒ } | j | ƒ } t j | j Œ  } | | k } | r²| j | | ƒ n  | j | | f ƒ qWWd  QXWn t k
 rãn XWd  QX| S(   Nu   %s-%su   %s.dist-infou
   EXTENSIONSu   utf-8u   r(    R!   R2   R   RJ   RM   RK   RL   Ra   R\   R]   R   Rb   Rã   Rä   R  t   prefix_to_dirRš   R³   t   makedirsRå   R   RY   RË   t   statt   st_mtimet   datetimet   fromtimestampt   getinfot	   date_timet   extractR   Rc   (   R&   R)   Re   Rf   Rý   Rg   R3   Rh   Ro   Rp   R*   R  Rà   t
   cache_baseRK   R•   t   destR  t	   file_timeRW   t
   wheel_time(    (    s=   /usr/lib/python2.7/site-packages/pip/_vendor/distlib/wheel.pyt   _get_extensions›  s>    
	!
c         C  s
   t  |  ƒ S(   uM   
        Determine if a wheel is compatible with the running system.
        (   t   is_compatible(   R&   (    (    s=   /usr/lib/python2.7/site-packages/pip/_vendor/distlib/wheel.pyR%  ½  s    c         C  s   t  S(   uP   
        Determine if a wheel is asserted as mountable by its metadata.
        (   RË   (   R&   (    (    s=   /usr/lib/python2.7/site-packages/pip/_vendor/distlib/wheel.pyt   is_mountableÃ  s    c         C  s
  t  j j t  j j |  j |  j ƒ ƒ } |  j ƒ  sL d | } t | ƒ ‚ n  |  j ƒ  sq d | } t | ƒ ‚ n  | t	 j k r“ t
 j d | ƒ ns | r¬ t	 j j | ƒ n t	 j j d | ƒ |  j ƒ  } | rt t	 j k ró t	 j j t ƒ n  t j | | ƒ n  d  S(   Nu)   Wheel %s not compatible with this Python.u$   Wheel %s is marked as not mountable.u   %s already in pathi    (   R!   R2   RT   R   RJ   RM   R%  R   R&  R5   Rª   R«   R   t   insertR$  t   _hookt	   meta_pathR+   (   R&   R   R)   t   msgR*   (    (    s=   /usr/lib/python2.7/site-packages/pip/_vendor/distlib/wheel.pyt   mountÉ  s"    '

c         C  sª   t  j j t  j j |  j |  j ƒ ƒ } | t j k rI t j d | ƒ n] t j j	 | ƒ | t
 j k rx t
 j	 | ƒ n  t
 j s¦ t
 t j k r¦ t j j	 t
 ƒ q¦ n  d  S(   Nu   %s not in path(   R!   R2   RT   R   RJ   RM   R5   Rª   R«   R/   R(  R$   R)  (   R&   R)   (    (    s=   /usr/lib/python2.7/site-packages/pip/_vendor/distlib/wheel.pyt   unmountÞ  s    '	c         C  s«  t  j j |  j |  j ƒ } d |  j |  j f } d | } d | } t j | t ƒ } t j | d ƒ } t j | d ƒ } t	 j
 d ƒ } t | d ƒ �}	 |	 j | ƒ � }
 | |
 ƒ } t | ƒ } Wd  QX| d j d	 d
 ƒ } t g  | D] } t | ƒ ^ qì ƒ } i  } |	 j | ƒ �D } t d | ƒ �, } x" | D] } | d } | | | <q8WWd  QXWd  QXx<|	 j ƒ  D].} | j } t | t ƒ r–| } n | j d ƒ } d | k rÄt d | ƒ ‚ n  | j d ƒ rÙqon  | | } | d rt | j ƒ | d k rt d | ƒ ‚ n  | d
 ro| d
 j d d
 ƒ \ } } |	 j | ƒ � } | j ƒ  } Wd  QX|  j | | ƒ \ } } | | k r�t d | ƒ ‚ q�qoqoWWd  QXd  S(   Nu   %s-%su   %s.datau   %s.dist-infou   WHEELu   RECORDu   utf-8u   ru   Wheel-Versionu   .i   RÇ   i    u   ..u   invalid entry in wheel: %ru   /RECORD.jwsi   u   size mismatch for %su   =u   digest mismatch for %s(   R!   R2   R   RJ   RM   RK   RL   Ra   R   R\   R]   R   Rb   R   RR   R_   R`   R   RÒ   RÓ   R   R�   R   Rµ   RÔ   RÕ   RŸ   R’   (   R&   R)   Re   R¿   Rf   Rð   Rñ   Rò   Rg   Rh   Ró   Rp   Rs   Rj   Rk   Rl   R˜   Ro   Rô   R�   R›   Rü   Rý   Rþ   Rÿ   R   R~   R  RŒ   (    (    s=   /usr/lib/python2.7/site-packages/pip/_vendor/distlib/wheel.pyRU   ê  sT    

%
		
#
c         K  s–  d „  } d „  } t  j j |  j |  j ƒ } d |  j |  j f } d | } t j | d ƒ }	 t ƒ  �(}
 t	 | d ƒ �º } i  } xª | j
 ƒ  D]œ } | j } t | t ƒ r· | } n | j d ƒ } | |	 k rØ q� n  d | k r÷ t d	 | ƒ ‚ n  | j | |
 ƒ t  j j |
 t | ƒ ƒ } | | | <q� WWd
 QX| | | ƒ \ } } | | | � } | rŒ| | | ƒ \ } } | r—| | k r—| | | ƒ n  | d
 k r×t j d d d d d |
 ƒ \ } } t  j | ƒ n= t  j j | ƒ süt d | ƒ ‚ n  t  j j | |  j ƒ } t | j ƒ  ƒ } t  j j |
 | ƒ } | | f } |  j | |
 | ƒ |  j | | ƒ | d
 k rŒt j | | ƒ qŒn  Wd
 QX| S(   u‘  
        Update the contents of a wheel in a generic way. The modifier should
        be a callable which expects a dictionary argument: its keys are
        archive-entry paths, and its values are absolute filesystem paths
        where the contents the corresponding archive entries can be found. The
        modifier is free to change the contents of the files pointed to, add
        new entries and remove entries, before returning. This method will
        extract the entire contents of the wheel to a temporary location, call
        the modifier, and then use the passed (and possibly updated)
        dictionary to write a new wheel. If ``dest_dir`` is specified, the new
        wheel is written there -- otherwise, the original wheel is overwritten.

        The modifier should return True if it updated the wheel, else False.
        This method returns the same value the modifier returns.
        c         S  sh   d  } } d | t f } | |  k r3 d | } n  | |  k r^ |  | } t d | ƒ j } n  | | f S(   Nu   %s/%su   %s/PKG-INFOR2   (   R0   R   R
   RL   (   t   path_mapRf   RL   R2   RÀ   (    (    s=   /usr/lib/python2.7/site-packages/pip/_vendor/distlib/wheel.pyt   get_version1  s    

c   	      S  s'  d  } yŸ t |  ƒ } |  j d ƒ } | d k  r= d |  } ng g  |  | d j d ƒ D] } t | ƒ ^ qU } | d c d 7<d |  |  d j d „  | Dƒ ƒ f } Wn! t k
 rÈ t j d	 |  ƒ n X| r#t	 d
 | ƒ } | | _
 | j t ƒ } | j d
 | d | ƒ t j d |  | ƒ n  d  S(   Nu   -i    u   %s+1i   u   .iÿÿÿÿu   %s+%sc         s  s   |  ] } t  | ƒ Vq d  S(   N(   RÔ   (   t   .0Rk   (    (    s=   /usr/lib/python2.7/site-packages/pip/_vendor/distlib/wheel.pys	   <genexpr>F  s    u0   Cannot update non-compliant (PEP-440) version %rR2   t   legacyu   Version updated from %r to %r(   R0   R   R}   RR   R`   R   R   Rª   R«   R
   RL   Rµ   R   R¬   (	   RL   R2   t   updatedR.   Rk   R  R   t   mdR0  (    (    s=   /usr/lib/python2.7/site-packages/pip/_vendor/distlib/wheel.pyt   update_version;  s(    0
!		u   %s-%su   %s.dist-infou   RECORDu   ru   utf-8u   ..u   invalid entry in wheel: %rNRá   u   .whlRà   u   wheel-update-t   diru   Not a directory: %r(   R!   R2   R   RJ   RM   RK   RL   Ra   R   R   RÒ   RÓ   R   R�   R   R  R   R0   RÎ   t   mkstempt   closeR³   R“   Rå   R§   R­   Rê   t   copyfile(   R&   t   modifiert   dest_dirRí   R.  R3  R)   Re   Rf   Rò   Rû   Rh   R-  Rü   Rý   Rþ   R2   t   original_versionR  t   modifiedt   current_versiont   fdt   newpathR¢   R£   RW   (    (    s=   /usr/lib/python2.7/site-packages/pip/_vendor/distlib/wheel.pyR(      sX    	
	
		(   i   i   N(   R?   R@   t   __doc__R¹   Rˆ   R0   RÊ   R'   t   propertyRM   RY   RZ   R   Rq   R^   RW   R†   R’   Rž   R§   R­   RÆ   R  R  R$  R%  R&  R+  R,  RU   R(   (    (    (    s=   /usr/lib/python2.7/site-packages/pip/_vendor/distlib/wheel.pyRA   ˆ   s2   )							h	ä			"				6c          C  s†  t  g }  t  d } xG t t j d d d d ƒ D]( } |  j d j | t | ƒ g ƒ ƒ q1 Wg  } xL t j ƒ  D]> \ } } } | j	 d ƒ rp | j | j
 d d ƒ d ƒ qp qp W| j ƒ  t d k rÛ | j d t ƒ n  | j d ƒ g  } t g } t j d	 k r=t j d
 t ƒ } | r=| j ƒ  \ }	 } } }
 t | ƒ } |
 g } |
 d k rg| j d ƒ n  |
 d k rƒ| j d ƒ n  |
 d k rŸ| j d ƒ n  |
 d k r»| j d ƒ n  |
 d k r×| j d ƒ n  x` | d k r6x@ | D]8 } d |	 | | | f } | t k rí| j | ƒ qíqíW| d 8} qÚWq=n  xH | D]@ } x7 | D]/ }
 | j d j t |  d f ƒ | |
 f ƒ qQWqDWxw t |  ƒ D]i \ } } | j d j t | f ƒ d d f ƒ | d k r•| j d j t | d f ƒ d d f ƒ q•q•Wxw t |  ƒ D]i \ } } | j d j d | f ƒ d d f ƒ | d k r| j d j d | d f ƒ d d f ƒ qqWt | ƒ S(   uG   
    Return (pyver, abi, arch) tuples compatible with this Python.
    i    i   iÿÿÿÿu    u   .abiu   .i   u   noneu   darwinu   (\w+)_(\d+)_(\d+)_(\w+)$u   i386u   ppcu   fatu   x86_64u   fat3u   ppc64u   fat64u   intelu	   universalu   %s_%s_%s_%su   anyu   py(   u   i386u   ppc(   u   i386u   ppcu   x86_64(   u   ppc64u   x86_64(   u   i386u   x86_64(   u   i386u   x86_64u   intelu   ppcu   ppc64(   R   t   rangeR5   t   version_infoR   R   RÔ   R8   t   get_suffixesRÖ   RR   R–   R°   R'  R±   t   platformt   reRP   R|   R`   t
   IMP_PREFIXR¶   t   set(   t   versionst   majort   minort   abisRá   R  R3   t   archesRV   RK   RH   t   matchesRP   R  RG   Rk   RL   (    (    s=   /usr/lib/python2.7/site-packages/pip/_vendor/distlib/wheel.pyt   compatible_tags…  s`    	
$&$
		1%0%0c         C  sŽ   t  |  t ƒ s t |  ƒ }  n  t } | d  k r9 t } n  xN | D]F \ } } } | |  j k r@ | |  j k r@ | |  j k r@ t } Pq@ q@ W| S(   N(	   RÓ   RA   RÊ   R0   t   COMPATIBLE_TAGSRF   RG   RH   RË   (   t   wheelRZ   R3   t   verRG   RH   (    (    s=   /usr/lib/python2.7/site-packages/pip/_vendor/distlib/wheel.pyR%  È  s    	-(T   t
   __future__R    R�   R\   R  t   distutils.utilt	   distutilst   emailR   RŠ   R8   Rã   t   loggingR!   Ra   RE  Rê   R5   RÎ   R¨   R   R   R   t   compatR   R   R   R   R   t   databaseR	   Rq   R
   R   t   utilR   R   R   R   R   R   R   R   R   RL   R   R   t	   getLoggerR?   Rª   R0   R  t   hasattrRF  RD  RÖ   R   R   RB  RE   R¯   t   get_platformR    R±   R°   R   t   compilet
   IGNORECASEt   VERBOSERS   RO   Rv   R{   Rz   Ry   R"   R”   t   objectR#   R(  RA   RN  RO  R%  (    (    (    s=   /usr/lib/python2.7/site-packages/pip/_vendor/distlib/wheel.pyt   <module>   s€   (@			

'				#	ÿ ÿ ÿ  	>	