
    ob                     |    d dl Z d dlZd dlZd dlZe j                  rd dl mZ  ej                         dk(  Zd Zd Z	y)    N)TextWindowsc                    t         rt        |       r}| j                  dd      \  }}t        j                  r|j                  d      }t        j                  j                  j                  j                  |      }dj                  ||      } | S t        j                  r| j                  d      } t        j                  j                  j                  j                  |       } | S )a0  Quote a URL without quoting the Windows drive letter, if any.

    On Windows, it will separate drive letter and quote Windows
    path alone. No magic on Unix-like path, just pythonic
    `~urllib.request.pathname2url`.

    Arguments:
       path_snippet (str): a file path, relative or absolute.

    :   zutf-8z{}:{})_WINDOWS_PLATFORM_has_drive_lettersplitsixPY2encodemovesurllibrequestpathname2urlformat)path_snippetdrive_letterpaths      //usr/lib/python3/dist-packages/fs/_url_tools.py	url_quoter      s     .|<)//Q7d77;;w'Dyy''44T:~~lD9
  77'..w7Lyy''//<<\J    c                 6    d}t        j                  ||       duS )aC  Check whether a path contains a drive letter.

    Arguments:
       path_snippet (str): a file path, relative or absolute.

    Example:
        >>> _has_drive_letter("D:/Data")
        True
        >>> _has_drive_letter(r"C:\System32\ test")
        True
        >>> _has_drive_letter("/tmp/abc:test")
        False

    z
.:[/\\].*$N)rematch)r   windows_drive_patterns     r   r	   r	   &   s!      +88)<8DDr   )
typingplatformr   r   TYPE_CHECKINGr   systemr   r   r	    r   r   <module>r"      s<      	 
	#HOO%2 2Er   