OwlCyberSecurity - MANAGER
Edit File: ntpath.cpython-36.pyc
3 � \6Z���������������'���@���s>��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/d0d1g'Z d2d3��Zd4d��Zd5d��Zd6d ��Zd7d��Zd8d"��Zd9d��Zd:d��Zejj�e_�d;d��Zd<d��Zd=d��Zd>d��Zydd?lmZ�W�n�ek �r2���d ZY�nX�d@d��ZdAd��ZdBd��Z dCd ��Z!dDdE��Z"yddFlm#Z#�W�n�ek �r����e"Z$Y�n X�dGd!��Z$e$Z%e&e dH��o�e j'��dI�dJkZ(dRdKd-�Z)dLd1��Z*y,e j'��d dJ��dSk�r�ddNlm+Z+�ne�W�n"�e,efk �r���dOdP��Z+Y�nX�yddQlm-Z.�W�n�ek �r8���Y�nX�d S�)Tz�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�splitunc�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��r1����/usr/lib64/python3.6/ntpath.py� _get_bothseps"���s���� r3���c�������������C���sx���t�j|��}�y.t|�t�r&|�jdd�j��S�|�jdd�j��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__)�sr1���r1���r2���r���,���s���� c�������������C���s2���t�j|��}�t|��d�}�t|��dko0|�d�t|��kS�)zTest whether a path is absolute����r���)r6���r7���r ����lenr3���)r?���r1���r1���r2���r���C���s���� c������� ��� ���G���sV��t�j|��}�t|�t�r"d}d}d}nd}d}d}y�|sD|�d�d��|��t|��\}}x�tt�j|�D�]�}t|�\}} | r�| d�|kr�|s�|�r�|}| }q^n*|r�||kr�|j��|j��kr�|}| }q^|}|r�|d �|kr�||�}|| �}q^W�|�r|d�|k�r|�r|dd���|k�r||�|�S�||�S��ttt fk �rP���t jd |�f|������Y�nX�d�S�)Nr5���s���\/����:r���z\/�:r���r@���r ������rD���)r6���r7���r.���r/���r ����mapr9���r:���r;����BytesWarning�genericpath�_check_arg_types) r0����pathsr!����seps�colonZresult_driveZresult_path�pZp_driveZp_pathr1���r1���r2���r ���K���sF���� c�������������C���s��t�j|��}�t|��dk�rt|�t�r0d}d}d}nd}d}d}|�j||�}|dd��|d�kr�|dd ��|kr�|j|d�}|dkr�|�dd��|�fS�|j||d ��}||d �kr�|�dd��|�fS�|d kr�t|��}|�d|��|�|d��fS�|d d��|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. ����r5���r4���rB���r���r���rC���r�������r@���NrD���rD���)r6���r7���rA���r.���r/���r8����find)rL���r!���r$���rK���Znormp�indexZindex2r1���r1���r2���r ���z���s.���� $c�������������C���sF���ddl�}|jdtd��t|��\}}t|�dkr>|�dd��|�fS�||fS�)a���Deprecated since Python 3.1. Please use splitdrive() instead; it now handles UNC paths. Split a pathname into UNC mount point and relative path specifiers. Return a 2-tuple (unc, rest); either part may be empty. If unc is not empty, it has the form '//host/mount' (or similar using backslashes). unc+rest is always the input path. Paths containing drive letters never have a UNC part. r���Nz<ntpath.splitunc is deprecated, use ntpath.splitdrive insteadrM���)�warnings�warn�DeprecationWarningr ���rA���)rL���rQ����driver0���r1���r1���r2���r�������s����c�������������C���s|���t�j|��}�t|��}t|��\}}�t|��}x |rF|�|d��|krF|d8�}q(W�|�d|��|�|d���}}|j|�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)r6���r7���r3���r ���rA����rstrip)rL���rJ����d�i�head�tailr1���r1���r2���r�������s���� c�������������C���s8���t�j|��}�t|�t�r$tj|�ddd�S�tj|�ddd�S�d�S�)Nr5���r4�������.r���r���r���)r6���r7���r.���r/���rG���� _splitext)rL���r1���r1���r2���r�������s���� c�������������C���s���t�|��d�S�)z)Returns the final component of a pathnamer@���)r���)rL���r1���r1���r2���r �������s����c�������������C���s���t�|��d�S�)z-Returns the directory component of a pathnamer���)r���)rL���r1���r1���r2���r�������s����c�������������C���s4���yt�j|��}W�n�ttfk r&���dS�X�tj|j�S�)zhTest whether a path is a symbolic link. This will always return false for Windows prior to 6.0. F)r6����lstat�OSErrorr;����stat�S_ISLNK�st_mode)r0����str1���r1���r2���r�������s ����c�������������C���s(���yt�j|��}W�n�tk r"���dS�X�dS�)zCTest whether a path exists. Returns True for broken symbolic linksFT)r6���r\���r]���)r0���ra���r1���r1���r2���r�����s ����)�_getvolumepathnamec�������������C���st���t�j|��}�t|��}t|��}�t|��\}}|rD|d�|krD|�pB||kS�||krPdS�trl|�j|�t|��j|�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)r6���r7���r3���r���r ���rb���rU���)r0���rJ����root�restr1���r1���r2���r�����s���� c���������� ���C���s��t�j|��}�t|�t�rd}nd}|�j|�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�j |�}|dk�rt t|�|�d|���}||�|d ���S�) zLExpand ~ and ~user constructs. If user or $HOME is unknown, do nothing.����~�~r@����HOMEZUSERPROFILEZHOMEPATHZ HOMEDRIVE��N)r6���r7���r.���r/���� startswithrA���r3����environ�KeyErrorr ����fsencoder���)r0����tilderW����n�userhomerT���r1���r1���r2���r���5��s2���� c�������������C���s<��t�j|��}�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&|�j |�} | ||�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|�j |�} W�n*�tk �r����| ||��7�} |d�} Y�nhX�|�d| ��} y.|dk�rt�jt�jt�j | ���}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|�j |�} W�n.�tk �r����| ||�|��7�} |d�} Y�nlX�|�d| ��} y.|dk�r&t�jt�jt�j | ���}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�jt�jt�j | ���}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@���rM���)r6���r7���r.���r/����stringZ ascii_lettersZdigits�getattrrj���rA���rP���� ValueErrorrl����fsdecoderk���)r0���r|���ZvarcharsZquoteZpercentZbraceZrbraceZdollarrj����resrP���Zpathlen�c�var�valuer1���r1���r2���r���g��s����� c������� ������C���s\��t�j|��}�t|�t�r*d}d}d}d}d}nd}d}d }d }d}|�j|�rL|�S�|�j||�}�t|��\}}�|�j|�r�||7�}|�j|�}�|�j|�}d }x�|t |�k��r2||��s�||�|kr�||=�q�||�|k�r(|d ko�||d��|k�r�||d�|d��=�|d8�}n&|d k�r|j |��r||=�n|d7�}q�|d7�}q�W�|��rN|��rN|j|��||j|��S�)z0Normalize path, eliminating double slashes, etc.r5���r4���rZ���s���..����\\.\����\\?\r���r���r���z..�\\.\�\\?\r���r@���)r����r����)r����r����) r6���r7���r.���r/���ri���r8���r ����lstripr���rA����endswith�appendr ���) r0���r!���r$���r���r ���Zspecial_prefixes�prefix�compsrW���r1���r1���r2���r������sF���� c�������������C���s@���t�j|��}�t|��s8t|�t�r&t�j��}nt�j��}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. ) r6���r7���r���r.���r/����getcwdb�getcwdr ���r���)r0����cwdr1���r1���r2����_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����r]���r~���r����)r0���r1���r1���r2���r���!��s�����getwindowsversionrN���rM���c�������������C���sd��t�j|��}�t|�t�r"d}d}d}nd}d}d}|dkr:|}|�sFtd��t�j|�}y�tt|��}tt|���}t|�\}}t|�\} } t|�t| �kr�td | |f���d d��|j |�D��}dd��| j |�D��}d } x0t ||�D�]"\}}t|�t|�kr�P�| d7�} q�W�|gt|�| ��|| d���}|�s(|S�t|��S��t ttttfk �r^���tjd|�|����Y�nX�dS�)z#Return a relative version of a pathr5���rZ���s���..r���r���z..Nzno path specifiedz&path is on mount %r, start on mount %rc�������������S���s���g�|�]}|r|�qS�r1���r1���)�.0�xr1���r1���r2���� <listcomp>J��s����zrelpath.<locals>.<listcomp>c�������������S���s���g�|�]}|r|�qS�r1���r1���)r����r����r1���r1���r2���r����K��s����r���r@���r)���)r6���r7���r.���r/���r~���r���r���r ���r���r����ziprA���r ���r:���r;���rF���rS���rG���rH���)r0����startr!���r���r ���Z start_absZpath_absZstart_driveZ start_restZ path_driveZ path_rest� start_list� path_listrW���Ze1Ze2�rel_listr1���r1���r2���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�j �����\}}|j��}�fdd �|D��}�fdd �|D��}t|�}t |�}xBt|�D�]&\} } | || �k�r,|d| ��}P��q,W�|dt|���}|�rt|��n|}|�j|��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���r5���r4���rZ���r���r���r���c����������������s ���g�|�]}t�|j����j����qS�r1���)r ���r8���r9���)r����rL���)r$���r!���r1���r2���r����w��s����zcommonpath.<locals>.<listcomp>c����������������s���g�|�]\}}|j�����qS�r1���)r���)r����rV���rL���)r!���r1���r2���r����x��s����c�������������3���s"���|�]\}}|d�d����kV��qd�S�)Nr@���r1���)r����rV���rL���)r!���r1���r2���� <genexpr>{��s����zcommonpath.<locals>.<genexpr>z%Can't mix absolute and relative pathsNc�������������s���s���|�]\}}|V��qd�S�)Nr1���)r����rV���rL���r1���r1���r2���r�������s����r@���zPaths don't have the same drivec����������������s���g�|�]}|r|��kr|�qS�r1���r1���)r����r����)r���r1���r2���r�������s����c����������������s���g�|�]}��fd�d�|D���qS�)c����������������s���g�|�]}|r|��kr|�qS�r1���r1���)r����r����)r���r1���r2���r�������s����z)commonpath.<locals>.<listcomp>.<listcomp>r1���)r����r?���)r���r1���r2���r�������s����r-���)r-���)r~����tuplerE���r6���r7���r.���r/����setrA���r ���r8���r����min�max� enumerater ���r:���r;���rG���rH���)rI���Zdrivesplits�split_pathsr���rT���r0����common�s1�s2rW���r����r����r1���)r$���r���r!���r2���r-���f��sF���� ����)�_getfinalpathnamec�������������C���s���t�t|���S�)N)r���r���)�fr1���r1���r2���r�������s����r����)�_isdir)N)r����r���)/�__doc__r���r ���r%���r!���r"���r$���r#���r&���r6����sysr^���rG����__all__r3���r���r���r ���r ���r���r���r���r[���r ���r���r���r����ntrb����ImportErrorr���r���r���r���r����r����r���r'����hasattrr����r(���r)���r-���r����r;���r����r���r1���r1���r1���r2����<module>���s|��� /4 2q1 85