AlkantarClanX12

Your IP : 3.149.24.192


Current Path : /proc/self/root/opt/alt/python35/lib64/python3.5/__pycache__/
Upload File :
Current File : //proc/self/root/opt/alt/python35/lib64/python3.5/__pycache__/posixpath.cpython-35.pyc



��Yf?:�&@s	dZddlZddlZddlZddlZddlTdddddd	d
ddd
ddddddddddddddddddd d!d"d#d$d%d&d'd(d)g&Zd*Zd+Zd*Zd,Z	d-Z
d.ZdZd/Z
d0d1�Zd2d�Zd3d�Zd4d�Zd5d�Zd6d	�Zejje_d7d�Zd8d
�Zd9d�Zd:d�Zd;d�Zd<d�Zd=d�Zdadad>d�Zd?d�Zd@d�Z dAd&�Z!dBdC�Z"ej#dDkZ$ddEd(�Z%dFd)�Z&dS)Ga�Common operations on Posix pathnames.

Instead of importing this module directly, import os and refer to
this module as os.path.  The "os.path" name is an alias for this
module on Posix systems; on other systems (e.g. Mac, Windows),
os.path provides the same operations in a manner specific to that
platform, and is an alias to another module (e.g. macpath, ntpath).

Some of this can actually be useful on non-Posix systems too, e.g.
for manipulation of the pathname component of URLs.
�N)�*�normcase�isabs�join�
splitdrive�split�splitext�basename�dirname�commonprefix�getsize�getmtime�getatime�getctime�islink�exists�lexists�isdir�isfile�ismount�
expanduser�
expandvars�normpath�abspath�samefile�sameopenfile�samestat�curdir�pardir�sep�pathsep�defpath�altsep�extsep�devnull�realpath�supports_unicode_filenames�relpath�
commonpath�.z..�/�:z:/bin:/usr/binz	/dev/nullcCst|t�rdSdSdS)N�/r*)�
isinstance�bytes)�path�r0�./opt/alt/python35/lib64/python3.5/posixpath.py�_get_sep'sr2cCs4t|ttf�s0tdj|jj���|S)z6Normalize case of pathname.  Has no effect under Posixz2normcase() argument must be str or bytes, not '{}')r-r.�str�	TypeError�format�	__class__�__name__)�sr0r0r1r2s	cCst|�}|j|�S)zTest whether a path is absolute)r2�
startswith)r8rr0r0r1r=sc
Gs�t|�}|}yv|s-|dd�|xW|D]O}|j|�rR|}q4|sh|j|�ru||7}q4|||7}q4WWn1tttfk
r�tjd||��YnX|S)z�Join two or more pathname components, inserting '/' as needed.
    If any component is an absolute path, all previous path components
    will be discarded.  An empty last part will result in a path that
    ends with a separator.Nrr)r2r9�endswithr4�AttributeError�BytesWarning�genericpath�_check_arg_types)�a�prr/�br0r0r1rGs
	
cCsut|�}|j|�d}|d|�||d�}}|rk||t|�krk|j|�}||fS)z�Split a pathname.  Returns tuple "(head, tail)" where "tail" is
    everything after the final slash.  Either part may be empty.�N)r2�rfind�len�rstrip)r@r�i�head�tailr0r0r1rcs!cCs@t|t�rd}d}nd}d}tj||d|�S)Nr,�.r*r))r-r.r=�	_splitext)r@rr#r0r0r1rss	cCs|dd�|fS)zJSplit a pathname into drive and path. On Posix, drive is always
    empty.Nrr0)r@r0r0r1r�scCs-t|�}|j|�d}||d�S)z)Returns the final component of a pathnamerBN)r2rC)r@rrFr0r0r1r	�scCs^t|�}|j|�d}|d|�}|rZ||t|�krZ|j|�}|S)z-Returns the directory component of a pathnamerBN)r2rCrDrE)r@rrFrGr0r0r1r
�scCsBytj|�}Wnttfk
r1dSYnXtj|j�S)z&Test whether a path is a symbolic linkF)�os�lstat�OSErrorr;�stat�S_ISLNK�st_mode)r/�str0r0r1r�s
	cCs.ytj|�Wntk
r)dSYnXdS)zCTest whether a path exists.  Returns True for broken symbolic linksFT)rKrLrM)r/r0r0r1r�s

	cCs�ytj|�}Wntk
r+dSYnXtj|j�rBdSt|t�rct|d�}nt|d�}t	|�}ytj|�}Wntk
r�dSYnX|j
}|j
}||kr�dS|j}|j}||kr�dSdS)z$Test whether a path is a mount pointFs..z..T)rKrLrMrNrOrPr-r.rr%�st_dev�st_ino)r/�s1�parent�s2�dev1�dev2�ino1�ino2r0r0r1r�s.
	
					c	Cs|t|t�rd}nd}|j|�s1|St|�}|j|d�}|dkrgt|�}|dkr�dtjkr�ddl}|j	tj
��j}q(tjd}noddl}|d|�}t|t�r�t|d�}y|j
|�}Wntk
r|SYnX|j}t|t�rOtj|�}d}nd	}|j|�}|||d�p{|S)
zOExpand ~ and ~user constructions.  If user or $HOME is unknown,
    do nothing.�~�~rBr�HOMEN�ASCIIr,r*)r-r.r9r2�findrDrK�environ�pwd�getpwuid�getuid�pw_dirr3�getpwnam�KeyError�fsencoderE)	r/�tilderrFra�userhome�name�pwent�rootr0r0r1r�s:	
			cCs�t|t�rpd|kr|StsFddl}|jd|j�atj}d}d}ttdd�}nUd|kr�|St	s�ddl}|jd	|j�a	t	j}d
}d}tj
}d}x�|||�}|s�P|jd�\}}|jd�}	|	j
|�r6|	j|�r6|	dd
�}	y<|dkrgtjtj
tj|	��}
n
||	}
Wntk
r�|}Yq�X||d�}|d|�|
}t|�}||7}q�W|S)zZExpand shell variables of form $var and ${var}.  Unknown variables
    are left unchanged.�$rNs\$(\w+|\{[^}]*\})�{�}�environb�$z\$(\w+|\{[^}]*\})�{�}rB���)r-r.�	_varprogb�re�compiler^�search�getattrrK�_varprogr`�span�groupr9r:rg�fsdecoderfrD)r/rvrx�start�endr`rF�m�jrj�valuerHr0r0r1rsN			"
c	CsRt|t�r*d}d}d}d}nd}d}d}d}||krR|S|j|�}|r�|j|d	�r�|j|d
�r�d	}|j|�}g}xs|D]k}|||fkr�q�||ks�|r�|s�|r|d|kr|j|�q�|r�|j�q�W|}|j|�}|rH|||}|pQ|S)
z0Normalize path, eliminating double slashes, etc.r,�rIs..r*�r)z..��rBrt)r-r.r9r�append�popr)	r/r�empty�dot�dotdot�initial_slashes�comps�	new_comps�compr0r0r1r?s<	'
cCsOt|�sEt|t�r*tj�}ntj�}t||�}t|�S)zReturn an absolute path.)rr-r.rK�getcwdb�getcwdrr)r/�cwdr0r0r1rdscCs,t|dd�|i�\}}t|�S)zlReturn the canonical path of the specified filename, eliminating any
symbolic links encountered in the path.Nr)�
_joinrealpathr)�filenamer/�okr0r0r1r%rs"c
Cs�t|t�r$d}d}d}nd}d}d}t|�rX|dd�}|}x0|r�|j|�\}}}|s[||kr�q[||kr�|r�t|�\}}||kr�t|||�}q[|}q[t||�}t|�s|}q[||kr9||}|dk	r&q[t||�dfSd||<t|tj	|�|�\}}	|	s}t||�dfS|||<q[W|d	fS)
Nr,rIs..r*r)z..rBFT)
r-r.r�	partitionrrrr�rK�readlink)
r/�rest�seenrrrrj�_�newpathr�r0r0r1r�zsH		

!r��darwinc	Cs.|std��t|t�r6d}d}d}nd}d}d}|dkrZ|}y�d	d
�t|�j|�D�}dd
�t|�j|�D�}tt||g��}|gt|�|||d�}|s�|St|�SWn4tt	t
tfk
r)tj
d||��YnXdS)
z#Return a relative version of a pathzno path specifiedrIr,s..r)r*z..NcSsg|]}|r|�qSr0r0)�.0�xr0r0r1�
<listcomp>�s	zrelpath.<locals>.<listcomp>cSsg|]}|r|�qSr0r0)r�r�r0r0r1r��s	r')�
ValueErrorr-r.rrrDrrr4r;r<�DeprecationWarningr=r>)	r/r~rrr�
start_list�	path_listrF�rel_listr0r0r1r'�s,	""%c	s{|std��t|dt�r4d�d�nd�d�y	�fdd�|D�}y&t�fd	d
�|D��\}Wn!tk
r�td�d�YnX�fd
d�|D�}t|�}t|�}|}x;t|�D]-\}}|||kr�|d|�}Pq�W|r'�n
�dd�}|�j|�SWn+tt	fk
rvt
jd|��YnXdS)zDGiven a sequence of path names, returns the longest common sub-path.z%commonpath() arg is an empty sequencerr,rIr*r)csg|]}|j���qSr0)r)r�r/)rr0r1r��s	zcommonpath.<locals>.<listcomp>c3s%|]}|dd��kVqdS)NrBr0)r�r@)rr0r1�	<genexpr>�szcommonpath.<locals>.<genexpr>z%Can't mix absolute and relative pathsNcs)g|]}�fdd�|D��qS)cs(g|]}|r|�kr|�qSr0r0)r��c)rr0r1r��s	z)commonpath.<locals>.<listcomp>.<listcomp>r0)r�r8)rr0r1r��s	r()r�r-r.�set�min�max�	enumeraterr4r;r=r>)	�paths�split_pathsrrTrV�commonrFr��prefixr0)rrr1r(�s4	&
)'�__doc__rK�sysrNr=�__all__rrr#rr r!r"r$r2rrrrrrJrr	r
rrrrrzrurrrr%r��platformr&r'r(r0r0r0r1�<module>sZ
		
	

**4%3&