Sindbad~EG File Manager

Current Path : /usr/local/lib64/python3.6/site-packages/psutil/__pycache__/
Upload File :
Current File : //usr/local/lib64/python3.6/site-packages/psutil/__pycache__/_compat.cpython-36.pyc

3

��f�;�9@sJdZddlZddlZddlZddlZddlZddlZddlZddddddd	d
ddd
ddddddgZej	ddkZ
e�Ze
r�e
ZeZeZeZeZdd	�ZneZeZeZeZdd	�Ze
r�eZneZeedfdd�Ze
r�eZeZeZeZeZeZn�ddlZefdd�Zee �dd��Zee �dd��Zee �dd��Zee �dd��Zee �dd��Zee �d d��Zej!�d!k�r�ye"ej#d"��Wn6ek
�r�Yn"e"k
�r�d#Z$e%e$��YnXydd$lm&Z&Wn�e'k
�rfydd%l(m)Z)Wn"e'k
�r
dd%l*m)Z)YnXej+d&d'd(d)d*g�Z,Gd+d,�d,e-�Z.efe/e
ee0e1d�f�e2e3e1e4fd-d.�Z5d=d1d
�Z&YnXydd2l6m7Z7Wn,e'k
�r�ej8ej9Bdfd3d�Z7YnXydd4l6m:Z:Wn e'k
�r�d?d7d�Z:YnXydd8l;m<Z=Wn&e'k
�rGd9d:�d:e�Z=YnXydd;lm>Z>Wn$e'k
�rDej?d<d
��Z>YnXdS)@z�Module which provides compatibility with older Python versions.
This is more future-compatible rather than the opposite (prefer latest
Python 3 way of doing things).
�N�PY3�long�range�super�unicode�
basestring�b�	lru_cache�which�get_terminal_size�redirect_stderr�FileNotFoundError�PermissionError�ProcessLookupError�InterruptedError�ChildProcessError�FileExistsError�cCs
|jd�S)Nzlatin-1)�encode)�s�r�:/usr/local/lib64/python3.6/site-packages/psutil/_compat.pyr2scCs|S)Nr)rrrrr;s�c)Cst|tk�rXtj|�}y|j|jjd}Wn$ttfk
rNd}t|��YnXy
|j	}WnFt
tfk
r�y|jj	}Wn t
k
r�d}t|��YnXYnXx�|D]�}x�|jj
�D]�}yXxRt|tj��st|t�r�|j}q�y
|j}Wq�t
k
�r|j||�}Yq�Xq�WWnt
tfk
�r0w�YnX|j|jkr�Pq�Wq�Pq�Wd}t|��|tk	�rlt||�St|�S)zuLike Python 3 builtin super(). If called without any arguments
        it attempts to infer them at runtime.
        rz'super() used in a function with no argsz$super() used in a non-newstyle classzsuper() called outside a method)�	_SENTINEL�sys�	_getframe�f_locals�f_code�co_varnames�
IndexError�KeyError�RuntimeError�__mro__�AttributeError�	__class__�__dict__�values�
isinstance�types�FunctionType�property�fget�__func__�__get__�	TypeError�	func_code�_builtin_super)�type_Ztype_or_objZ
framedepth�f�msg�mro�methrrrrJsH







cs�fdd�}|S)Ncs*G��fdd�d����j�_�j�_�S)Ncs2eZdZ��fdd�ZG�fdd�de�Z�ZS)zE_instance_checking_exception.<locals>.wrapped.<locals>.TemporaryClasscsht|�dkrRt|d��rR|d}x@t|�D] }|jd�s,t||t||��q,Wnt�|�j||�dS)Nrr�__)�lenr'�dir�
startswith�setattr�getattrr�__init__)�self�args�kwargsZ	unwrap_me�attr)�TemporaryClassr$rrr<�s

zN_instance_checking_exception.<locals>.wrapped.<locals>.TemporaryClass.__init__cs eZdZ�fdd�Zdd�ZdS)zS_instance_checking_exception.<locals>.wrapped.<locals>.TemporaryClass.__metaclass__cs�|�S)Nr)�cls�inst)�instance_checkerrr�__instancecheck__�sze_instance_checking_exception.<locals>.wrapped.<locals>.TemporaryClass.__metaclass__.__instancecheck__cSstj�d}t||�S)Nr)r�exc_infor')rBZ	classinfo�valuerrr�__subclasscheck__�sze_instance_checking_exception.<locals>.wrapped.<locals>.TemporaryClass.__metaclass__.__subclasscheck__N)�__name__�
__module__�__qualname__rErHr)rDrr�
__metaclass__�srL)rIrJrKr<�typerL�
__classcell__r)rArD)r$rrA�srA)rI�__doc__)rD)�base_exception)rArDr�wrapped�sz-_instance_checking_exception.<locals>.wrappedr)rPrQr)rPr�_instance_checking_exception�srRcCst|dt�tjkS)N�errno)r;rrS�ENOENT)rCrrrr
�scCst|dt�tjkS)NrS)r;rrSZESRCH)rCrrrr�scCst|dt�tjtjfkS)NrS)r;rrS�EACCES�EPERM)rCrrrr�scCst|dt�tjkS)NrS)r;rrSZEINTR)rCrrrr�scCst|dt�tjkS)NrS)r;rrSZECHILD)rCrrrr�scCst|dt�tjkS)NrS)r;rrS�EEXIST)rCrrrr�s�CPythonZpermzbbroken or incompatible Python implementation, see: https://github.com/giampaolo/psutil/issues/1659)r	)�RLock�	CacheInfo�hits�misses�maxsize�currsizec@s$eZdZdZefdd�Zdd�ZdS)�
_HashedSeq�	hashvaluecCs||dd�<||�|_dS)N)r`)r=�tup�hashrrrr<�sz_HashedSeq.__init__cCs|jS)N)r`)r=rrr�__hash__�sz_HashedSeq.__hash__N)r`)rIrJrK�	__slots__rbr<rcrrrrr_�sr_c	s�|}	|r2||j��}
|	|7}	x|
D]}|	|7}	q"W|rp|	|�fdd�|D��7}	|r�|	|�fdd�|
D��7}	n$||	�dkr��|	d�|kr�|	dSt|	�S)Nc3s|]}�|�VqdS)Nr)�.0�v)rMrr�	<genexpr>sz_make_key.<locals>.<genexpr>c3s|]\}}�|�VqdS)Nr)re�krf)rMrrrgsrr)�itemsr_)r>�kwds�typed�kwd_mark�	fasttypes�sorted�tuplerMr7�keyZsorted_items�itemr)rMr�	_make_key�s
rr�dFcs��fdd�}|S)zLeast-recently-used cache decorator, see:
        http://docs.python.org/3/library/functools.html#functools.lru_cache.
        csi�ddg�
d
\��t�
�j�t�t��	g���ddg�dd�<�g�d\�����dkrl��
�fdd�}nP�dkr������
��
��f	dd�}n*����������	�
���
��fdd�}����	��
fd	d
�}��	��
fdd�}�|_||_||_tj|��S)Nrr�rcs�||�}��d7<|S)Nrr)r>rj�result)�MISSES�stats�
user_functionrr�wrappers
z7lru_cache.<locals>.decorating_function.<locals>.wrappercsX�||��}�|��}|�k	r2��d7<|S�||�}|�|<��d7<|S)Nrr)r>rjrpru)	�HITSrv�cache�	cache_get�make_key�rootrwrkrxrrry!s

csl|s�r�
||��}n|}�	j�zr�|�}|dk	r��\}|\}}}}||�<||�<|�}||�<|�<||�<||�<�
�d7<|SWd�	j�X�||�}�	j�z��\}|�kr�n�����k�r|}	||	�<||	�<|	�}�d<|�}
d|�<|�<�|
=|	�|<n,|�}||||g}||�<|�<�|<�
�d7<Wd�	j�X|S)Nrr)�acquire�release)r>rjrp�linkr~Z	link_prevZ	link_nextru�lastZoldrootZoldkey)rz�KEYrv�NEXT�PREV�RESULT�_lenr{r|�lockr}r]�
nonlocal_rootrwrkrxrrry.sN



cs2�j�zt�����t���S�j�XdS)zReport cache statistics.N)r�
_CacheInfor7r�r)rzrvr{r�r]rwrr�
cache_info[s
z:lru_cache.<locals>.decorating_function.<locals>.cache_infoc
sP�j�z8�j��d}||ddg|dd�<ddg�dd�<Wd�j�XdS)z%Clear the cache and cache statistics.rN)r�clearr�)r~)r{r�r�rwrr�cache_clearesz;lru_cache.<locals>.decorating_function.<locals>.cache_clear)rr)rrrtr)	rr�getr7rY�__wrapped__r�r��	functools�update_wrapper)rxryr�r�)r]rk)rzr�rvr�r�r�r�r{r|r�r}r�r~rwrxr�decorating_functions,
*-
z&lru_cache.<locals>.decorating_functionr)r]rkr�r)r]rkrr	si)r
cs"dd�}tjj��r&|�|�r"�SdS|dkr>tjjdtj�}|sFdS|jtj�}tj	dkr�tj
|krt|jdtj
�tjjdd�jtj�}t�fd	d
�|D��r��g}q‡fdd�|D�}n�g}t
�}xT|D]L}tjj|�}||kr�|j|�x(|D] }	tjj||	�}
||
|�r�|
Sq�Wq�WdS)
aJGiven a command, mode, and a PATH string, return the path which
        conforms to the given mode on the PATH, or None if there is no such
        file.

        `mode` defaults to os.F_OK | os.X_OK. `path` defaults to the result
        of os.environ.get("PATH"), or can be overridden with a custom search
        path.
        cSs&tjj|�o$tj||�o$tjj|�S)N)�os�path�exists�access�isdir)�fn�moderrr�
_access_check�szwhich.<locals>._access_checkN�PATH�win32r�PATHEXT�c3s |]}�j�j|j��VqdS)N)�lower�endswith)re�ext)�cmdrrrg�szwhich.<locals>.<genexpr>csg|]}�|�qSrr)rer�)r�rr�
<listcomp>�szwhich.<locals>.<listcomp>)r�r��dirname�environr��defpath�split�pathsepr�platform�curdir�insert�any�set�normcase�add�join)r�r�r�r��pathext�files�seenr8�normdir�thefile�namer)r�rr
}s8







)r�P�cCstyddl}ddl}ddl}Wntk
r0|SXy(|jd|jd|jd��}|d|dfStk
rn|SXdS)NrZhhrZ1234)�fcntl�struct�termios�ImportError�unpackZioctlZ
TIOCGWINSZ�	Exception)�fallbackr�r�r��resrrrr�s)�TimeoutExpiredc@seZdZdS)�SubprocessTimeoutExpiredN)rIrJrKrrrrr��sr�)rccs$tj}z|t_|VWd|t_XdS)N)r�stderr)�
new_target�originalrrrr�s

)rsF�r�r�)r�)@rO�collections�
contextlibrSr�r�rr(�__all__�version_infor�objectr�intrr�xrange�strrrrrr0r
rrrrrr�r�rR�EnvironmentError�python_implementation�OSErrorrWr3r!r	r��	threadingrY�dummy_threading�
namedtupler��listr_r��	frozensetrMrnror7rr�shutilr
�F_OK�X_OKr�
subprocessr�r�r�contextmanagerrrrr�<module>s�



;	r5

Sindbad File Manager Version 1.0, Coded By Sindbad EG ~ The Terrorists