
    QhA                     P    d dl Z d dlZd dlZd dlZddlmZ dedefdZdedefdZ	y)	    N   )WINDOWSpathreturnc                     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   urls     T/var/www/teggl/fontify/venv/lib/python3.12/site-packages/pip/_internal/utils/urls.pypath_to_urlr   	   sO    
 77BGGOOD12D
,,

y&..*E*Ed*K
LCJ    r   c                    | j                  d      sJ d| d       t        j                  j                  |       \  }}}}}|r|dk(  rd}nt        rd|z   }nt        d|       t        j                  j                  ||z         }t        r9|s7t        |      dk\  r)|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.
    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         ):z:/N)
startswithr   r   urlsplitr   
ValueErrorr   url2pathnamelenstringascii_letters)r   _netlocr   s       r   url_to_pathr&      s     >> D	:3'CD  #LL11#6AvtQV{*	&FsgN
 	
 >>&&v}5D 	INGsNGv+++1I$ABxKr   )
r   r"   urllib.parser   urllib.requestcompatr   strr   r&    r   r   <module>r,      s:    	    c c $S $S $r   