î
É X¬  ã               @   s=  d  Z  d d l Z d d l Z d d l Z d d l Z d g Z e e d ƒ Z Gd d „  d e ƒ Z	 y
 e
 Z
 Wn e k
 rˆ e	 Z
 Yn Xy
 e Z Wn e k
 r­ e	 Z Yn Xe j j Z e j d$ k ròd d l m Z m Z d d	 l m Z d d
 l m Z m Z d d l m Z m Z d d l m Z m Z m Z d d l  m! Z" d d l# j$ Z% d d l j& Z' d d l( Z) d d l* j+ Z, d d l# j$ Z- d d l. j+ Z/ d d „  Z0 d d „  Z1 d d „  Z2 d d „  Z3 d d „  Z4 e5 Z5 e6 f Z7 e8 Z9 nd d l: m Z d d
 l' m Z m Z d d l m Z m Z d d l% m Z m Z m 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 „  Z1 d d „  Z2 d d „  Z3 d d „  Z4 e6 Z5 e< f Z7 e Z e0 Z0 e9 Z9 e Z d d l= m> Z> m? Z? e@ e d d ƒ ZA d  d! „  ZB d" d# „  ZC d S)%zKStuff that differs in different Python versions and platform
distributions.é    NÚWindowsErrorÚcache_from_sourcec               @   s   e  Z d  Z d Z d S)ÚNeverUsedExceptionz%this exception should never be raisedN)Ú__name__Ú
__module__Ú__qualname__Ú__doc__© r	   r	   úF/home/ubuntu/projects/ifolica/build/pip/pip/backwardcompat/__init__.pyr      s   r   é   )ÚStringIOÚBytesIO)Úreduce)ÚURLErrorÚ	HTTPError)ÚQueueÚEmpty)Úurl2pathnameÚurlretrieveÚpathname2url)Úmessagec             C   s   |  | k |  | k  S)Nr	   )ÚaÚbr	   r	   r
   Úcmp+   s    r   c             C   s   |  j  d ƒ S)Nzutf-8)Úencode)Úsr	   r	   r
   r   .   s    r   c             C   s   |  j  d ƒ S)Nzutf-8)Údecode)r   r	   r	   r
   Úu1   s    r   c             C   s7   y |  j  t ƒ SWn t k
 r2 |  j  d ƒ SYn Xd  S)NÚutf_8)r   Úconsole_encodingÚUnicodeDecodeError)r   r	   r	   r
   Úconsole_to_str4   s    r!   c             C   s   |  j  | | ƒ S)N)Ú	get_param)Úhttp_messageÚparamÚdefault_valuer	   r	   r
   Úget_http_message_param:   s    r&   )r   )ÚMessagec             C   s   |  S)Nr	   )r   r	   r	   r
   r   M   s    c             C   s   |  S)Nr	   )r   r	   r	   r
   r   P   s    c             C   s   |  S)Nr	   )r   r	   r	   r
   r!   S   s    c             C   s   |  j  | ƒ } | p | S)N)Zgetparam)r#   r$   r%   Úresultr	   r	   r
   r&   V   s    )Úget_python_libÚget_python_versionÚ	USER_SITEc              /   sx   t  t t |  ƒ ƒ | j d d ƒ } g  g } x' | D] ‰  ‡  f d d †  | Dƒ } q5 Wx | D] } t | ƒ Vq_ Wd  S)NÚrepeaté   c                s*   g  |  ]  } ˆ  D] } | | g ‘ q q Sr	   r	   )Ú.0ÚxÚy)Úpoolr	   r
   ú
<listcomp>n   s   	 zproduct.<locals>.<listcomp>)ÚlistÚmapÚtupleÚget)ÚargsÚkwdsÚpoolsr(   Úprodr	   )r1   r
   Úproducth   s    %	r;   c             C   sˆ   t  t d ƒ rM t j |  t j t j Bƒ } t j | ƒ j } t j | ƒ n7 t j j	 |  ƒ st t j
 |  ƒ j } n t d |  ƒ ‚ | S)a)  
    Return path's uid.

    Does not follow symlinks: https://github.com/pypa/pip/pull/935#discussion_r5307003

    Placed this function in backwardcompat due to differences on AIX and Jython,
    that should eventually go away.

    :raises OSError: When path is a symlink or can't be read.
    Ú
O_NOFOLLOWz1%s is a symlink; Will not return uid for symlinks)ÚhasattrÚosÚopenÚO_RDONLYr<   ÚfstatÚst_uidÚcloseÚpathÚislinkÚstatÚOSError)rD   ÚfdÚfile_uidr	   r	   r
   Úget_path_uids   s    rJ   )r   )Dr   r>   ÚimpÚsysÚsiteÚ__all__r=   Úuses_pycacheÚ	Exceptionr   r   Ú	NameErrorÚPermissionErrorÚ
__stdout__Úencodingr   Úversion_infoÚior   r   Ú	functoolsr   Úurllib.errorr   r   Úqueuer   r   Úurllib.requestr   r   r   Úemailr   ÚemailmessageÚurllib.parseÚparseÚurllibÚrequestÚurllib2ÚconfigparserÚConfigParserÚxmlrpc.clientÚclientÚ	xmlrpclibÚurlparseÚhttp.clientÚhttplibr   r   r   r!   r&   ÚbytesÚstrÚstring_typesÚinputÚ	raw_inputÚ	cStringIOr'   Ú
basestringÚdistutils.sysconfigr)   r*   ÚgetattrÚ	user_siter;   rJ   r	   r	   r	   r
   Ú<module>   s|   	

			