Spade

Mini Shell

Directory:~$ /proc/self/root/usr/lib64/python3.6/__pycache__/
Upload File

[Home] [System Details] [Kill Me]
Current File:~$ //proc/self/root/usr/lib64/python3.6/__pycache__/posixpath.cpython-36.pyc

3


 \�=�&@s^dZdZdZdZdZdZdZdZdZddl	Z	ddl
Z
ddlZddlZdd	lTd
ddd
ddddddddddddddddddd
d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/g&Z
d0d1�Zd2d
�Zd3d�Zd4d�Zd5d�Zd6d�Zejje_d7d
�Zd8d�Zd9d�Zd:d�Zd;d�Zd<d�Zd=d�Zdadad>d�Zd?d�Zd@d
�Z dAd,�Z!dBdC�Z"e
j#dDkZ$dGdEd.�Z%dFd/�Z&dS)Ha�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.
�.z..�/�:z:/bin:/usr/binNz	/dev/null�)�*�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�
commonpathcCst|t�rdSdSdS)N�/r)�
isinstance�bytes)�path�r0�!/usr/lib64/python3.6/posixpath.py�_get_sep)s
r2cCs.tj|�}t|ttf�s*tdj|jj���|S)z6Normalize
case of pathname.  Has no effect under Posixz2normcase() argument must be
str or bytes, not
'{}')	�os�fspathr-r.�str�	TypeError�format�	__class__�__name__)�sr0r0r1r4s

cCstj|�}t|�}|j|�S)zTest whether a path is
absolute)r3r4r2�
startswith)r:r"r0r0r1r@s
c
Gs�tj|�}t|�}|}yd|s,|dd�|xJttj|�D]:}|j|�rN|}q:|s^|j|�rh||7}q:|||7}q:WWn.tttfk
r�t	j
d|f|���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)r3r4r2�mapr;�endswithr6�AttributeError�BytesWarning�genericpath�_check_arg_types)�a�pr"r/�br0r0r1rKs



cCs`tj|�}t|�}|j|�d}|d|�||d�}}|rX||t|�krX|j|�}||fS)z�Split
a pathname.  Returns tuple "(head, tail)" where "tail"
is
    everything after the final slash.  Either part may be
empty.�N)r3r4r2�rfind�len�rstrip)rCr"�i�head�tailr0r0r1r
hs

cCs6tj|�}t|t�rd}d}nd}d}tj||d|�S)Nr,�.rr)r3r4r-r.r@�	_splitext)rCr"r&r0r0r1rys

cCstj|�}|dd�|fS)zJSplit a pathname into drive and
path. On Posix, drive is always
    empty.Nr)r3r4)rCr0r0r1r	�s
cCs,tj|�}t|�}|j|�d}||d�S)z)Returns the final
component of a pathnamerEN)r3r4r2rF)rCr"rIr0r0r1r�s
cCsNtj|�}t|�}|j|�d}|d|�}|rJ||t|�krJ|j|�}|S)z-Returns
the directory component of a
pathnamerEN)r3r4r2rFrGrH)rCr"rIrJr0r0r1r
�s

cCs4ytj|�}Wnttfk
r&dSXtj|j�S)z&Test whether a path is a symbolic
linkF)r3�lstat�OSErrorr>�stat�S_ISLNK�st_mode)r/�str0r0r1r�s
cCs(ytj|�Wntk
r"dSXdS)zCTest whether a path exists.  Returns True for broken
symbolic linksFT)r3rNrO)r/r0r0r1r�s
cCs�ytj|�}Wntk
r"dSXtj|j�r4dSt|t�rJt|d�}n
t|d�}t	|�}ytj|�}Wntk
r~dSX|j
}|j
}||kr�dS|j}|j}||kr�dSdS)z$Test whether a path is a
mount
pointFs..z..T)r3rNrOrPrQrRr-r.rr(�st_dev�st_ino)r/�s1�parent�s2�dev1�dev2�ino1�ino2r0r0r1r�s.

c	Cs4tj|�}t|t�rd}nd}|j|�s,|St|�}|j|d�}|dkrPt|�}|dkr�dtjkr�ddl	}y|j
tj��j}Wq�t
k
r�|SXq�tjd}nRddl	}|d|�}t|t�r�t|d�}y|j|�}Wnt
k
r�|SX|j}t|t��rtj|�}d}nd	}|j|�}|||d��p2|S)
zOExpand ~ and ~user constructions.  If user or $HOME is unknown,
    do
nothing.�~�~rEr�HOMEN�ASCIIr,r)r3r4r-r.r;r2�findrG�environ�pwd�getpwuid�getuid�pw_dir�KeyErrorr5�getpwnam�fsencoderH)	r/�tilder"rIrc�userhome�name�pwent�rootr0r0r1r�sB







cCs\tj|�}t|t�rVd|kr
|Sts:ddl}|jd|j�atj}d}d}t	tdd�}n:d|krb|St
s|ddl}|jd	|j�a
t
j}d
}d}tj}d}x�|||�}|s�P|jd�\}}|j
d�}	|	j|�r�|	j|�r�|	dd
�}	y.|dk�rtjtjtj|	��}
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+|\{[^}]*\})�{�}rE���)r3r4r-r.�	_varprogb�re�compiler`�search�getattr�_varprogrb�span�groupr;r=ri�fsdecodergrG)r/rxrz�start�endrbrI�m�jrl�valuerKr0r0r1rsP





c	Cs�tj|�}t|t�r&d}d}d}d}nd}d}d}d}||krB|S|j|�}|rr|j|d	�rr|j|d
�rrd	}|j|�}g}xV|D]N}|||fkr�q�||ks�|r�|s�|r�|d|kr�|j|�q�|r�|j�q�W|}|j|�}|r�|||}|p�|S)
z0Normalize
path, eliminating double slashes,
etc.r,�rLs..r�rz..��rErv)	r3r4r-r.r;r
�append�popr)	r/r"�empty�dot�dotdot�initial_slashes�comps�	new_comps�compr0r0r1rRs>





cCs@tj|�}t|�s8t|t�r&tj�}ntj�}t||�}t|�S)zReturn
an absolute
path.)	r3r4rr-r.�getcwdb�getcwdrr)r/�cwdr0r0r1rxs



cCs*tj|�}t|dd�|i�\}}t|�S)zlReturn the canonical
path of the specified filename, eliminating any
symbolic links encountered in the
path.Nr)r3r4�
_joinrealpathr)�filenamer/�okr0r0r1r(�s
c
Cst|t�rd}d}d}nd}d}d}t|�r<|dd�}|}x�|�r|j|�\}}}|s>||krdq>||kr�|r�t|�\}}||kr�t|||�}q>|}q>t||�}t|�s�|}q>||kr�||}|dk	r�q>t||�dfSd||<t|tj	|�|�\}}	|	�s
t||�dfS|||<q>W|d	fS)
Nr,rLs..rrz..rEFT)
r-r.r�	partitionr
rrr�r3�readlink)
r/�rest�seenr"r r!rl�_�newpathr�r0r0r1r��sH

r��darwinc	Cs�|std��tj|�}t|t�r.d}d}d}nd}d}d}|dkrH|}n
tj|�}ynd	d
�t|�j|�D�}dd
�t|�j|�D�}tt||g��}|gt|�|||d�}|s�|St	|�St
ttt
fk
r�tjd||��YnXdS)
z#Return a relative version of a pathzno
path
specifiedrLr,s..rrz..NcSsg|]}|r|�qSr0r0)�.0�xr0r0r1�
<listcomp>�szrelpath.<locals>.<listcomp>cSsg|]}|r|�qSr0r0)r�r�r0r0r1r��sr*)�
ValueErrorr3r4r-r.rr
rGrrr6r>r?�DeprecationWarningr@rA)	r/r�r r"r!�
start_list�	path_listrI�rel_listr0r0r1r*�s0


c	s2|std��tttj|��}t|dt�r4d�d�nd�d�yƇfdd�|D�}yt�fd	d
�|D��\}Wntk
r�td�d�YnX�fd
d�|D�}t|�}t	|�}|}x.t
|�D]"\}}|||kr�|d|�}Pq�W|r�n
�dd�}|�j|�Stt
fk
�r,tjd|���YnXdS)zDGiven a sequence of path names,
returns the longest common sub-path.z%commonpath() arg is an empty
sequencerr,rLrrcsg|]}|j���qSr0)r
)r�r/)r"r0r1r��szcommonpath.<locals>.<listcomp>c3s|]}|dd��kVqdS)NrEr0)r�rC)r"r0r1�	<genexpr>szcommonpath.<locals>.<genexpr>z%Can't
mix absolute and relative
pathsNcsg|]}�fdd�|D��qS)csg|]}|r|�kr|�qSr0r0)r��c)r
r0r1r�sz)commonpath.<locals>.<listcomp>.<listcomp>r0)r�r:)r
r0r1r�sr+)r+)r��tupler<r3r4r-r.�set�min�max�	enumeraterr6r>r@rA)	�paths�split_pathsrrVrX�commonrIr��prefixr0)r
r"r1r+�s6)N)'�__doc__r
r!r&r"r#r$r%r'r3�sysrPr@�__all__r2rrrr
rrMr	rr
rrrrr|rwrrrr(r��platformr)r*r+r0r0r0r1�<module>sZ

	
	

*25&	3

)