
Rc        )   @   s  d  d k  Z  d  d k Z d  d k Z d  d k Z d  d k Z d  d k Z d  d k Z d  d k Z d  d k Z d  d k	 Z	 d  d k
 Z
 d  d k l Z l Z l Z d  d k l Z l Z l Z l Z l Z l Z d  d k l Z l Z l Z d  d k l Z d  d k l 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    Z e  d!  Z! d"   Z" d#   Z# d$ d%  Z$ d d d&  Z& d d'  Z' d(   Z( d)   Z) d* e* f d+     YZ+ e+   Z, [+ e i- d, e i.  Z/ d-   Z0 d.   Z1 d/   Z2 d0   Z3 d1   Z4 d2   Z5 d3   Z6 d4   Z7 d5   Z8 d6   Z9 d7   Z: d8   Z; d9   Z< d:   Z= d;   Z> d<   Z? e@ dK e@ e  d@  ZA dA   ZB dB   ZC dC   ZD e@ dD  ZE dE   ZF dF   ZG dG   ZH dH   ZI e@ d d e@ e iJ d d dI  ZK dJ   ZL d S(L   iN(   t   InstallationErrort
   BadCommandt   PipError(   t   WindowsErrort   string_typest	   raw_inputt   console_to_strt	   user_sitet   PermissionError(   t   site_packagest   running_under_virtualenvt   virtualenv_no_global(   t   logger(   t   versiont   rmtreet   display_patht
   backup_dirt   find_commandt   askt   Inft   normalize_namet   splitextt   format_sizet   is_installable_dirt   is_svn_paget   file_contentst   split_leading_dirt   has_leading_dirt   make_path_relativet   normalize_patht   renamest   get_terminal_sizet   get_progt
   unzip_filet
   untar_filet   create_download_cache_foldert   cache_downloadt   unpack_filet   call_subprocessc           C   sS   y0 t  i i t i d  d j o d t i SWn t t t f j
 o n Xd S(   Ni    s   __main__.pys   -cs	   %s -m pipt   pip(   s   __main__.pys   -c(	   t   ost   patht   basenamet   syst   argvt
   executablet   AttributeErrort	   TypeErrort
   IndexError(    (    (    sD   /var/www/html/kasc-wg8/erics/lib/python2.6/site-packages/pip/util.pyR       s     c         C   s   t  i |  d | d t d  S(   Nt   ignore_errorst   onerror(   t   shutilR   t   rmtree_errorhandler(   t   dirR1   (    (    sD   /var/www/html/kasc-wg8/erics/lib/python2.6/site-packages/pip/util.pyR   (   s    c         C   s   | d  \ } } | t  j o | i d d j p? | t j o | i d d j p | t j o | i d d j p   n t i |  i t i @t i j o   n t i | t i	  |  |  d S(   s   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.i   i    i   i   i   N(
   R   t   argst   OSErrorR   R(   t   statt   st_modet   S_IREADt   chmodt   S_IWRITE(   t   funcR)   t   exc_infot   exctypet   value(    (    sD   /var/www/html/kasc-wg8/erics/lib/python2.6/site-packages/pip/util.pyR4   -   s    !!!#c         C   s`   t  i i t  i i |    }  |  i t  i   t  i i  o d |  t t  i    }  n |  S(   sT   Gives the display value for a given path, making it relative to cwd
    if possible.t   .(   R(   R)   t   normcaset   abspatht
   startswitht   getcwdt   sept   len(   R)   (    (    sD   /var/www/html/kasc-wg8/erics/lib/python2.6/site-packages/pip/util.pyR   @   s     s   .bakc         C   sM   d } | } x6 t  i i |  |  o | d 7} | t |  } q W|  | S(   s\   Figure out the name of a directory to back up the given dir to
    (adding .bak, .bak2, etc)i   (   R(   R)   t   existst   str(   R5   t   extt   nt	   extension(    (    sD   /var/www/html/kasc-wg8/erics/lib/python2.6/site-packages/pip/util.pyR   I   s     
c         C   sb  | d j o% t i i d d  i t i  } n t | t  o | g } n | d j o t   } n g  } | i	   i t i  D] } t
 |  o | | q q ~ } t i i |   d i	   | j o d g } n xn | D]f } t i i | |   } x0 | D]( } | | } t i i |  o | SqWt i i |  o | Sq Wt d |    d S(   s<   Searches the PATH for the given command and returns its patht   PATHt    i   s   Cannot find command %rN(   t   NoneR(   t   environt   gett   splitt   pathsept
   isinstanceR   t   get_pathextt   lowerRG   R)   R   t   joint   isfileR   (   t   cmdt   pathst   pathextt   _[1]RJ   R)   t   cmd_patht   cmd_path_ext(    (    sD   /var/www/html/kasc-wg8/erics/lib/python2.6/site-packages/pip/util.pyR   T   s(    %D#  
		c         C   sH   |  d j o" t i i d d d d g  }  n t i i d |   } | S(   s9   Returns the path extensions from environment or a defaults   .COMs   .EXEs   .BATs   .CMDt   PATHEXTN(   RO   R(   RS   RW   RP   RQ   (   t   default_pathextR[   (    (    sD   /var/www/html/kasc-wg8/erics/lib/python2.6/site-packages/pip/util.pyRU   o   s    "c         C   s?   x/ t  i i d d  D] } | | j o | Sq Wt |  |  S(   Nt   PIP_EXISTS_ACTIONRN   (   R(   RP   RQ   R   (   t   messaget   optionst   action(    (    sD   /var/www/html/kasc-wg8/erics/lib/python2.6/site-packages/pip/util.pyt   ask_path_existsw   s
     	c         C   s|   xu t  i i d  o t d |    n t |   } | i   i   } | | j o d | d i |  f GHq | Sq d S(   s@   Ask the message interactively, with the given possible responsest   PIP_NO_INPUTs7   No input was expected ($PIP_NO_INPUT set); question: %ss<   Your response (%r) was not one of the expected responses: %ss   , N(   R(   RP   RQ   t	   ExceptionR   t   stripRV   RW   (   Rb   Rc   t   response(    (    sD   /var/www/html/kasc-wg8/erics/lib/python2.6/site-packages/pip/util.pyR   ~   s    t   _Infc           B   sM   e  Z d  Z d   Z d   Z d   Z d   Z d   Z d   Z d   Z	 RS(   s   I am bigger than everything!c         C   s   |  | j o t  St Sd  S(   N(   t   Truet   False(   t   selft   other(    (    sD   /var/www/html/kasc-wg8/erics/lib/python2.6/site-packages/pip/util.pyt   __eq__   s    c         C   s   |  i  |  S(   N(   Ro   (   Rm   Rn   (    (    sD   /var/www/html/kasc-wg8/erics/lib/python2.6/site-packages/pip/util.pyt   __ne__   s    c         C   s   t  S(   N(   Rl   (   Rm   Rn   (    (    sD   /var/www/html/kasc-wg8/erics/lib/python2.6/site-packages/pip/util.pyt   __lt__   s    c         C   s   t  S(   N(   Rl   (   Rm   Rn   (    (    sD   /var/www/html/kasc-wg8/erics/lib/python2.6/site-packages/pip/util.pyt   __le__   s    c         C   s   t  S(   N(   Rk   (   Rm   Rn   (    (    sD   /var/www/html/kasc-wg8/erics/lib/python2.6/site-packages/pip/util.pyt   __gt__   s    c         C   s   t  S(   N(   Rk   (   Rm   Rn   (    (    sD   /var/www/html/kasc-wg8/erics/lib/python2.6/site-packages/pip/util.pyt   __ge__   s    c         C   s   d S(   NR   (    (   Rm   (    (    sD   /var/www/html/kasc-wg8/erics/lib/python2.6/site-packages/pip/util.pyt   __repr__   s    (
   t   __name__t
   __module__t   __doc__Ro   Rp   Rq   Rr   Rs   Rt   Ru   (    (    (    sD   /var/www/html/kasc-wg8/erics/lib/python2.6/site-packages/pip/util.pyRj      s   						s   [^a-z]c         C   s   t  i d |  i    S(   Nt   -(   t   _normalize_ret   subRV   (   t   name(    (    sD   /var/www/html/kasc-wg8/erics/lib/python2.6/site-packages/pip/util.pyR      s    c         C   s^   |  d j o d |  d d S|  d	 j o d |  d S|  d j o d |  d Sd |  Sd  S(
   Ni  s   %.1fMBg     @@i
   s   %ikBs   %.1fkBs   %ibytesi@B i'  (    (   t   bytes(    (    sD   /var/www/html/kasc-wg8/erics/lib/python2.6/site-packages/pip/util.pyR      s    c         C   sI   t  i i |   p t St  i i |  d  } t  i i |  o t St S(   s@   Return True if `path` is a directory containing a setup.py file.s   setup.py(   R(   R)   t   isdirRl   RW   RX   Rk   (   R)   t   setup_py(    (    sD   /var/www/html/kasc-wg8/erics/lib/python2.6/site-packages/pip/util.pyR      s    c         C   s)   t  i d |   o t  i d |  t  i  S(   sJ   Returns true if the page appears to be the index page of an svn repositorys   <title>[^<]*Revision \d+:s#   Powered by (?:<a[^>]*?>)?Subversion(   t   ret   searcht   I(   t   html(    (    sD   /var/www/html/kasc-wg8/erics/lib/python2.6/site-packages/pip/util.pyR      s    c         C   s8   t  |  d  } z | i   i d  SWd  | i   Xd  S(   Nt   rbs   utf-8(   t   opent   readt   decodet   close(   t   filenamet   fp(    (    sD   /var/www/html/kasc-wg8/erics/lib/python2.6/site-packages/pip/util.pyR      s    c         C   s   t  |   }  |  i d  i d  }  d |  j oJ d |  j o |  i d  |  i d  j  p d |  j o |  i d d  Sd |  j o |  i d d  S|  d f Sd  S(   Nt   /s   \i   RN   (   RI   t   lstript   findRR   (   R)   (    (    sD   /var/www/html/kasc-wg8/erics/lib/python2.6/site-packages/pip/util.pyR      s    9c         C   sb   d } xU |  D]M } t |  \ } } | p t S| d j o
 | } q | | j o t Sq Wt S(   sy   Returns true if all the paths have the same leading path name
    (i.e., everything is in one subdirectory in an archive)N(   RO   R   Rl   Rk   (   RZ   t   common_prefixR)   t   prefixt   rest(    (    sD   /var/www/html/kasc-wg8/erics/lib/python2.6/site-packages/pip/util.pyR      s     
	c         C   s=  t  i i |   } t  i i |   }  t  i i t  i i |    }  t  i i t  i i |   } |  i t  i i  i t  i i  } | i t  i i  i t  i i  } xB | o: | o3 | d | d j o | i	 d  | i	 d  q Wd g t
 |  | | g } | d g j o d t  i i St  i i i |  S(   s  
    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    s   ..RN   RA   (   R(   R)   R*   t   dirnamet   normpathRC   Rh   RF   RR   t   popRG   RW   (   R)   t   rel_tot   path_filenamet
   path_partst   rel_to_partst
   full_parts(    (    sD   /var/www/html/kasc-wg8/erics/lib/python2.6/site-packages/pip/util.pyR      s    $$ #c         C   s   t  i i t  i i |    S(   sN   
    Convert a path to its canonical, case-normalized, absolute version.

    (   R(   R)   RB   t   realpath(   R)   (    (    sD   /var/www/html/kasc-wg8/erics/lib/python2.6/site-packages/pip/util.pyR     s    c         C   sQ   t  i |   \ } } | i   i d  o | d | } | d  } n | | f S(   s,   Like os.path.splitext, but take off .tar toos   .tari(   t	   posixpathR   RV   t   endswith(   R)   t   baseRJ   (    (    sD   /var/www/html/kasc-wg8/erics/lib/python2.6/site-packages/pip/util.pyR     s
    c         C   s   t  i i |  \ } } | o, | o% t  i i |  o t  i |  n t i |  |  t  i i |   \ } } | o2 | o+ y t  i |  Wq t j
 o q Xn d S(   s7   Like os.renames(), but handles renaming across devices.N(	   R(   R)   RR   RH   t   makedirsR3   t   movet
   removedirsR7   (   t   oldt   newt   headt   tail(    (    sD   /var/www/html/kasc-wg8/erics/lib/python2.6/site-packages/pip/util.pyR     s    "c         C   s+   t    p t St |   i t t i   S(   s   
    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."

    (   R
   Rk   R   RD   R+   R   (   R)   (    (    sD   /var/www/html/kasc-wg8/erics/lib/python2.6/site-packages/pip/util.pyt   is_local0  s    
c         C   s   t  t |    S(   s   
    Return True if given Distribution object is installed locally
    (i.e. within current virtualenv).

    Always True if we're not in a virtualenv.

    (   R   t   dist_location(   t   dist(    (    sD   /var/www/html/kasc-wg8/erics/lib/python2.6/site-packages/pip/util.pyt   dist_is_local<  s    c         C   s/   t  o  t t |    i t t    St Sd S(   sF   
    Return True if given Distribution is installed in user site.
    N(   R   R   R   RD   Rl   (   R   (    (    sD   /var/www/html/kasc-wg8/erics/lib/python2.6/site-packages/pip/util.pyt   dist_in_usersiteG  s     c         C   s   t  t |    i t  t   S(   sa   
    Return True if given Distribution is installed in distutils.sysconfig.get_python_lib().
    (   R   R   RD   R	   (   R   (    (    sD   /var/www/html/kasc-wg8/erics/lib/python2.6/site-packages/pip/util.pyt   dist_in_site_packagesP  s    c         C   s)   d d k  l } | i |  g   } | i S(   s$   Is distribution an editable install?i(   t   FrozenRequirement(   R'   R   t	   from_distt   editable(   R   R   t   req(    (    sD   /var/www/html/kasc-wg8/erics/lib/python2.6/site-packages/pip/util.pyt   dist_is_editableW  s    t
   setuptoolsR'   t   pythonc   	      C   s   |  o
 t  } n
 d   } | o d   } n
 d   } | o d   } n
 d   } g  } t i D]H } | |  o5 | i | j o% | |  o | |  o | | qb qb ~ S(   s  
    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   t  S(    (   Rk   (   t   d(    (    sD   /var/www/html/kasc-wg8/erics/lib/python2.6/site-packages/pip/util.pyt   <lambda>t  s    c         S   s   t  S(    (   Rk   (   R   (    (    sD   /var/www/html/kasc-wg8/erics/lib/python2.6/site-packages/pip/util.pyR   w  s    c         S   s   t  |   S(    (   R   (   R   (    (    sD   /var/www/html/kasc-wg8/erics/lib/python2.6/site-packages/pip/util.pyR   y  s    c         S   s
   t  |   S(    (   R   (   R   (    (    sD   /var/www/html/kasc-wg8/erics/lib/python2.6/site-packages/pip/util.pyR   |  s    c         S   s   t  S(    (   Rk   (   R   (    (    sD   /var/www/html/kasc-wg8/erics/lib/python2.6/site-packages/pip/util.pyR   ~  s    (   R   t   pkg_resourcest   working_sett   key(	   t
   local_onlyt   skipt   include_editablest   editables_onlyt
   local_testt   editable_testt   editables_only_testR\   R   (    (    sD   /var/www/html/kasc-wg8/erics/lib/python2.6/site-packages/pip/util.pyt   get_installed_distributions^  s    
			c         C   s   g  } t    oD t   o | i t  qy | i t  t o | i t  qy n& t o | i t  n | i t  xB | D]: } t i i | |  i  d } t i i	 |  o | Sq Wd S(   s  
    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.
    s	   .egg-linkN(
   R
   R   t   appendR	   R   R(   R)   RW   t   project_nameRX   (   R   t   sitest   sitet   egglink(    (    sD   /var/www/html/kasc-wg8/erics/lib/python2.6/site-packages/pip/util.pyt   egg_link_path  s    

 c         C   s   t  |   } | o | S|  i S(   s   
    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.

    (   R   t   location(   R   t   egg_link(    (    sD   /var/www/html/kasc-wg8/erics/lib/python2.6/site-packages/pip/util.pyR     s    c          C   s   d   }  |  d  p |  d  p
 |  d  } | pF y8 t  i t  i   t  i  } |  |  } t  i |  Wq| q| Xn | p. t  i i d d  t  i i d d  f } n t | d  t | d  f S(	   sl   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  k  } d d  k } d d  k } | i d | i |  | i d   } Wn d  SX| d j o d  S| d j o d  S| S(   Nit   hht   1234i    (   i    i    (   i    i    (   t   fcntlt   termiost   structt   unpackt   ioctlt
   TIOCGWINSZRO   (   t   fdR   R   R   t   cr(    (    sD   /var/www/html/kasc-wg8/erics/lib/python2.6/site-packages/pip/util.pyt   ioctl_GWINSZ  s    i    i   i   t   LINESi   t   COLUMNSiP   (   R(   R   t   ctermidt   O_RDONLYR   RP   RQ   t   int(   R   R   R   (    (    sD   /var/www/html/kasc-wg8/erics/lib/python2.6/site-packages/pip/util.pyR     s    	&.c         C   s  t  i i |  p t  i |  n t |  d  } zet i |  } t | i    o | } x6| i	   D](} | i
 } | i |  } | }	 | o t |  d }	 n t  i i | |	  }	 t  i i |	  }
 t  i i |
  p t  i |
  n |	 i d  p |	 i d  o( t  i i |	  p t  i |	  qqk t |	 d  } z | i |  Wd | i   | i d ?} | o t  i |	 |  n Xqk WWd | i   Xd S(   sM   Unzip the file (zip file located at filename) to the destination
    locationR   i   R   s   \t   wbNi   (   R(   R)   RH   R   R   t   zipfilet   ZipFileR   t   namelistt   infolistR   R   R   RW   R   R   t   writeR   t   external_attrR;   (   R   R   t   flattent   zipfpt   zipt   leadingt   infoR|   t   datat   fnR5   R   t   unix_attributes(    (    sD   /var/www/html/kasc-wg8/erics/lib/python2.6/site-packages/pip/util.pyR!     s8     	 
c         C   s  t  i i |  p t  i |  n |  i   i d  p |  i   i d  o
 d } nn |  i   i d  p |  i   i d  o
 d } n8 |  i   i d  o
 d } n t i d	 |   d
 } t i	 |  |  } zt
 g  } | i   D]$ } | i d j o | | i q q ~  } x| i   D]} | i } | d j o q-n | o t |  d } n t  i i | |  } | i   o( t  i i |  p t  i |  qq-| i   oR y | i | |  Wqt i   d }	 t i d |  | i |	 f  q-qXq-y | i |  }
 WnI t t f j
 o7 t i   d }	 t i d |  | i |	 f  q-n Xt  i i t  i i |   p t  i t  i i |   n t	 | d  } z t i |
 |  Wd | i   X|
 i   q-WWd | i   Xd S(   sI   Untar the file (tar file located at filename) to the destination locations   .gzs   .tgzs   r:gzs   .bz2s   .tbzs   r:bz2s   .tart   rs-   Cannot determine compression type for file %ss   r:*t   pax_global_headeri   s/   In the tar file %s the member %s is invalid: %sR   N(   R(   R)   RH   R   RV   R   R   t   warnt   tarfileR   R   t
   getmembersR|   R   RW   R~   t   issymt   _extract_memberR+   R>   t   extractfilet   KeyErrorR.   R   R3   t   copyfileobjR   (   R   R   t   modet   tarR\   t   memberR   R   R)   t   eR   t   destfp(    (    sD   /var/www/html/kasc-wg8/erics/lib/python2.6/site-packages/pip/util.pyR"     sf    ,
,

* 	c         C   s@   t  i d 8_ t  i d |   t  i d 7_ t i |   d  S(   Ni   s&   Creating supposed download cache at %s(   R   t   indentt   notifyR(   R   (   t   folder(    (    sD   /var/www/html/kasc-wg8/erics/lib/python2.6/site-packages/pip/util.pyR#   <  s    c         C   sU   t  i d t |    t i | |   t |  d d  } | i |  | i   d  S(   Ns   Storing download in cache at %ss   .content-typet   w(   R   R   R   R3   t   copyfileR   R   R   (   t   target_filet   temp_locationt   content_typeR   (    (    sD   /var/www/html/kasc-wg8/erics/lib/python2.6/site-packages/pip/util.pyR$   C  s
    c         C   sQ  t  i i |   }  | d j p@ |  i d  p0 |  i d  p  |  i d  p t i |   o! t |  | d |  i d  n | d j p- t i |   p t	 |   d i
   d j o t |  |  n | oQ | i d  oA t t |    o. d d k l } | d | i  i |  n+ t i d |  | | f  t d |   d  S(   Ns   application/zips   .zips	   .pybundles   .whlR   s   application/x-gzipi   s   .tars   .tar.gzs   .tar.bz2s   .tgzs   .tbzs	   text/htmli(   t
   Subversions   svn+sZ   Cannot unpack file %s (downloaded from %s, content-type: %s); cannot detect archive formats%   Cannot determine archive format of %s(   s	   .pybundles   .whl(   s   .tars   .tar.gzs   .tar.bz2s   .tgzs   .tbz(   R(   R)   R   R   R   t
   is_zipfileR!   R   t
   is_tarfileR   RV   R"   RD   R   R   t   pip.vcs.subversionR   t   urlR   R   t   fatalR    (   R   R   R   t   linkR   (    (    sD   /var/www/html/kasc-wg8/erics/lib/python2.6/site-packages/pip/util.pyR%   K  s$    !	c         C   s  | d  j o g  } xi |  D]a }	 d |	 j p' d |	 j p d |	 j p d |	 j o d |	 i d d  }	 n | i |	  q Wd i |  } n | o
 d  }
 n
 t i }
 t i | d |  t i	 i
   } | o | i |  n y4 t i |  d t i d	 d  d
 |
 d | d | } Wn= t j
 o1 t i   d } t i d | | f    n Xg  } |
 d  j	 o | i }
 x t |
 i    } | p Pn | i   } | i | d  | o^ | |  } t | t  o | \ } } n t i | |  t i |  p t i   q'qzt i |  qzn# | i   \ } } | p d g } | i   | i o~ | oV | o/ t i d |  t i d i |  d  n t d | | i | f   qt i  d | | i | f  n |
 d  j	 o d i |  Sd  S(   Nt    s   
t   "t   's   "%s"s   \"s   Running command %st   stderrt   stdint   stdoutt   cwdt   envi   s#   Error %s while executing command %sRN   s    Complete output from command %s:s)   
----------------------------------------s*   Command %s failed with error code %s in %ss"   Command %s had error code %s in %s(!   RO   t   replaceR   RW   t
   subprocesst   PIPER   t   logR(   RP   t   copyt   updatet   Popent   STDOUTRg   R+   R>   R  R  R   t   readlinet   rstripRT   t   tuplet   stdout_level_matchest   show_progressR   t   communicatet   waitt
   returncodeR   R    R   (   RY   t   show_stdoutt   filter_stdoutR	  t   raise_on_returncodet   command_levelt   command_desct   extra_environt	   cmd_partst   partR  R
  t   procR   t
   all_outputt   linet   levelt   returned_stdoutt   returned_stderr(    (    sD   /var/www/html/kasc-wg8/erics/lib/python2.6/site-packages/pip/util.pyR&   d  sr     4
		

c         C   s   t  i |   } | d j o t St  i |  } t g  } | D]I } | t g  } | D]( } | | t d d d d d g  j qU ~  q> ~  S(   s   
    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.
    t   at   bt   ct   rct   devN(   R   t   suggest_normalized_versionRO   Rk   t   normalized_keyt   anyt   set(   t   verst
   normalizedt   parsedR\   t   xt   _[2]t   y(    (    sD   /var/www/html/kasc-wg8/erics/lib/python2.6/site-packages/pip/util.pyt   is_prerelease  s
    (   s
   setuptoolss   pips   python(M   R+   R3   R(   R8   R   R   R   R   R   R  t   textwrapt   pip.exceptionsR    R   R   t   pip.backwardcompatR   R   R   R   R   R   t   pip.locationsR	   R
   R   t   pip.logR   t   pip.vendor.distlibR   t   __all__R    Rl   R   R4   R   R   RO   R   RU   Re   R   t   objectRj   R   t   compileR   Rz   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   Rk   R   R   R   R   R!   R"   R#   R$   R%   t   DEBUGR&   R8  (    (    (    sD   /var/www/html/kasc-wg8/erics/lib/python2.6/site-packages/pip/util.pyt   <module>   s   .															
															'	"		&	@				?