ok

Mini Shell

Direktori : /proc/self/root/opt/alt/python37/lib64/python3.7/__pycache__/
Upload File :
Current File : //proc/self/root/opt/alt/python37/lib64/python3.7/__pycache__/ntpath.cpython-37.pyc

B

�x�cDW�&@s4dZdZdZdZdZdZdZdZdZdd	l	Z	dd	l
Z
dd	lZdd	lZdd
lTddd
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�Zejje_d9d�Zd:d�Zd;d�Zd<d�Zydd=lmZWnek
�r(d	ZYnXd>d�Zd?d�Zd@d�ZdAd �Z dBdC�Z!yddDlm"Z"Wnek
�r|e!Z#Yn
XdEd!�Z#e#Z$e%e
dF��o�e
�&�dGdHkZ'dPdId,�Z(dJd0�Z)y,e
�&�d	dH�dKk�r�ddLlm*Z*ne�Wn"e+efk
�rdMdN�Z*YnXyddOlm,Z-Wnek
�r.YnXd	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�
commonpathcCst|t�rdSdSdS)Ns\/z\/)�
isinstance�bytes)�path�r0�+/opt/alt/python37/lib64/python3.7/ntpath.py�
_get_bothseps"s
r2c	Csxt�|�}y.t|t�r&|�dd���S|�dd���SWn:ttfk
rrt|ttf�sltd|j	j
�d��YnXdS)zaNormalize case of pathname.

    Makes all characters lowercase and all slashes into backslashes.�/�\rrz0normcase() argument must be str or bytes, not %rN)�os�fspathr-r.�replace�lower�	TypeError�AttributeError�str�	__class__�__name__)�sr0r0r1r,s

cCs2t�|�}t|�d}t|�dko0|dt|�kS)zTest whether a path is absolute�r)r5r6r
�lenr2)r>r0r0r1rCs
c

GsTt�|�}t|t�r"d}d}d}nd}d}d}y�|sD|dd�|t|�\}}x�ttj|�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||Sttt	fk
�rNt
jd	|f|���YnXdS)
Nr4s\/�:rz\/�:r���r	)r5r6r-r.r
�mapr8r9r:�BytesWarning�genericpath�_check_arg_types)
r/�pathsr �seps�colonZresult_driveZresult_path�pZp_driveZp_pathr0r0r1r	KsF

cCst�|�}t|�dk�rt|t�r0d}d}d}nd}d}d}|�||�}|dd�|dkr�|dd	�|kr�|�|d�}|d
kr�|dd�|fS|�||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.

    �r4r3rArrrBr�rCNr?)r5r6r@r-r.r7�find)rKr r#rJZnormp�indexZindex2r0r0r1r
zs.

$cCs|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)r5r6r2r
r@�rstrip)rKrI�d�i�head�tailr0r0r1r�s
cCs8t�|�}t|t�r$t�|ddd�St�|ddd�SdS)Nr4r3�.rrr)r5r6r-r.rF�	_splitext)rKr0r0r1r�s

cCst|�dS)z)Returns the final component of a pathnamer?)r)rKr0r0r1r
�scCst|�dS)z-Returns the directory component of a pathnamer)r)rKr0r0r1r�sc	Cs4yt�|�}Wnttfk
r&dSXt�|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/�str0r0r1r�s
cCs(yt�|�}Wntk
r"dSXdS)zCTest whether a path exists.  Returns True for broken symbolic linksFT)r5rWrX)r/r\r0r0r1r�s
)�_getvolumepathnamecCstt�|�}t|�}t|�}t|�\}}|rD|d|krD|pB||kS||krPdStrl|�|�t|��|�kSdSdS)zaTest whether a path is a mount point (a drive root, the root of a
    share, or a mounted volume)rTFN)r5r6r2rr
r]rP)r/rI�root�restr0r0r1rs
cCst�|�}t|t�rd}nd}|�|�s,|Sdt|�}}x$||kr^||t|�kr^|d7}q<Wdtjkrvtjd}n\dtjkr�tjd}nFdtjkr�|Sytjd}Wntk
r�d}YnXt	|tjd�}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)r5r6r-r.�
startswithr@r2�environ�KeyErrorr	�fsencoder)r/�tilderR�n�userhome�driver0r0r1rs2









cCs<t�|�}t|t�rhd|kr(d|kr(|Sddl}t|j|jdd�}d}d}d}d	}d}ttd
d�}nFd|kr|d|kr||Sddl}|j|jd}d
}d}d}d}d}tj}|dd�}	d}
t	|�}�xn|
|k�r6||
|
d�}||k�r\||
dd�}t	|�}y&|�
|�}
|	||d|
d�7}	Wn*tk
�rV|	||7}	|d}
YnX�n�||k�rN||
d|
d�|k�r�|	|7}	|
d7}
n�||
dd�}t	|�}y|�
|�}
Wn*tk
�r�|	||7}	|d}
YnhX|d|
�}
y.|dk�rt�tjt�
|
��}n||
}Wn"tk
�r@||
|}YnX|	|7}	�n�||k�r$||
d|
d�|k�r�|	|7}	|
d7}
�q,||
d|
d�|k�rb||
dd�}t	|�}y|�
|�}
Wn.tk
�r�|	|||7}	|d}
YnlX|d|
�}
y.|dk�r&t�tjt�
|
��}n||
}Wn&tk
�rV|||
|}YnX|	|7}	n�|dd�}
|
d7}
||
|
d�}x6|�r�||k�r�|
|7}
|
d7}
||
|
d�}�q�Wy.|dk�r�t�tjt�
|
��}n||
}Wntk
�r
||
}YnX|	|7}	|�r,|
d8}
n|	|7}	|
d7}
q�W|	S)zfExpand shell variables of the forms $var, ${var} and %var%.

    Unknown variables are left unchanged.�$�%rNz_-�ascii�'�{�}�environb�$�%�'�{�}r?rL)r5r6r-r.�stringZ
ascii_lettersZdigits�getattrrer@rO�
ValueErrorrg�fsdecoderf)r/rxZvarcharsZquoteZpercentZbraceZrbraceZdollarreZresrOZpathlen�c�var�valuer0r0r1rQs�











c	CsTt�|�}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�=|d8}n&|dk�r|�
|��r||=n|d7}q�|d7}q�W|�sF|�sF|�|�||�|�S)
z0Normalize path, eliminating double slashes, etc.r4r3rUs..)s\\.\s\\?\rrrz..)z\\.\z\\?\rr?)
r5r6r-r.rdr7r
�lstriprr@�endswith�appendr	)	r/r r#rrZspecial_prefixes�prefix�compsrRr0r0r1r�sF








cCs@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.

    )	r5r6rr-r.�getcwdb�getcwdr	r)r/�cwdr0r0r1�_abspath_fallback�s



r�)�_getfullpathnamec	Cs.ytt|��Sttfk
r(t|�SXdS)z&Return the absolute version of a path.N)rr�rXrzr�)r/r0r0r1rs�getwindowsversionrMrLcCsdt�|�}t|t�r"d}d}d}nd}d}d}|dkr:|}|sFtd��t�|�}y�tt|��}tt|��}t|�\}}t|�\}	}
t|�t|	�kr�td	|	|f��d
d�|�	|�D�}dd�|
�	|�D�}d
}
x0t
||�D]"\}}t|�t|�kr�P|
d7}
q�W|gt|�|
||
d�}|�s(|St|�St
ttttfk
�r^t�d||��YnXdS)z#Return a relative version of a pathr4rUs..rrz..Nzno path specifiedz&path is on mount %r, start on mount %rcSsg|]}|r|�qSr0r0)�.0�xr0r0r1�
<listcomp>4szrelpath.<locals>.<listcomp>cSsg|]}|r|�qSr0r0)r�r�r0r0r1r�5srr?r()r5r6r-r.rzrrr
rr�zipr@r	r9r:rE�DeprecationWarningrFrG)r/�startr rrZ	start_absZpath_absZstart_driveZ
start_restZ
path_driveZ	path_rest�
start_list�	path_listrRZe1Ze2�rel_listr0r0r1r(sF


c	s�|std��tttj|��}t|dt�r8d�d�d�nd�d�d��y>��fd	d
�|D�}�fdd
�|D�}yt�fdd
�|D��\}Wntk
r�td�d�YnXttdd
�|D���dkr�td��t	|d�
����\}}|���}�fdd
�|D�}�fdd
�|D�}t|�}t
|�}xBt|�D]&\}	}
|
||	k�r,|d|	�}P�q,W|dt|��}|�rt|�n|}|��|�Sttfk
�r�tjd|���YnXdS)zDGiven a sequence of path names, returns the longest common sub-path.z%commonpath() arg is an empty sequencerr4r3rUrrrcs g|]}t|��������qSr0)r
r7r8)r�rK)r#r r0r1r�aszcommonpath.<locals>.<listcomp>csg|]\}}|����qSr0)r)r�rQrK)r r0r1r�bsc3s"|]\}}|dd��kVqdS)Nr?r0)r�rQrK)r r0r1�	<genexpr>eszcommonpath.<locals>.<genexpr>z%Can't mix absolute and relative pathsNcss|]\}}|VqdS)Nr0)r�rQrKr0r0r1r�lsr?zPaths don't have the same drivecsg|]}|r|�kr|�qSr0r0)r�r|)rr0r1r�qscsg|]}�fdd�|D��qS)csg|]}|r|�kr|�qSr0r0)r�r|)rr0r1r�ssz)commonpath.<locals>.<listcomp>.<listcomp>r0)r�r>)rr0r1r�ssr,)r,)rz�tuplerDr5r6r-r.�setr@r
r7r�min�max�	enumerater	r9r:rFrG)rHZdrivesplits�split_pathsrrkr/�common�s1�s2rRr|r�r0)r#rr r1r,PsF
)�r)�_getfinalpathnamecCstt|��S)N)rr)�fr0r0r1r��sr�)�_isdir)N).�__doc__rrr$r r!r#r"r%r5�sysrYrF�__all__r2rrr	r
rrrVr
rrr�ntr]�ImportErrorrrrrr�r�rr&�hasattrr�r'r(r,r�r:r�rr0r0r0r1�<module>sz



/8

2q1

85

Zerion Mini Shell 1.0