ok

Mini Shell

Direktori : /opt/alt/python35/lib64/python3.5/__pycache__/
Upload File :
Current File : //opt/alt/python35/lib64/python3.5/__pycache__/ntpath.cpython-35.opt-1.pyc



L�Ma	Y�'@sdZddlZddlZddlZddlZddlTdddddd	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 dDd�Z!dEd�Z"yddFlm#Z#Wnek
r2dGd�Z$Yn
XdHd�Z$e$Z%e&edI�ogej'�dJdKkZ(ddLd&�Z)dMd*�Z*y9ej'�ddK�dSkr�ddOlm+Z+ne�Wn$e,efk
r�dPdQ�Z+YnXyddRlm-Z.Wnek
r
YnXdS)Tz�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�+/opt/alt/python35/lib64/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	%
cCst|t�r�d|kr+d|kr+|Sddl}t|j|jdd�}d}d}d}d	}d}ttd
d�}ncd|kr�d|kr�|Sddl}|j|jd}d
}d}d}d}d}tj}|dd�}	d}
t|�}x
|
|kr||
|
d�}||kr�||
dd�}t|�}y/|j	|�}
|	||d|
d�7}	Wqt
k
r�|	||7}	|d}
YqXnQ||kr�||
d|
d�|kr�|	|7}	|
d7}
q||
dd�}t|�}y|j	|�}
Wn*t
k
rZ|	||7}	|d}
YqX|d|
�}
y<|dkr�tjtjtj|
��}n
||
}Wn t
k
r�||
|}YnX|	|7}	n4||kr||
d|
d�|kr|	|7}	|
d7}
q||
d|
d�|kr||
dd�}t|�}y|j	|�}
Wn.t
k
r�|	|||7}	|d}
Yq�X|d|
�}
y<|dkr�tjtjtj|
��}n
||
}Wn$t
k
r|||
|}YnX|	|7}	q|dd�}
|
d7}
||
|
d�}x>|r�||kr�|
|7}
|
d7}
||
|
d�}qKWy<|dkr�tjtjtj|
��}n
||
}Wnt
k
r�||
}YnX|	|7}	|r|
d8}
n
|	|7}	|
d7}
qW|	S)zfExpand shell variables of the forms $var, ${var} and %var%.

    Unknown variables are left unchanged.�$�%rNz_-�asciis'�{�}�environb�$�%�'�{�}r=rI)r.r/�stringZ
ascii_lettersZdigits�getattrrXrgr>rL�
ValueErrorri�fsdecoderh)r0rxZvarcharsZquoteZpercentZbraceZrbraceZdollarrg�resrLZpathlen�c�var�valuer1r1r2ras�	 



"




"




"



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>�endswith�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�cwdr1r1r2rs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)r0r1r1r2rs
�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�As	rr=r%)r.r/rzrrrrr�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�ls	zcommonpath.<locals>.<listcomp>cs%g|]\}}|j���qSr1)r)r�rRrH)rr1r2r�ms	c3s+|]!\}}|dd��kVqdS)Nr=r1)r�rRrH)rr1r2�	<genexpr>pszcommonpath.<locals>.<genexpr>z%Can't mix absolute and relative pathsNcss|]\}}|VqdS)Nr1)r�rRrHr1r1r2r�wsr=zPaths don't have the same drivecs(g|]}|r|�kr|�qSr1r1)r�r})rr1r2r�|s	cs)g|]}�fdd�|D��qS)cs(g|]}|r|�kr|�qSr1r1)r�r})rr1r2r�~s	z)commonpath.<locals>.<listcomp>.<listcomp>r1)r�r<)rr1r2r�~s	r))rzr.r/�setr>rr5r�min�max�	enumeraterr7r8rCrD)rEZdrivesplits�split_pathsrrPr0�common�s1�s2rSr}r�r1)r rrr2r)\sD	&
%"�)�_getfinalpathnamecCstt|��S)N)rr)�fr1r1r2r��sr�)�_isdir)r�r)/�__doc__rX�sysr[rC�__all__rrr!rrr r�builtin_module_namesr"r3rrrrrrrrWr	r
rr�ntr_�ImportErrorrrrrr�rr#�hasattrr�r$r%r)r�r8r�rr1r1r1r2�<module>s~

.3
1p2
64



Zerion Mini Shell 1.0