Edit File: ntpath.cpython-37.pyc
B ����q}�cDW���������������&���@���s4��d�Z�dZdZdZdZdZdZdZdZdd l Z dd l Z dd lZdd lZdd lT�ddd ddddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/d0g&Z d1d2��Zd3d��Zd4d��Zd5d ��Zd6d��Zd7d��Zd8d��Zejj�e_�d9d��Zd:d��Zd;d��Zd<d��Zydd=lmZ�W�n�ek �r(���d ZY�nX�d>d��Zd?d��Zd@d��ZdAd ��Z dBdC��Z!yddDlm"Z"�W�n�ek �r|���e!Z#Y�n X�dEd!��Z#e#Z$e%e dF��o�e �&��dG�dHkZ'dPdId,�Z(dJd0��Z)y,e �&��d dH��dKk�r�ddLlm*Z*�ne�W�n"�e+efk �r���dMdN��Z*Y�nX�yddOlm,Z-�W�n�ek �r.���Y�nX�d S�)Qz�Common pathname manipulations, WindowsNT/95 version. Instead of importing this module directly, import os and refer to this module as os.path. �.z..�\�;�/z.;C:\binZnul�����N)�*�normcase�isabs�join� splitdrive�split�splitext�basename�dirname�commonprefix�getsize�getmtime�getatime�getctime�islink�exists�lexists�isdir�isfile�ismount� expanduser� expandvars�normpath�abspath�curdir�pardir�sep�pathsep�defpath�altsep�extsep�devnull�realpath�supports_unicode_filenames�relpath�samefile�sameopenfile�samestat� commonpathc�������������C���s���t�|�t�rdS�dS�d�S�)Ns���\/z\/)� isinstance�bytes)�path��r0����+/opt/alt/python37/lib64/python3.7/ntpath.py� _get_bothseps"���s���� r2���c���������� ���C���sx���t��|��}�y.t|�t�r&|��dd����S�|��dd����S�W�n:�ttfk rr���t|�ttf�sltd|�j j ��d���Y�nX�dS�)zaNormalize case of pathname. Makes all characters lowercase and all slashes into backslashes.����/����\r���r���z0normcase() argument must be str or bytes, not %rN)�os�fspathr-���r.����replace�lower� TypeError�AttributeError�str� __class__�__name__)�sr0���r0���r1���r���,���s���� c�������������C���s2���t��|��}�t|��d�}�t|��dko0|�d�t|��kS�)zTest whether a path is absolute����r���)r5���r6���r ����lenr2���)r>���r0���r0���r1���r���C���s���� c������� ��� ���G���sT��t��|��}�t|�t�r"d}d}d}nd}d}d}y�|sD|�d�d��|��t|��\}}x�tt�j|�D�]~}t|�\}} | r�| d�|kr�|s�|s�|}| }q^n*|r�||kr�|���|���kr�|}| }q^|}|r�|d�|kr�||�}|| �}q^W�|�r|d�|k�r|�r|dd���|k�r||�|�S�||�S��ttt fk �rN���t jd |�f|������Y�nX�d�S�) Nr4���s���\/����:r���z\/�:r������r ���)r5���r6���r-���r.���r ����mapr8���r9���r:����BytesWarning�genericpath�_check_arg_types) r/����pathsr ����seps�colonZresult_driveZresult_path�pZp_driveZp_pathr0���r0���r1���r ���K���sF���� c�������������C���s��t��|��}�t|��dk�rt|�t�r0d}d}d}nd}d}d}|��||�}|dd��|d�kr�|dd ��|kr�|�|d�}|d kr�|�dd��|�fS�|�||d��}||d�kr�|�dd��|�fS�|d kr�t|��}|�d|��|�|d��fS�|dd��|k�r|�dd��|�dd��fS�|�dd��|�fS�) a���Split a pathname into drive/UNC sharepoint and relative path specifiers. Returns a 2-tuple (drive_or_unc, path); either part may be empty. If you assign result = splitdrive(p) It is always true that: result[0] + result[1] == p If the path contained a drive letter, drive_or_unc will contain everything up to and including the colon. e.g. splitdrive("c:/dir") returns ("c:", "/dir") If the path contained a UNC path, the drive_or_unc will contain the host name and share up to but not including the fourth directory separator character. e.g. splitdrive("//host/computer/dir") returns ("//host/computer", "/dir") Paths cannot contain both a drive letter and a UNC path. ����r4���r3���rA���r���r���rB���r�������rC���Nr?���)r5���r6���r@���r-���r.���r7����find)rK���r ���r#���rJ���Znormp�indexZindex2r0���r0���r1���r ���z���s.���� $c�������������C���s|���t��|��}�t|��}t|��\}}�t|��}x |rF|�|d��|krF|d8�}q(W�|�d|��|�|d���}}|�|�pn|}||�|fS�)z~Split a pathname. Return tuple (head, tail) where tail is everything after the final slash. Either part may be empty.r?���N)r5���r6���r2���r ���r@����rstrip)rK���rI����d�i�head�tailr0���r0���r1���r�������s���� c�������������C���s8���t��|��}�t|�t�r$t�|�ddd�S�t�|�ddd�S�d�S�)Nr4���r3�������.r���r���r���)r5���r6���r-���r.���rF���� _splitext)rK���r0���r0���r1���r�������s���� c�������������C���s���t�|��d�S�)z)Returns the final component of a pathnamer?���)r���)rK���r0���r0���r1���r �������s����c�������������C���s���t�|��d�S�)z-Returns the directory component of a pathnamer���)r���)rK���r0���r0���r1���r�������s����c���������� ���C���s4���yt��|��}W�n�ttfk r&���dS�X�t�|j�S�)zhTest whether a path is a symbolic link. This will always return false for Windows prior to 6.0. F)r5����lstat�OSErrorr:����stat�S_ISLNK�st_mode)r/����str0���r0���r1���r�������s ����c�������������C���s(���yt��|��}W�n�tk r"���dS�X�dS�)zCTest whether a path exists. Returns True for broken symbolic linksFT)r5���rW���rX���)r/���r\���r0���r0���r1���r�������s ����)�_getvolumepathnamec�������������C���st���t��|��}�t|��}t|��}�t|��\}}|rD|d�|krD|�pB||kS�||krPdS�trl|��|�t|���|�kS�dS�dS�)zaTest whether a path is a mount point (a drive root, the root of a share, or a mounted volume)r���TFN)r5���r6���r2���r���r ���r]���rP���)r/���rI����root�restr0���r0���r1���r�����s���� c�������������C���s��t��|��}�t|�t�rd}nd}|��|�s,|�S�dt|���}}x$||k�r^|�|�t|��kr^|d7�}q<W�dt�jkrvt�jd�}n\dt�jkr�t�jd�}nFdt�jkr�|�S�yt�jd�}W�n�tk r����d}Y�nX�t |t�jd��}t|�t�r�t�� |�}|dk�rt t|�|�d|���}||�|d ���S�) zLExpand ~ and ~user constructs. If user or $HOME is unknown, do nothing.����~�~r?����HOMEZUSERPROFILEZHOMEPATHZ HOMEDRIVE��N)r5���r6���r-���r.���� startswithr@���r2����environ�KeyErrorr ����fsencoder���)r/����tilderR����n�userhome�driver0���r0���r1���r�����s2���� c�������������C���s<��t��|��}�t|�t�rhd|�kr(d|�kr(|�S�ddl}t|j|j�d�d�}d}d}d}d }d}tt�d d�}nFd|�kr|d|�kr||�S�ddl}|j|j�d�}d }d}d}d}d}t�j}|�dd��} d} t |��}�xn| |k��r6|�| | d���}||k�r\|�| d�d��}�t |��}y&|�� |�} | ||�d| d����7�} W�n*�tk �rV���| ||��7�} |d�} Y�nX��n�||k�rN|�| d�| d���|k�r�| |7�} | d7�} n�|�| d�d��}�t |��}y|�� |�} W�n*�tk �r����| ||��7�} |d�} Y�nhX�|�d| ��} y.|dk�rt��t�jt�� | ���}n|| �}W�n"�tk �r@���|| �|�}Y�nX�| |7�} �n�||k�r$|�| d�| d���|k�r�| |7�} | d7�} �q,|�| d�| d���|k�rb|�| d�d��}�t |��}y|�� |�} W�n.�tk �r����| ||�|��7�} |d�} Y�nlX�|�d| ��} y.|dk�r&t��t�jt�� | ���}n|| �}W�n&�tk �rV���||�| �|�}Y�nX�| |7�} n�|�dd��} | d7�} |�| | d���}x6|�r�||k�r�| |7�} | d7�} |�| | d���}�q�W�y.|dk�r�t��t�jt�� | ���}n|| �}W�n�tk �r ���|| �}Y�nX�| |7�} |�r,| d8�} n| |7�} | d7�} q�W�| S�)zfExpand shell variables of the forms $var, ${var} and %var%. Unknown variables are left unchanged.����$����%r���Nz_-�ascii����'����{����}�environb�$�%�'�{�}r?���rL���)r5���r6���r-���r.����stringZ ascii_lettersZdigits�getattrre���r@���rO���� ValueErrorrg����fsdecoderf���)r/���rx���ZvarcharsZquoteZpercentZbraceZrbraceZdollarre���ZresrO���Zpathlen�c�var�valuer0���r0���r1���r���Q��s����� c������� ������C���sT��t��|��}�t|�t�r*d}d}d}d}d}nd}d}d}d }d }|��|�rL|�S�|��||�}�t|��\}}�|��|�r�||7�}|��|�}�|��|�}d}x�|t |�k��r.||�r�||�|kr�||=�q�||�|k�r$|dkr�||d��|kr�||d�|d��=�|d8�}n&|dk�r|� |��r||=�n|d7�}q�|d7�}q�W�|�sF|�sF|�|��||�|��S�) z0Normalize path, eliminating double slashes, etc.r4���r3���rU���s���..)s���\\.\s���\\?\r���r���r���z..)z\\.\z\\?\r���r?���) r5���r6���r-���r.���rd���r7���r ����lstripr���r@����endswith�appendr ���) r/���r ���r#���r���r���Zspecial_prefixes�prefix�compsrR���r0���r0���r1���r������sF���� c�������������C���s@���t��|��}�t|��s8t|�t�r&t����}nt����}t||��}�t|��S�)z�Return the absolute version of a path as a fallback function in case `nt._getfullpathname` is not available or raises OSError. See bpo-31047 for more. ) r5���r6���r���r-���r.����getcwdb�getcwdr ���r���)r/����cwdr0���r0���r1����_abspath_fallback���s���� r����)�_getfullpathnamec���������� ���C���s.���yt�t|���S��ttfk r(���t|��S�X�dS�)z&Return the absolute version of a path.N)r���r����rX���rz���r����)r/���r0���r0���r1���r�����s�����getwindowsversionrM���rL���c�������������C���sd��t��|��}�t|�t�r"d}d}d}nd}d}d}|dkr:|}|�sFtd��t��|�}y�tt|��}tt|���}t|�\}}t|�\} } t|�t| �kr�td | |f���d d��|� |�D��}dd��| � |�D��}d } x0t ||�D�]"\}}t|�t|�kr�P�| d7�} q�W�|gt|�| ��|| d���}|�s(|S�t|��S��t ttttfk �r^���t�d|�|����Y�nX�dS�)z#Return a relative version of a pathr4���rU���s���..r���r���z..Nzno path specifiedz&path is on mount %r, start on mount %rc�������������S���s���g�|�]}|r|�qS�r0���r0���)�.0�xr0���r0���r1���� <listcomp>4��s����zrelpath.<locals>.<listcomp>c�������������S���s���g�|�]}|r|�qS�r0���r0���)r����r����r0���r0���r1���r����5��s����r���r?���r(���)r5���r6���r-���r.���rz���r���r���r ���r���r����zipr@���r ���r9���r:���rE����DeprecationWarningrF���rG���)r/����startr ���r���r���Z start_absZpath_absZstart_driveZ start_restZ path_driveZ path_rest� start_list� path_listrR���Ze1Ze2�rel_listr0���r0���r1���r(�����sF���� c���������� ������s���|�st�d��tttj|���}�t|�d�t�r8d�d��d�nd�d��d��y>���fd d �|�D��}�fdd �|D��}yt�fdd �|D���\}W�n�t�k r����t�d�d�Y�nX�ttdd ��|D����dkr�t�d��t |�d�� �����\}}|���}�fdd �|D��}�fdd �|D��}t|�}t |�}xBt|�D�]&\} } | || �k�r,|d| ��}P��q,W�|dt|���}|�rt|��n|}|��|��S��ttfk �r����tjd|�������Y�nX�dS�)zDGiven a sequence of path names, returns the longest common sub-path.z%commonpath() arg is an empty sequencer���r4���r3���rU���r���r���r���c����������������s ���g�|�]}t�|����������qS�r0���)r ���r7���r8���)r����rK���)r#���r ���r0���r1���r����a��s����zcommonpath.<locals>.<listcomp>c����������������s���g�|�]\}}|������qS�r0���)r���)r����rQ���rK���)r ���r0���r1���r����b��s����c�������������3���s"���|�]\}}|d�d����kV��qd�S�)Nr?���r0���)r����rQ���rK���)r ���r0���r1���� <genexpr>e��s����zcommonpath.<locals>.<genexpr>z%Can't mix absolute and relative pathsNc�������������s���s���|�]\}}|V��qd�S�)Nr0���)r����rQ���rK���r0���r0���r1���r����l��s����r?���zPaths don't have the same drivec����������������s���g�|�]}|r|��kr|�qS�r0���r0���)r����r|���)r���r0���r1���r����q��s����c����������������s���g�|�]}��fd�d�|D���qS�)c����������������s���g�|�]}|r|��kr|�qS�r0���r0���)r����r|���)r���r0���r1���r����s��s����z)commonpath.<locals>.<listcomp>.<listcomp>r0���)r����r>���)r���r0���r1���r����s��s����r,���)r,���)rz����tuplerD���r5���r6���r-���r.����setr@���r ���r7���r����min�max� enumerater ���r9���r:���rF���rG���)rH���Zdrivesplits�split_pathsr���rk���r/����common�s1�s2rR���r|���r����r0���)r#���r���r ���r1���r,���P��sF���� )����r���)�_getfinalpathnamec�������������C���s���t�t|���S�)N)r���r���)�fr0���r0���r1���r�������s����r����)�_isdir)N).�__doc__r���r���r$���r ���r!���r#���r"���r%���r5����sysrY���rF����__all__r2���r���r���r ���r ���r���r���rV���r ���r���r���r����ntr]����ImportErrorr���r���r���r���r����r����r���r&����hasattrr����r'���r(���r,���r����r:���r����r���r0���r0���r0���r1����<module>���sz��� /8 2q1 85