ok

Mini Shell

Direktori : /proc/thread-self/root/opt/alt/python34/lib64/python3.4/__pycache__/
Upload File :
Current File : //proc/thread-self/root/opt/alt/python34/lib64/python3.4/__pycache__/posixpath.cpython-34.pyo

�
e f�4�%@s�dZddlZddlZddlZddlZddlTdddddd	d
ddd
ddddddddddddddddddd d!d"d#d$d%d&d'd(g%Zd)Zd*Zd)Zd+Z	d,Z
d-ZdZd.Z
d/d0�Zd1d�Zd2d�Zd3d�Zd4d�Zd5d	�Zejje_d6d�Zd7d
�Zd8d�Zd9d�Zd:d�Zd;d�Zd<d�Zdadad=d�Zd>d�Zd?d�Z d@d&�Z!dAdB�Z"ej#dCkZ$ddDd(�Z%dS)Ea�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�.z..�/�:z:/bin:/usr/binz	/dev/nullcCst|t�rdSdSdS)N�/r))�
isinstance�bytes)�path�r/�./opt/alt/python34/lib64/python3.4/posixpath.py�_get_sep&sr1cCs7t|ttf�s3tdj|jj���n|S)z6Normalize case of pathname.  Has no effect under Posixz2normcase() argument must be str or bytes, not '{}')r,r-�str�	TypeError�format�	__class__�__name__)�sr/r/r0r1s	cCst|�}|j|�S)zTest whether a path is absolute)r1�
startswith)r7rr/r/r0r<scGs�t|�}|}y^xW|D]O}|j|�r:|}q|sP|j|�r]||7}q|||7}qWWnGtk
r�tdd�|f|D��r�td�d�n�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.css$|]}t|ttf�VqdS)N)r,r2r-)�.0r7r/r/r0�	<genexpr>Vszjoin.<locals>.<genexpr>z.Can't mix strings and bytes in path componentsN)r1r8�endswithr3�all)�a�prr.�br/r/r0rFs
	

 		cCsxt|�}|j|�d}|d|�||d�}}|rn||t|�krn|j|�}n||fS)z�Split a pathname.  Returns tuple "(head, tail)" where "tail" is
    everything after the final slash.  Either part may be empty.�N)r1�rfind�len�rstrip)r>r�i�head�tailr/r/r0rcs!cCs@t|t�rd}d}nd}d}tj||d|�S)Nr+�.r)r()r,r-�genericpath�	_splitext)r>rr#r/r/r0rss	cCs|dd�|fS)zJSplit a pathname into drive and path. On Posix, drive is always
    empty.Nrr/)r>r/r/r0r�scCs-t|�}|j|�d}||d�S)z)Returns the final component of a pathnamer@N)r1rA)r>rrDr/r/r0r	�scCsat|�}|j|�d}|d|�}|r]||t|�kr]|j|�}n|S)z-Returns the directory component of a pathnamer@N)r1rArBrC)r>rrDrEr/r/r0r
�scCsBytj|�}Wnttfk
r1dSYnXtj|j�S)z&Test whether a path is a symbolic linkF)�os�lstat�OSError�AttributeError�stat�S_ISLNK�st_mode)r.�str/r/r0r�s
	cCs.ytj|�Wntk
r)dSYnXdS)zCTest whether a path exists.  Returns True for broken symbolic linksFT)rJrKrL)r.r/r/r0r�s

	cCs�ytj|�}Wntk
r+dSYnXtj|j�rBdSt|t�rct|d�}nt|d�}ytj|�}Wntk
r�dSYnX|j	}|j	}||kr�dS|j
}|j
}||kr�dSdS)z$Test whether a path is a mount pointFs..z..T)rJrKrLrNrOrPr,r-r�st_dev�st_ino)r.�s1�parent�s2�dev1�dev2�ino1�ino2r/r/r0r�s,
	
					c	Cs�t|t�rd}nd}|j|�s1|St|�}|j|d�}|dkrjt|�}n|dkr�dtjkr�ddl}|j	tj
��j}q.tjd}nrddl}|d|�}t|t�r�t|d�}ny|j
|�}Wntk
r$|SYnX|j}t|t�rUtj|�}d}nd	}|j|�}|||d�p�|S)
zOExpand ~ and ~user constructions.  If user or $HOME is unknown,
    do nothing.�~�~r@r�HOMEN�ASCIIr+r))r,r-r8r1�findrBrJ�environ�pwd�getpwuid�getuid�pw_dirr2�getpwnam�KeyError�fsencoderC)	r.�tilderrDra�userhome�name�pwent�rootr/r/r0r�s:	
			cCs�t|t�rsd|kr|StsIddl}|jd|j�antj}d}d}ttdd�}nXd|kr�|St	s�ddl}|jd	|j�a	nt	j}d
}d}tj
}d}x|||�}|s�Pn|jd�\}}|jd�}	|	j
|�rB|	j|�rB|	dd
�}	ny<|dkrstjtj
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+|\{[^}]*\})�{�}r@���)r,r-�	_varprogb�re�compiler^�search�getattrrJ�_varprogr`�span�groupr8r;rg�fsdecoderfrB)r.rvrx�start�endr`rD�m�jrj�valuerFr/r/r0r
sN			"
c	Cs^t|t�r*d}d}d}d}nd}d}d}d}||krR|S|j|�}|r�|j|d	�r�|j|d
�r�d	}n|j|�}g}xy|D]q}|||fkr�q�n||ks|r�|s|r|d|kr|j|�q�|r�|j�q�q�W|}|j|�}|rT|||}n|p]|S)
z0Normalize path, eliminating double slashes, etc.r+�rGs..r)�r(z..��r@rt)r,r-r8r�append�popr)	r.r�empty�dot�dotdot�initial_slashes�comps�	new_comps�compr/r/r0r>s<	'	
cCsRt|�sHt|t�r*tj�}ntj�}t||�}nt|�S)zReturn an absolute path.)rr,r-rJ�getcwdb�getcwdrr)r.�cwdr/r/r0rcs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.�okr/r/r0r%qs"c
Cs�t|t�r$d}d}d}nd}d}d}t|�r[|dd�}|}nx?|r�|j|�\}}}|s^||kr�q^n||kr�|r�t|�\}}||kr�t|||�}q�q^|}q^nt||�}t|�s|}q^n||krK||}|dk	r8q^nt||�dfSd||<t|tj	|�|�\}}	|	s�t||�dfS|||<q^W|d	fS)
Nr+rGs..r)r(z..r@FT)
r,r-r�	partitionrrrr�rJ�readlink)
r.�rest�seenrrrrj�_�newpathr�r/r/r0r�ysH			

!r��darwinc	Cs�|std��nt|t�r9d}d}d}nd}d}d}|dkr`|}nd	d
�t|�j|�D�}dd
�t|�j|�D�}tt||g��}|gt|�|||d�}|s�|St|�S)z#Return a relative version of a pathzno path specifiedrGr+s..r(r)z..NcSsg|]}|r|�qSr/r/)r9�xr/r/r0�
<listcomp>�s	zrelpath.<locals>.<listcomp>cSsg|]}|r|�qSr/r/)r9r�r/r/r0r��s	)�
ValueErrorr,r-rrrBrr)	r.r~rrr�
start_list�	path_listrD�rel_listr/r/r0r'�s$		""%)&�__doc__rJ�sysrNrH�__all__rrr#rr r!r"r$r1rrrrrrIrr	r
rrrrrzrurrrr%r��platformr&r'r/r/r/r0�<module>sV
	
	

)*4%3

Zerion Mini Shell 1.0