
    fXf                     z    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 de	dee	         fdZ
de	de	fd	Zde	de	fd
ZdS )    N)Optional   )WINDOWSurlreturnc                 j    d| vrd S |                      dd          d                                         S )N:r   r   )splitlower)r   s    Q/var/www/html/Qu*py/bism/lib/python3.11/site-packages/pip/_internal/utils/urls.pyget_url_schemer   
   s5    
#~~t99S!Q%%'''    pathc                     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:)	osr   normpathabspathurllibparseurljoinrequestpathname2url)r   r   s     r   path_to_urlr      sS    
 7BGOOD1122D
,

w(C(CD(I(I
J
JCJr   c                    |                      d          sJ d| d            t          j                            |           \  }}}}}|r|dk    rd}nt          rd|z   }nt          d|           t          j                            ||z             }t          rK|sIt          |          dk    r6|d	         d
k    r*|d         t          j
        v r|dd         dv r
|dd         }|S )z(
    Convert a file: URL to a path.
    r   z1You can only turn file: urls into filenames (not )	localhost z\\z8non-local file URIs are not supported on this platform:    r   /r         )r	   z:/N)
startswithr   r   urlsplitr   
ValueErrorr   url2pathnamelenstringascii_letters)r   _netlocr   s       r   url_to_pathr,      s1    >>  D DC3CCCD D D #L11#66AvtQ 	
V{**	 
&NsNN
 
 	
 >&&v}55D 	 IINNGsNNGv+++1I$$ABBxKr   )r   r(   urllib.parser   urllib.requesttypingr   compatr   strr   r   r,    r   r   <module>r3      s    				                     ( ( ( ( ( (c c    $S $S $ $ $ $ $ $r   