£Á°è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>

7Re$b  c               @   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  d l m Z m Z m Z d  d l m Z m Z m Z m Z m Z m Z d  d l m Z m Z m Z d  d l m Z d  d l m Z d  d l m Z d d	 d
 d d d d d d d d d d d d d d d d d d d d d d  g Z  d! d   Z! d] d" d  Z# d# d$   Z$ d% d	   Z% d& d' d
  Z& d d d( d  Z( d d) d*  Z) d+ d,   Z* d- d   Z+ Gd. d/   d/ e,  Z- e-   Z. [- e j/ d0 e j0  Z1 d1 d   Z2 d2 d   Z3 d3 d   Z4 d4 d   Z5 d5 d   Z6 d6 d   Z7 d7 d   Z8 d8 d   Z9 d9 d   Z: d: d   Z; d; d   Z< d< d=   Z= d> d?   Z> d@ dA   Z? dB dC   Z@ dD dE   ZA d^ d_ d^ d] dJ dK  ZC dL dM   ZD dN dO   ZE dP d   ZF dQ dR   ZG d^ dS d  ZH dT d   ZI dU d   ZJ dV d   ZK dW d   ZL d^ d d d^ e jM d d dX d   ZN dY dZ   ZO Gd[ d\   d\ e,  ZP d S(`   i    N(   u   InstallationErroru
   BadCommandu   PipError(   u   WindowsErroru   string_typesu	   raw_inputu   console_to_stru	   user_siteu   PermissionError(   u   site_packagesu   running_under_virtualenvu   virtualenv_no_global(   u   logger(   u   pkg_resources(   u   versionu   rmtreeu   display_pathu
   backup_diru   find_commandu   asku   Infu   normalize_nameu   splitextu   format_sizeu   is_installable_diru   is_svn_pageu   file_contentsu   split_leading_diru   has_leading_diru   make_path_relativeu   normalize_pathu   renamesu   get_terminal_sizeu   get_progu
   unzip_fileu
   untar_fileu   create_download_cache_folderu   cache_downloadu   unpack_fileu   call_subprocessc               C   sP   y. t  j j t j d  d k r- d t j SWn t t t f k
 rK Yn Xd S(   Ni    u   __main__.pyu   -cu	   %s -m pipu   pip(   u   __main__.pyu   -c(	   u   osu   pathu   basenameu   sysu   argvu
   executableu   AttributeErroru	   TypeErroru
   IndexError(    (    (    u!   /tmp/pip-zej_zi-build/pip/util.pyu   get_prog!   s    c             C   s   t  j |  d | d t d  S(   Nu   ignore_errorsu   onerror(   u   shutilu   rmtreeu   rmtree_errorhandler(   u   diru   ignore_errors(    (    u!   /tmp/pip-zej_zi-build/pip/util.pyu   rmtree*   s    c             C   s   | d d  \ } } | t  k r5 | j d d k pp | t k rT | j d d k pp | t k op | j d d k sy   n  t j |  j t j @t j k r   n  t j | t j	  |  |  d S(   u   On Windows, the files in .svn are read-only, so when rmtree() tries to
    remove them, an exception is thrown.  We catch that here, remove the
    read-only attribute, and hopefully continue without problems.Ni   i    i   i   i   (
   u   WindowsErroru   argsu   OSErroru   PermissionErroru   osu   statu   st_modeu   S_IREADu   chmodu   S_IWRITE(   u   funcu   pathu   exc_infou   exctypeu   value(    (    u!   /tmp/pip-zej_zi-build/pip/util.pyu   rmtree_errorhandler/   s    "u   rmtree_errorhandlerc             C   sd   t  j j t  j j |    }  |  j t  j   t  j j  r` d |  t t  j    d  }  n  |  S(   uT   Gives the display value for a given path, making it relative to cwd
    if possible.u   .N(   u   osu   pathu   normcaseu   abspathu
   startswithu   getcwdu   sepu   len(   u   path(    (    u!   /tmp/pip-zej_zi-build/pip/util.pyu   display_pathB   s    #u   .bakc             C   sK   d } | } x4 t  j j |  |  rB | d 7} | t |  } q W|  | S(   u\   Figure out the name of a directory to back up the given dir to
    (adding .bak, .bak2, etc)i   (   u   osu   pathu   existsu   str(   u   diru   extu   nu	   extension(    (    u!   /tmp/pip-zej_zi-build/pip/util.pyu
   backup_dirK   s    
c             C   s7  | d k r0 t j j d d  j t j  } n  t | t  rK | g } n  | d k rc t   } n  d d   | j	   j t j  D } t j
 j |   d j	   | k r d g } n  xj | D]b } t j
 j | |   } x. | D]& } | | } t j
 j |  r | Sq Wt j
 j |  r | Sq Wt d |    d S(   u<   Searches the PATH for the given command and returns its pathu   PATHu    c             S   s"   g  |  ] } t  |  r |  q S(    (   u   len(   u   .0u   ext(    (    u!   /tmp/pip-zej_zi-build/pip/util.pyu
   <listcomp>_   s   	 u    find_command.<locals>.<listcomp>i   u   Cannot find command %rN(   u   Noneu   osu   environu   getu   splitu   pathsepu
   isinstanceu   string_typesu   get_pathextu   loweru   pathu   splitextu   joinu   isfileu
   BadCommand(   u   cmdu   pathsu   pathextu   pathu   cmd_pathu   extu   cmd_path_ext(    (    u!   /tmp/pip-zej_zi-build/pip/util.pyu   find_commandV   s$    $%"
c             C   sF   |  d k r- t j j d d d d g  }  n  t j j d |   } | S(   u9   Returns the path extensions from environment or a defaultu   .COMu   .EXEu   .BATu   .CMDu   PATHEXTN(   u   Noneu   osu   pathsepu   joinu   environu   get(   u   default_pathextu   pathext(    (    u!   /tmp/pip-zej_zi-build/pip/util.pyu   get_pathextq   s    !u   get_pathextc             C   sC   x3 t  j j d d  j   D] } | | k r | Sq Wt |  |  S(   Nu   PIP_EXISTS_ACTIONu    (   u   osu   environu   getu   splitu   ask(   u   messageu   optionsu   action(    (    u!   /tmp/pip-zej_zi-build/pip/util.pyu   ask_path_existsy   s    "u   ask_path_existsc             C   s}   xv t  j j d  r( t d |    n  t |   } | j   j   } | | k rr t d | d j |  f  q | Sq d S(   u@   Ask the message interactively, with the given possible responsesu   PIP_NO_INPUTu7   No input was expected ($PIP_NO_INPUT set); question: %su<   Your response (%r) was not one of the expected responses: %su   , N(	   u   osu   environu   getu	   Exceptionu	   raw_inputu   stripu   loweru   printu   join(   u   messageu   optionsu   response(    (    u!   /tmp/pip-zej_zi-build/pip/util.pyu   ask   s    c             B   sn   |  Ee  Z d  Z d Z d d   Z d d   Z d d   Z d d	   Z d
 d   Z d d   Z	 d d   Z
 d S(   u   _Infu   I am bigger than everything!c             C   s   |  | k r d Sd Sd  S(   NTF(   u   Trueu   False(   u   selfu   other(    (    u!   /tmp/pip-zej_zi-build/pip/util.pyu   __eq__   s    u   _Inf.__eq__c             C   s   |  j  |  S(   N(   u   __eq__(   u   selfu   other(    (    u!   /tmp/pip-zej_zi-build/pip/util.pyu   __ne__   s    u   _Inf.__ne__c             C   s   d S(   NF(   u   False(   u   selfu   other(    (    u!   /tmp/pip-zej_zi-build/pip/util.pyu   __lt__   s    u   _Inf.__lt__c             C   s   d S(   NF(   u   False(   u   selfu   other(    (    u!   /tmp/pip-zej_zi-build/pip/util.pyu   __le__   s    u   _Inf.__le__c             C   s   d S(   NT(   u   True(   u   selfu   other(    (    u!   /tmp/pip-zej_zi-build/pip/util.pyu   __gt__   s    u   _Inf.__gt__c             C   s   d S(   NT(   u   True(   u   selfu   other(    (    u!   /tmp/pip-zej_zi-build/pip/util.pyu   __ge__   s    u   _Inf.__ge__c             C   s   d S(   Nu   Inf(    (   u   self(    (    u!   /tmp/pip-zej_zi-build/pip/util.pyu   __repr__   s    u   _Inf.__repr__N(   u   __name__u
   __module__u   __qualname__u   __doc__u   __eq__u   __ne__u   __lt__u   __le__u   __gt__u   __ge__u   __repr__(   u
   __locals__(    (    u!   /tmp/pip-zej_zi-build/pip/util.pyu   _Inf   s   u   _Infu   [^a-z]c             C   s   t  j d |  j    S(   Nu   -(   u   _normalize_reu   subu   lower(   u   name(    (    u!   /tmp/pip-zej_zi-build/pip/util.pyu   normalize_name   s    c             C   sX   |  d k r d |  d d S|  d	 k r4 d |  d S|  d k rL d |  d Sd |  Sd  S(
   Ni  u   %.1fMBg     @@i
   u   %ikBu   %.1fkBu   %ibytesi@B i'  (    (   u   bytes(    (    u!   /tmp/pip-zej_zi-build/pip/util.pyu   format_size   s    c             C   sE   t  j j |   s d St  j j |  d  } t  j j |  rA d Sd S(   u@   Return True if `path` is a directory containing a setup.py file.u   setup.pyFT(   u   osu   pathu   isdiru   Falseu   joinu   isfileu   True(   u   pathu   setup_py(    (    u!   /tmp/pip-zej_zi-build/pip/util.pyu   is_installable_dir   s    c             C   s(   t  j d |   o' t  j d |  t  j  S(   uJ   Returns true if the page appears to be the index page of an svn repositoryu   <title>[^<]*Revision \d+:u#   Powered by (?:<a[^>]*?>)?Subversion(   u   reu   searchu   I(   u   html(    (    u!   /tmp/pip-zej_zi-build/pip/util.pyu   is_svn_page   s    c          
   C   s8   t  |  d  } z | j   j d  SWd  | j   Xd  S(   Nu   rbu   utf-8(   u   openu   readu   decodeu   close(   u   filenameu   fp(    (    u!   /tmp/pip-zej_zi-build/pip/util.pyu   file_contents   s    c             C   s   t  |   }  |  j d  j d  }  d |  k rv d |  k rZ |  j d  |  j d  k  sf d |  k rv |  j d d  Sd |  k r |  j d d  S|  d f Sd  S(   Nu   /u   \i   u    (   u   stru   lstripu   findu   split(   u   path(    (    u!   /tmp/pip-zej_zi-build/pip/util.pyu   split_leading_dir   s    6c             C   s\   d } xO |  D]G } t |  \ } } | s/ d S| d k rD | } q | | k r d Sq Wd S(   uy   Returns true if all the paths have the same leading path name
    (i.e., everything is in one subdirectory in an archive)NFT(   u   Noneu   split_leading_diru   Falseu   True(   u   pathsu   common_prefixu   pathu   prefixu   rest(    (    u!   /tmp/pip-zej_zi-build/pip/util.pyu   has_leading_dir   s    	c             C   s7  t  j j |   } t  j j |   }  t  j j t  j j |    }  t  j j t  j j |   } |  j t  j j  j t  j j  } | j t  j j  j t  j j  } x> | r | r | d | d k r | j	 d  | j	 d  q Wd g t
 |  | | g } | d g k r$d t  j j St  j j j |  S(   u  
    Make a filename relative, where the filename path, and it is
    relative to rel_to

        >>> make_relative_path('/usr/share/something/a-file.pth',
        ...                    '/usr/share/another-place/src/Directory')
        '../../../something/a-file.pth'
        >>> make_relative_path('/usr/share/something/a-file.pth',
        ...                    '/home/user/src/Directory')
        '../../../usr/share/something/a-file.pth'
        >>> make_relative_path('/usr/share/a-file.pth', '/usr/share/')
        'a-file.pth'
    i    u   ..u    u   .(   u   osu   pathu   basenameu   dirnameu   normpathu   abspathu   stripu   sepu   splitu   popu   lenu   join(   u   pathu   rel_tou   path_filenameu
   path_partsu   rel_to_partsu
   full_parts(    (    u!   /tmp/pip-zej_zi-build/pip/util.pyu   make_path_relative   s    $$#c             C   s(   t  j j t  j j t  j j |     S(   uN   
    Convert a path to its canonical, case-normalized, absolute version.

    (   u   osu   pathu   normcaseu   realpathu
   expanduser(   u   path(    (    u!   /tmp/pip-zej_zi-build/pip/util.pyu   normalize_path  s    c             C   s[   t  j |   \ } } | j   j d  rQ | d d  | } | d d  } n  | | f S(   u,   Like os.path.splitext, but take off .tar toou   .tari   Nii(   u	   posixpathu   splitextu   loweru   endswith(   u   pathu   baseu   ext(    (    u!   /tmp/pip-zej_zi-build/pip/util.pyu   splitext  s
    c             C   s   t  j j |  \ } } | rG | rG t  j j |  rG t  j |  n  t j |  |  t  j j |   \ } } | r | r y t  j |  Wq t k
 r Yq Xn  d S(   u7   Like os.renames(), but handles renaming across devices.N(	   u   osu   pathu   splitu   existsu   makedirsu   shutilu   moveu
   removedirsu   OSError(   u   oldu   newu   headu   tail(    (    u!   /tmp/pip-zej_zi-build/pip/util.pyu   renames!  s    c             C   s)   t    s d St |   j t t j   S(   u   
    Return True if path is within sys.prefix, if we're running in a virtualenv.

    If we're not in a virtualenv, all paths are considered "local."

    T(   u   running_under_virtualenvu   Trueu   normalize_pathu
   startswithu   sysu   prefix(   u   path(    (    u!   /tmp/pip-zej_zi-build/pip/util.pyu   is_local2  s    	u   is_localc             C   s   t  t |    S(   u   
    Return True if given Distribution object is installed locally
    (i.e. within current virtualenv).

    Always True if we're not in a virtualenv.

    (   u   is_localu   dist_location(   u   dist(    (    u!   /tmp/pip-zej_zi-build/pip/util.pyu   dist_is_local>  s    u   dist_is_localc             C   s-   t  r% t t |    j t t    Sd Sd S(   uF   
    Return True if given Distribution is installed in user site.
    NF(   u	   user_siteu   normalize_pathu   dist_locationu
   startswithu   False(   u   dist(    (    u!   /tmp/pip-zej_zi-build/pip/util.pyu   dist_in_usersiteI  s    u   dist_in_usersitec             C   s   t  t |    j t  t   S(   ua   
    Return True if given Distribution is installed in distutils.sysconfig.get_python_lib().
    (   u   normalize_pathu   dist_locationu
   startswithu   site_packages(   u   dist(    (    u!   /tmp/pip-zej_zi-build/pip/util.pyu   dist_in_site_packagesR  s    u   dist_in_site_packagesc             C   s)   d d l  m } | j |  g   } | j S(   u$   Is distribution an editable install?i    (   u   FrozenRequirement(   u   pipu   FrozenRequirementu	   from_distu   editable(   u   distu   FrozenRequirementu   req(    (    u!   /tmp/pip-zej_zi-build/pip/util.pyu   dist_is_editableY  s    u   dist_is_editableu
   setuptoolsu   pipu   pythonu
   distributec                s   |  r t   n d d    | r0 d d     n d d     | rQ d d    n d d         f d d   t j D S(	   u  
    Return a list of installed Distribution objects.

    If ``local_only`` is True (default), only return installations
    local to the current virtualenv, if in a virtualenv.

    ``skip`` argument is an iterable of lower-case project names to
    ignore; defaults to ('setuptools', 'pip', 'python'). [FIXME also
    skip virtualenv?]

    If ``editables`` is False, don't report editables.

    If ``editables_only`` is True , only report editables.

    c             S   s   d S(   NT(   u   True(   u   d(    (    u!   /tmp/pip-zej_zi-build/pip/util.pyu   <lambda>v  s    u-   get_installed_distributions.<locals>.<lambda>c             S   s   d S(   NT(   u   True(   u   d(    (    u!   /tmp/pip-zej_zi-build/pip/util.pyu   <lambda>y  s    c             S   s   t  |   S(   N(   u   dist_is_editable(   u   d(    (    u!   /tmp/pip-zej_zi-build/pip/util.pyu   <lambda>{  s    c             S   s
   t  |   S(   N(   u   dist_is_editable(   u   d(    (    u!   /tmp/pip-zej_zi-build/pip/util.pyu   <lambda>~  s    c             S   s   d S(   NT(   u   True(   u   d(    (    u!   /tmp/pip-zej_zi-build/pip/util.pyu   <lambda>  s    c                sI   g  |  ]? }  |  r | j   k r   |  r  |  r |  q S(    (   u   key(   u   .0u   d(   u   editable_testu   editables_only_testu
   local_testu   skip(    u!   /tmp/pip-zej_zi-build/pip/util.pyu
   <listcomp>  s
   	 u/   get_installed_distributions.<locals>.<listcomp>(   u   dist_is_localu   pkg_resourcesu   working_set(   u
   local_onlyu   skipu   include_editablesu   editables_only(    (   u   editable_testu   editables_only_testu
   local_testu   skipu!   /tmp/pip-zej_zi-build/pip/util.pyu   get_installed_distributions`  s    	u   get_installed_distributionsc             C   s   g  } t    rN t   r( | j t  qq | j t  t rq | j t  qq n# t rd | j t  n  | j t  x@ | D]8 } t j j | |  j  d } t j j	 |  rx | Sqx Wd S(   u  
    Return the path for the .egg-link file if it exists, otherwise, None.

    There's 3 scenarios:
    1) not in a virtualenv
       try to find in site.USER_SITE, then site_packages
    2) in a no-global virtualenv
       try to find in site_packages
    3) in a yes-global virtualenv
       try to find in site_packages, then site.USER_SITE  (don't look in global location)

    For #1 and #3, there could be odd cases, where there's an egg-link in 2 locations.
    This method will just return the first one found.
    u	   .egg-linkN(
   u   running_under_virtualenvu   virtualenv_no_globalu   appendu   site_packagesu	   user_siteu   osu   pathu   joinu   project_nameu   isfile(   u   distu   sitesu   siteu   egglink(    (    u!   /tmp/pip-zej_zi-build/pip/util.pyu   egg_link_path  s    		u   egg_link_pathc             C   s   t  |   } | r | S|  j S(   u   
    Get the site-packages location of this distribution. Generally
    this is dist.location, except in the case of develop-installed
    packages, where dist.location is the source code location, and we
    want to know where the egg-link file is.

    (   u   egg_link_pathu   location(   u   distu   egg_link(    (    u!   /tmp/pip-zej_zi-build/pip/util.pyu   dist_location  s    u   dist_locationc              C   s   d d   }  |  d  p- |  d  p- |  d  } | s| y8 t  j t  j   t  j  } |  |  } t  j |  Wq| Yq| Xn  | s t  j j d d  t  j j d d	  f } n  t | d  t | d  f S(
   ul   Returns a tuple (x, y) representing the width(x) and the height(x)
    in characters of the terminal window.c             S   s   yL d d  l  } d d  l } d d  l } | j d | j |  | j d   } Wn d  SYn X| d k rk d  S| d k r{ d  S| S(   Ni    u   hhu   1234(   i    i    (   i    i    (   u   fcntlu   termiosu   structu   unpacku   ioctlu
   TIOCGWINSZu   None(   u   fdu   fcntlu   termiosu   structu   cr(    (    u!   /tmp/pip-zej_zi-build/pip/util.pyu   ioctl_GWINSZ  s    	u'   get_terminal_size.<locals>.ioctl_GWINSZi    i   i   u   LINESi   u   COLUMNSiP   (   u   osu   openu   ctermidu   O_RDONLYu   closeu   environu   getu   int(   u   ioctl_GWINSZu   cru   fd(    (    u!   /tmp/pip-zej_zi-build/pip/util.pyu   get_terminal_size  s    $-c              C   s    t  j d  }  t  j |   |  S(   uB   Get the current umask which involves having to set it temporarily.i    (   u   osu   umask(   u   mask(    (    u!   /tmp/pip-zej_zi-build/pip/util.pyu   current_umask  s    u   current_umaskc             C   s  t  j j |  s" t  j |  n  t |  d  } z}t j |  } t | j    oX | } xO| j	   D]A} | j
 } | j |  } | }	 | r t |  d }	 n  t  j j | |	  }	 t  j j |	  }
 t  j j |
  s t  j |
  n  |	 j d  s|	 j d  r1t  j j |	  st  j |	  qqh t |	 d  } z | j |  Wd | j   | j d ?} | rt j |  r| d @rt  j |	 d	 t   d B n  Xqh WWd | j   Xd S(
   u  
    Unzip the file (with path `filename`) to the destination `location`.  All
    files are written based on system defaults and umask (i.e. permissions are
    not preserved), except that regular file members with any execute
    permissions (user, group, or world) have "chmod +x" applied after being
    written. Note that for windows, any execute changes using os.chmod are
    no-ops per the python docs.
    u   rbi   u   /u   \u   wbNi   iI   i  (   u   osu   pathu   existsu   makedirsu   openu   zipfileu   ZipFileu   has_leading_diru   namelistu   infolistu   filenameu   readu   split_leading_diru   joinu   dirnameu   endswithu   writeu   closeu   external_attru   statu   S_ISREGu   chmodu   current_umask(   u   filenameu   locationu   flattenu   zipfpu   zipu   leadingu   infou   nameu   datau   fnu   diru   fpu   mode(    (    u!   /tmp/pip-zej_zi-build/pip/util.pyu
   unzip_file  s6    		
'c             C   s  t  j j |  s" t  j |  n  |  j   j d  sL |  j   j d  rU d } nh |  j   j d  s |  j   j d  r d } n5 |  j   j d  r d } n t j d	 |   d
 } t j	 |  |  } zt
 d d   | j   D  } x| j   D]} | j } | d k rq n  | r8t |  d } n  t  j j | |  } | j   r~t  j j |  st  j |  qq | j   ry | j | |  Wqt j   d } t j d |  | j | f  w YqXq y | j |  }	 WnH t t f k
 r9t j   d } t j d |  | j | f  w Yn Xt  j j t  j j |   stt  j t  j j |   n  t	 | d  }
 z t j |	 |
  Wd |
 j   X|	 j   | j d @r t  j | d t   d B q q WWd | j   Xd S(   u  
    Untar the file (with path `filename`) to the destination `location`.
    All files are written based on system defaults and umask (i.e. permissions
    are not preserved), except that regular file members with any execute
    permissions (user, group, or world) have "chmod +x" applied after being
    written.  Note that for windows, any execute changes using os.chmod are
    no-ops per the python docs.
    u   .gzu   .tgzu   r:gzu   .bz2u   .tbzu   r:bz2u   .taru   ru-   Cannot determine compression type for file %su   r:*c             S   s(   g  |  ] } | j  d  k r | j   q S(   u   pax_global_header(   u   name(   u   .0u   member(    (    u!   /tmp/pip-zej_zi-build/pip/util.pyu
   <listcomp>$  s   	 u   untar_file.<locals>.<listcomp>u   pax_global_headeri   u/   In the tar file %s the member %s is invalid: %su   wbNiI   i  (   u   osu   pathu   existsu   makedirsu   loweru   endswithu   loggeru   warnu   tarfileu   openu   has_leading_diru
   getmembersu   nameu   split_leading_diru   joinu   isdiru   issymu   _extract_memberu   sysu   exc_infou   extractfileu   KeyErroru   AttributeErroru   dirnameu   shutilu   copyfileobju   closeu   modeu   chmodu   current_umask(   u   filenameu   locationu   modeu   taru   leadingu   memberu   fnu   pathu   eu   fpu   destfp(    (    u!   /tmp/pip-zej_zi-build/pip/util.pyu
   untar_file  sf    	*	*			
&c             C   s@   t  j d 8_ t  j d |   t  j d 7_ t j |   d  S(   Ni   u&   Creating supposed download cache at %s(   u   loggeru   indentu   notifyu   osu   makedirs(   u   folder(    (    u!   /tmp/pip-zej_zi-build/pip/util.pyu   create_download_cache_folderX  s    c             C   sU   t  j d t |    t j | |   t |  d d  } | j |  | j   d  S(   Nu   Storing download in cache at %su   .content-typeu   w(   u   loggeru   notifyu   display_pathu   shutilu   copyfileu   openu   writeu   close(   u   target_fileu   temp_locationu   content_typeu   fp(    (    u!   /tmp/pip-zej_zi-build/pip/util.pyu   cache_download_  s
    c             C   sC  t  j j |   }  | d k sZ |  j d  sZ |  j d  sZ |  j d  sZ t j |   rz t |  | d |  j d  n | d k s t j |   s t	 |   d j
   d k r t |  |  n~ | r| j d  rt t |    rd d l m } | d | j  j |  n* t j d |  | | f  t d |   d  S(   Nu   application/zipu   .zipu	   .pybundleu   .whlu   flattenu   application/x-gzipi   u   .taru   .tar.gzu   .tar.bz2u   .tgzu   .tbzu	   text/htmli    (   u
   Subversionu   svn+uZ   Cannot unpack file %s (downloaded from %s, content-type: %s); cannot detect archive formatu%   Cannot determine archive format of %s(   u	   .pybundleu   .whl(   u   .taru   .tar.gzu   .tar.bz2u   .tgzu   .tbz(   u   osu   pathu   realpathu   endswithu   zipfileu
   is_zipfileu
   unzip_fileu   tarfileu
   is_tarfileu   splitextu   loweru
   untar_fileu
   startswithu   is_svn_pageu   file_contentsu   pip.vcs.subversionu
   Subversionu   urlu   unpacku   loggeru   fatalu   InstallationError(   u   filenameu   locationu   content_typeu   linku
   Subversion(    (    u!   /tmp/pip-zej_zi-build/pip/util.pyu   unpack_fileg  s$     	c             C   s  | d  k r g  } xd |  D]\ }	 d |	 k sO d |	 k sO d |	 k sO d |	 k rh d |	 j d d  }	 n  | j |	  q Wd j |  } n  | r d  }
 n	 t j }
 t j | d |  t j	 j
   } | r | j |  n  y4 t j |  d t j d	 d  d
 |
 d | d | } Wn< t k
 rNt j   d } t j d | | f    Yn Xg  } |
 d  k	 r| j }
 x t |
 j    } | sPn  | j   } | j | d  | r| |  } t | t  r| \ } } n  t j | |  t j |  st j   qqmt j |  qmn! | j   \ } } | p3d g } | j   | j r| r| rt j d |  t j d j |  d  n  t d | | j | f   qt j  d | | j | f  n  |
 d  k	 rd j |  Sd  S(   Nu    u   
u   "u   'u   "%s"u   \"u   Running command %su   stderru   stdinu   stdoutu   cwdu   envi   u#   Error %s while executing command %su    u    Complete output from command %s:u)   
----------------------------------------u*   Command %s failed with error code %s in %su"   Command %s had error code %s in %s(!   u   Noneu   replaceu   appendu   joinu
   subprocessu   PIPEu   loggeru   logu   osu   environu   copyu   updateu   Popenu   STDOUTu	   Exceptionu   sysu   exc_infou   fatalu   stdoutu   console_to_stru   readlineu   rstripu
   isinstanceu   tupleu   stdout_level_matchesu   show_progressu   infou   communicateu   waitu
   returncodeu   notifyu   InstallationErroru   warn(   u   cmdu   show_stdoutu   filter_stdoutu   cwdu   raise_on_returncodeu   command_levelu   command_descu   extra_environu	   cmd_partsu   partu   stdoutu   envu   procu   eu
   all_outputu   lineu   levelu   returned_stdoutu   returned_stderr(    (    u!   /tmp/pip-zej_zi-build/pip/util.pyu   call_subprocess  sp    0			
	c             C   sE   t  j |   } | d k r d St  j |  } t d d   | D  S(   u   
    Attempt to determine if this is a pre-release using PEP386/PEP426 rules.

    Will return True if it is a pre-release and False if not. Versions are
    assumed to be a pre-release if they cannot be parsed.
    c             S   s)   g  |  ] } t  d  d   | D   q S(   c          	   S   s1   g  |  ]' } | t  d  d d d d g  k  q S(   u   au   bu   cu   rcu   dev(   u   set(   u   .0u   y(    (    u!   /tmp/pip-zej_zi-build/pip/util.pyu
   <listcomp>  s   	 u,   is_prerelease.<locals>.<listcomp>.<listcomp>(   u   any(   u   .0u   x(    (    u!   /tmp/pip-zej_zi-build/pip/util.pyu
   <listcomp>  s   	 u!   is_prerelease.<locals>.<listcomp>NT(   u   versionu   _suggest_normalized_versionu   Noneu   Trueu   _normalized_keyu   any(   u   versu
   normalizedu   parsed(    (    u!   /tmp/pip-zej_zi-build/pip/util.pyu   is_prerelease  s
    u   is_prereleasec             B   sV   |  Ee  Z d  Z d d d d  Z d d   Z d d   Z d d   Z d	 d
   Z d S(   u   BuildDirectoryc             C   sm   | d  k r! | d  k r! d } n  | d  k rW t j d d  } | d  k rW d } qW n  | |  _ | |  _ d  S(   Nu   prefixu
   pip-build-T(   u   Noneu   Trueu   tempfileu   mkdtempu   nameu   delete(   u   selfu   nameu   delete(    (    u!   /tmp/pip-zej_zi-build/pip/util.pyu   __init__  s    		u   BuildDirectory.__init__c             C   s   d j  |  j j |  j  S(   Nu	   <{} {!r}>(   u   formatu	   __class__u   __name__u   name(   u   self(    (    u!   /tmp/pip-zej_zi-build/pip/util.pyu   __repr__  s    u   BuildDirectory.__repr__c             C   s   |  j  S(   N(   u   name(   u   self(    (    u!   /tmp/pip-zej_zi-build/pip/util.pyu	   __enter__  s    u   BuildDirectory.__enter__c             C   s   |  j    d  S(   N(   u   cleanup(   u   selfu   excu   valueu   tb(    (    u!   /tmp/pip-zej_zi-build/pip/util.pyu   __exit__  s    u   BuildDirectory.__exit__c             C   s   |  j  r t |  j  n  d  S(   N(   u   deleteu   rmtreeu   name(   u   self(    (    u!   /tmp/pip-zej_zi-build/pip/util.pyu   cleanup  s    	u   BuildDirectory.cleanupN(	   u   __name__u
   __module__u   __qualname__u   Noneu   __init__u   __repr__u	   __enter__u   __exit__u   cleanup(   u
   __locals__(    (    u!   /tmp/pip-zej_zi-build/pip/util.pyu   BuildDirectory  s
   u   BuildDirectoryFT(   u
   setuptoolsu   pipu   pythonu
   distribute(Q   u   sysu   shutilu   osu   statu   reu	   posixpathu   zipfileu   tarfileu
   subprocessu   textwrapu   tempfileu   pip.exceptionsu   InstallationErroru
   BadCommandu   PipErroru   pip.backwardcompatu   WindowsErroru   string_typesu	   raw_inputu   console_to_stru	   user_siteu   PermissionErroru   pip.locationsu   site_packagesu   running_under_virtualenvu   virtualenv_no_globalu   pip.logu   loggeru   pip._vendoru   pkg_resourcesu   pip._vendor.distlibu   versionu   __all__u   get_progu   Falseu   rmtreeu   rmtree_errorhandleru   display_pathu
   backup_diru   Noneu   find_commandu   get_pathextu   ask_path_existsu   asku   objectu   _Infu   Infu   compileu   Iu   _normalize_reu   normalize_nameu   format_sizeu   is_installable_diru   is_svn_pageu   file_contentsu   split_leading_diru   has_leading_diru   make_path_relativeu   normalize_pathu   splitextu   renamesu   is_localu   dist_is_localu   dist_in_usersiteu   dist_in_site_packagesu   dist_is_editableu   Trueu   get_installed_distributionsu   egg_link_pathu   dist_locationu   get_terminal_sizeu   current_umasku
   unzip_fileu
   untar_fileu   create_download_cache_folderu   cache_downloadu   unpack_fileu   DEBUGu   call_subprocessu   is_prereleaseu   BuildDirectory(    (    (    u!   /tmp/pip-zej_zi-build/pip/util.pyu   <module>   s   .							
		'"-L	?