3
g                 @   sp   d dl Z d dlZd dlZd dlZd dlmZ ddlmZ e	ee	 dddZ
e	e	dd	d
Ze	e	dddZdS )    N)Optional   )WINDOWS)urlreturnc             C   s    d| krd S | j ddd j S )N:r   r   )splitlower)r    r
   V/var/www/tester-filtro-web/env/lib/python3.6/site-packages/pip/_internal/utils/urls.pyget_url_scheme
   s    r   )pathr   c             C   s.   t jjt jj| } tjjdtjj| }|S )zh
    Convert a path to a file: URL.  The path will be made absolute and have
    quoted path parts.
    zfile:)	osr   normpathabspathurllibparseurljoinrequestpathname2url)r   r   r
   r
   r   path_to_url   s    r   c             C   s   | j dstd| dtjj| \}}}}}| s>|dkrDd}ntrRd| }ntd| tjj|| }tr| rt	|dkr|d	 d
kr|d t
jkr|dd dkr|dd }|S )z(
    Convert a file: URL to a path.
    zfile:z1You can only turn file: urls into filenames (not )	localhost z\\z8non-local file URIs are not supported on this platform:    r   /r         r   :/N)r   r   )
startswithAssertionErrorr   r   urlsplitr   
ValueErrorr   url2pathnamelenstringascii_letters)r   _netlocr   r
   r
   r   url_to_path   s&    
r)   )r   r%   urllib.parser   urllib.requesttypingr   compatr   strr   r   r)   r
   r
   r
   r   <module>   s   
