U
    +|jè  ã                   @   sH   d dl Z d dlZd dlZd dlZd dlmZ dd„ Zdd„ Zdd„ Z	dS )	é    N)ÚOptionalc                 C   s    d| krd S |   dd¡d  ¡ S )Nú:é   r   )ÚsplitÚlower)Úurl© r   ú`C:\Users\snmko\Desktop\web_content\django_cbt\venv\Lib\site-packages\pip/_internal/utils/urls.pyÚget_url_scheme   s    r
   c                 C   s.   t j t j | ¡¡} tj dtj | ¡¡}|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ÚrequestÚpathname2url)r   r   r   r   r	   Úpath_to_url   s    r   c                 C   sx   |   d¡std| ›d�ƒ‚tj | ¡\}}}}}|r<|dkrBd}n"tjdkrVd| }ntd| ›�ƒ‚tj 	|| ¡}|S )	z(
    Convert a file: URL to a path.
    r   z1You can only turn file: urls into filenames (not ú)Ú	localhostÚ Úwin32z\\z8non-local file URIs are not supported on this platform: )
Ú
startswithÚAssertionErrorr   r   ÚurlsplitÚsysÚplatformÚ
ValueErrorr   Úurl2pathname)r   Ú_Únetlocr   r   r   r	   Úurl_to_path   s    ÿ
þ

ÿr#   )
r   r   Úurllib.parser   Úurllib.requestÚtypingr   r
   r   r#   r   r   r   r	   Ú<module>   s   