a
    Xh                     @   sh   d dl Z d dlZd dlmZ d dlmZ d dlmZ erLd dl	m
Z
mZmZ dd Zdd	 Zd
d ZdS )    N)parse)request)MYPY_CHECK_RUNNING)OptionalTextUnionc                 C   s    d| vrd S |  ddd  S )N:   r   )splitlower)url r   ]/var/www/viveiro_mudafortebrasil/venv/lib/python3.9/site-packages/pip/_internal/utils/urls.pyget_url_scheme   s    r   c                 C   s*   t jt j| } tdt| }|S )zh
    Convert a path to a file: URL.  The path will be made absolute and have
    quoted path parts.
    file:)ospathnormpathabspathurllib_parseurljoinurllib_requestpathname2url)r   r   r   r   r   path_to_url   s    r   c                 C   s   |  ds J djf i t t| \}}}}}|r@|dkrFd}n*tjdkrZd| }ntdjf i t t	|| }|S )z(
    Convert a file: URL to a path.
    r   z9You can only turn file: urls into filenames (not {url!r})	localhost win32z\\z?non-local file URIs are not supported on this platform: {url!r})

startswithformatlocalsr   urlsplitsysplatform
ValueErrorr   url2pathname)r   _netlocr   r   r   r   url_to_path   s"    

r'   )r   r!   Zpip._vendor.six.moves.urllibr   r   r   r   pip._internal.utils.typingr   typingr   r   r   r   r   r'   r   r   r   r   <module>   s   