Your IP : 216.73.217.13


Current Path : /snap/core/17292/usr/lib/python3.5/__pycache__/
Upload File :
Current File : //snap/core/17292/usr/lib/python3.5/__pycache__/ntpath.cpython-35.pyc



E�i�Q�'@s$dZddlZddlZddlZddlZddlTdddddd	d
ddd
ddddddddddddddddddd d!d"d#d$d%d&d'd(d)d*g'Zd+Zd,Zd+Zd-Z	d.Z
d/Zd0Zd1ej
kr�d2Zd3Zd4d5�Zd6d�Zd7d�Zd8d�Zd9d�Zd:d�Zd;d�Zd<d	�Zejje_d=d
�Zd>d�Zd?d�Zd@d�ZyddAlmZWnek
r�dZYnXdBd�ZdCd�Z dDZ!da"da#dEd�Z$dFd�Z%yddGlm&Z&Wnek
rDdHd�Z'Yn
XdId�Z'e'Z(e)edJ�oyej*�dKdLkZ+ddMd&�Z,dNd*�Z-y9ej*�ddL�dTkr�ddPlm.Z.ne�Wn$e/efk
r�dQdR�Z.YnXyddSlm0Z1Wnek
rYnXdS)Uz�Common pathname manipulations, WindowsNT/95 version.

Instead of importing this module directly, import os and refer to this
module as os.path.
�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�
commonpath�.z..�\�;�/z.;C:\binZcez\WindowsZnulcCst|t�rdSdSdS)Ns\/z\/)�
isinstance�bytes)�path�r1�/usr/lib/python3.5/ntpath.py�
_get_bothseps#sr3cCs�y?t|t�r(|jdd�j�S|jdd�j�SWnIttfk
r�t|ttf�s�td|jj�d��YnXdS)zaNormalize case of pathname.

    Makes all characters lowercase and all slashes into backslashes.�/s\r-r+z0normcase() argument must be str or bytes, not %rN)	r.r/�replace�lower�	TypeError�AttributeError�str�	__class__�__name__)�sr1r1r2r-scCs6t|�d}t|�dko5|dt|�kS)zTest whether a path is absolute�r)r�lenr3)r<r1r1r2rCsc

Gs�t|t�r$d}d}d}nd}d}d}y5|sQ|dd�|t|�\}}x�|D]�}t|�\}}	|	r�|	d|kr�|s�|r�|}|	}qjn?|r�||kr�|j�|j�kr�|}|	}qj|}|r|d
|kr||}||	}qjW|rb|d|krb|rb|dd�|krb|||S||SWn1tttfk
r�tjd	||��YnXdS)Ns\s\/�:r+z\/�:rr=r���rA)	r.r/rr6r7r8�BytesWarning�genericpath�_check_arg_types)
r0�pathsr�seps�colonZresult_driveZresult_path�pZp_driveZp_pathr1r1r2rJsD	


cCstt|�dkr`t|t�r6d}d}d}nd}d}d}|j||�}|dd�|dkr,|dd	�|kr,|j|d�}|dkr�|dd�|fS|j||d
�}||d
kr�|dd�|fS|d
krt|�}|d|�||d�fS|d
d�|kr`|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.

    �s\r4r?r+r-r@r�r=NrArA)r>r.r/r5�find)rHrr rGZnormp�indexZindex2r1r1r2rxs,	0cCsaddl}|jdtd�t|�\}}t|�dkrW|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.
    rNz<ntpath.splitunc is deprecated, use ntpath.splitdrive insteadrI)�warnings�warn�DeprecationWarningrr>)rHrM�driver0r1r1r2r�s	
cCs�t|�}t|�\}}t|�}x(|rT||d|krT|d8}q-W|d|�||d�}}|j|�p�|}|||fS)z~Split a pathname.

    Return tuple (head, tail) where tail is everything after the final slash.
    Either part may be empty.r=N)r3rr>�rstrip)rHrF�d�i�head�tailr1r1r2r�s!cCs?t|t�r%tj|ddd�Stj|ddd�SdS)Ns\r4�.r+r-r*)r.r/rC�	_splitext)rHr1r1r2r�scCst|�dS)z)Returns the final component of a pathnamer=)r)rHr1r1r2r	�scCst|�dS)z-Returns the directory component of a pathnamer)r)rHr1r1r2r
�scCsBytj|�}Wnttfk
r1dSYnXtj|j�S)zhTest whether a path is a symbolic link.
    This will always return false for Windows prior to 6.0.
    F)�os�lstat�OSErrorr8�stat�S_ISLNK�st_mode)r0�str1r1r2r�s
	cCs0ytj|�}Wntk
r+dSYnXdS)zCTest whether a path exists.  Returns True for broken symbolic linksFT)rXrYrZ)r0r^r1r1r2rs

	)�_getvolumepathnamecCs�t|�}t|�}t|�\}}|rQ|d|krQ|pP||kS||kradStr�|j|�t|�j|�kSdSdS)zaTest whether a path is a mount point (a drive root, the root of a
    share, or a mounted volume)rTFN)r3rrr_rQ)r0rF�root�restr1r1r2rs"c
Cset|t�rd}nd}|j|�s1|Sdt|�}}x0||krv||t|�krv|d7}qGWdtjkr�tjd}ntdtjkr�tjd}nUdtjkr�|Sytjd}Wntk
r�d}YnXt|tjd�}t|t�r(tj	|�}|dkrStt
|�|d|��}|||d	�S)
zLExpand ~ and ~user constructs.

    If user or $HOME is unknown, do nothing.�~�~r=�HOMEZUSERPROFILEZHOMEPATHZ	HOMEDRIVE�N)r.r/�
startswithr>r3rX�environ�KeyErrorr�fsencoder
)r0�tilderS�n�userhomerPr1r1r2r0s0	%
z.'[^']*'?|%(%|[^%]*%?)|\$(\$|[-\w]+|\{[^}]*\}?)cs&t|t�r�d|kr+d|kr+|Sts[ddl}|jtj�|j�jat}d�d�d�d�t	t
dd��nmd|kr�d	|kr�|Sts�ddl}|jt|j�jat}d	�d
�d�d�t
j������fdd
�}|||�S)zfExpand shell variables of the forms $var, ${var} and %var%.

    Unknown variables are left unchanged.�$�%rN�{�}�environb�$�%�{�}cs"|j}|dkr"|jd�S|j|�}|dkr||�krM|S|j��si|jd�S|dd�}nK|�kr�|S|j��r�|j��s�|jd�S|dd�}y5�dkr�tjtjtj|��S�|SWntk
r|jd�SYnXdS)Nrr=rArA)	�	lastindex�group�endswithrfrXrirg�fsdecoderh)�mrv�name)�brace�dollarrg�percent�rbracer1r2�repl�s,	



zexpandvars.<locals>.repl)
r.r/�_varsubb�re�compile�_varpattern�encode�ASCII�sub�getattrrX�_varsubrg)r0r�r�r�r1)r|r}rgr~rr2res2	c	Cs�t|t�r0d}d}d}d}d}nd}d}d	}d
}d}|j|�ra|S|j||�}t|�\}}|j|�r�||7}|j|�}|j|�}d
}x�|t|�kr�||s�|||kr�||=q�|||kr�|d
krN||d|krN||d|d�=|d8}q�|d
krs|j|�rs||=q�|d7}q�|d7}q�W|r�|r�|j	|�||j
|�S)z0Normalize path, eliminating double slashes, etc.s\r4rVs..�\\.\�\\?\r+r-r*z..�\\.\�\\?\rr=)r�r�)r�r�)r.r/rfr5r�lstriprr>rx�appendr)	r0rr rrZspecial_prefixes�prefix�compsrSr1r1r2r�sD	

 



)�_getfullpathnamecCsOt|�sEt|t�r*tj�}ntj�}t||�}t|�S)z&Return the absolute version of a path.)rr.r/rX�getcwdb�getcwdrr)r0�cwdr1r1r2r�scCsb|r.yt|�}WqXtk
r*YqXXn*t|t�rLtj�}ntj�}t|�S)z&Return the absolute version of a path.)r�rZr.r/rXr�r�r)r0r1r1r2r�s
�getwindowsversionrJrIcCs�t|t�r$d}d}d}nd}d}d}|dkrH|}|sZtd��y4tt|��}tt|��}t|�\}}t|�\}	}
t|�t|	�kr�td	|	|f��d
d�|j|�D�}dd�|
j|�D�}d
}
x@t||�D]/\}}t|�t|�krFP|
d7}
q!W|gt	|�|
||
d�}|s�|St
|�SWn7tttt
tfk
r�tjd||��YnXdS)z#Return a relative version of a paths\rVs..r+r*z..Nzno path specifiedz&path is on mount %r, start on mount %rcSsg|]}|r|�qSr1r1)�.0�xr1r1r2�
<listcomp>s	zrelpath.<locals>.<listcomp>cSsg|]}|r|�qSr1r1)r�r�r1r1r2r�s	rr=r%)r.r/�
ValueErrorrrrrr�zipr>rr7r8rBrOrCrD)r0�startrrrZ	start_absZpath_absZstart_driveZ
start_restZ
path_driveZ	path_rest�
start_list�	path_listrSZe1Ze2�rel_listr1r1r2r%�sB	%cs(|std��t|dt�r:d�d�d�nd�d�d�y���fd	d
�|D�}�fdd
�|D�}y&t�fdd
�|D��\}Wn!tk
r�td�d�YnXttdd
�|D���dkr�td��t|dj����\}}|j��}�fdd
�|D�}�fdd
�|D�}t|�}t	|�}xQt
|�D]-\}	}
|
||	kr�|d|	�}Pq�W|dt|��}|r�|�n|}|�j|�SWn+tt
fk
r#tjd|��YnXdS)zDGiven a sequence of path names, returns the longest common sub-path.z%commonpath() arg is an empty sequencers\r4rVr+r-r*cs.g|]$}t|j���j���qSr1)rr5r6)r�rH)r rr1r2r�@s	zcommonpath.<locals>.<listcomp>cs%g|]\}}|j���qSr1)r)r�rRrH)rr1r2r�As	c3s+|]!\}}|dd��kVqdS)Nr=r1)r�rRrH)rr1r2�	<genexpr>Dszcommonpath.<locals>.<genexpr>z%Can't mix absolute and relative pathsNcss|]\}}|VqdS)Nr1)r�rRrHr1r1r2r�Ksr=zPaths don't have the same drivecs(g|]}|r|�kr|�qSr1r1)r��c)rr1r2r�Ps	cs)g|]}�fdd�|D��qS)cs(g|]}|r|�kr|�qSr1r1)r�r�)rr1r2r�Rs	z)commonpath.<locals>.<listcomp>.<listcomp>r1)r�r<)rr1r2r�Rs	r))r�r.r/�setr>rr5r�min�max�	enumeraterr7r8rCrD)rEZdrivesplits�split_pathsrrPr0�common�s1�s2rSr�r�r1)r rrr2r)0sD	&
%"�)�_getfinalpathnamecCstt|��S)N)rr)�fr1r1r2r�psr�)�_isdir)r�r)2�__doc__rX�sysr[rC�__all__rrr!rrr r�builtin_module_namesr"r3rrrrrrrrWr	r
rr�ntr_�ImportErrorrrr�r�r�rrr�rr#�hasattrr�r$r%r)r�r8r�rr1r1r1r2�<module>s�

.3
1@2
64