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__/_pswindows.cpython-36.pyc

3

�^g��(@sdZddlZddlZddlZddlZddlZddlZddlZddlm	Z	ddl
mZddlmZddlm
Z
ddlmZdd	lmZdd
lmZddlmZddlmZdd
lmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlm Z ddlm!Z!ddlm"Z"ddlm#Z#ddlm$Z$ddlm%Z%yddl
mZ&Wnje'k
�r�Z(zLe)e(�j*�j+d��r�ej,�dd k�r�d!Z-e-d"7Z-e-d#7Z-e.e-��n�WYddZ([(XnXe�rddl/Z/ndZ/d$d%d&d'd(d)d*d+d,d-d.d/d0d1gZ0d2Z1d3Z2d4ej3kZ4e/dk�rFd�Z5ne/j6d5d1d�i�Z7e7j5Z5e&j8ej9e&j:ej;e&j<ej=e&j>ej?e&j@ejAe&jBejCe&jDejEe&jFejGe&jHejIe&jJejKe&jLejMe&jNe1e&jOejPi
ZQe/dk	�r�Gd6d7�d7e/j6�ZReS�jTeRjU�e/dk�rdZVdZWd8ZXd9ZYn Gd:d;�d;e/j6�ZZeS�jTeZjU�e[ddd8d9d<d=d d>d?d@dAdBdCdDdEdFdGdHdIdJdKdLdM�Z\e	dNdOdPdQdRdSg�Z]e	dTdUdVdWdXdYg�Z^e	dZd[d\d]d^d_d`dadbdcdddedfg�Z_e	dge_j`d��Zae	didjd[g�Zbe	dkdldmjcebj`��Zde	dndodpdqdrdsdtg�Zeedudv�dwdx��Zfdydz�Zged{d|��Zhd}d~�Zidd��Zje&jkZkd�d��Zld�d��Zmd�d��Znd�d��Zod�d��Zpd�d��Zqd�d��Zrd�d��Zsd�atd�d��Zud�d�d��Zvd�d��Zwd�d��Zxd�d��Zyd�d��Zzda{d�d��Z|d�d��Z}d�d$�Z~d�d%�ZGd�d��d��Z�e&j�Z�e&j�Z�e&j�Z�d�d��Z�d�d�d��Z�d�d��Z�d�d��Z�Gd�d��d��Z�dS)�z Windows platform implementation.�N)�
namedtuple�)�_common)�ENCODING)�
ENCODING_ERRS)�AccessDenied)�
NoSuchProcess)�TimeoutExpired)�	conn_tmap)�conn_to_ntuple)�debug)�
isfile_strict)�memoize)�memoize_when_activated)�parse_environ_block)�
usage_percent)�PY3)�long)�	lru_cache)�range)�unicode)�ABOVE_NORMAL_PRIORITY_CLASS)�BELOW_NORMAL_PRIORITY_CLASS)�HIGH_PRIORITY_CLASS)�IDLE_PRIORITY_CLASS)�NORMAL_PRIORITY_CLASS)�REALTIME_PRIORITY_CLASS)�_psutil_windowszdll load failed�z3this Windows version is too old (< Windows Vista); z:psutil 3.4.2 is the latest version which supports Windows z2000, XP and 2003 server�win_service_iter�win_service_getrrrrrr�IOPRIO_VERYLOW�
IOPRIO_LOW�
IOPRIO_NORMAL�IOPRIO_HIGH�CONN_DELETE_TCB�AF_LINKZ
DELETE_TCBi+�__pypy__�
AddressFamilyc@s$eZdZeZeZeZeZeZeZdS)�PriorityN)	�__name__�
__module__�__qualname__rrrrrr�r-r-�=/usr/local/lib64/python3.6/site-packages/psutil/_pswindows.pyr)ssr)��c@seZdZdZdZdZdZdS)�
IOPriorityrrr/r0N)r*r+r,r!r"r#r$r-r-r-r.r1�sr1�����	�
���
��������)�num_handles�ctx_switches�	user_time�kernel_time�create_time�num_threads�	io_rcount�	io_wcount�	io_rbytes�	io_wbytes�io_count_others�io_bytes_others�num_page_faults�	peak_wset�wset�peak_paged_pool�
paged_pool�peak_non_paged_pool�non_paged_pool�pagefile�
peak_pagefile�mem_private�	scputimes�user�system�idle�	interrupt�dpc�svmem�total�	available�percent�used�free�pmem�rss�vmsrOrPrQrRrSZpeak_nonpaged_poolZ
nonpaged_poolrVrWZprivate�pfullmem�uss�
pmmap_grouped�path�	pmmap_extzaddr perms � �pio�
read_count�write_count�
read_bytes�write_bytes�other_countZother_bytesi)�maxsizecCs@dj|jd�dd��}tj|�}|t|�d�}tjj||�S)z�Convert paths using native DOS format like:
        "\Device\HarddiskVolume1\Windows\systemew\file.txt"
    into:
        "C:\Windows\systemew\file.txt".
    �\Nr0)�join�split�cextZQueryDosDevice�len�osrk)�sZrawdriveZdriveletter�	remainderr-r-r.�convert_dos_path�s
r}cCs&tr|St|t�r|S|jtt�SdS)zmEncode a unicode string to a byte string by using the default fs
    encoding + "replace" error handler.
    N)r�
isinstance�str�encoderr)r{r-r-r.�
py2_strencode�s

r�cCstj�S)N)rx�getpagesizer-r-r-r.r��sr�c
CsJtj�}|\}}}}|}|}|}||}t|||dd�}	t|||	||�S)z&System virtual memory as a namedtuple.r)�round_)rx�virtual_memrr_)
�memZtotphysZ	availphysZ_totsysZ	_availsysr`Zavailrdrcrbr-r-r.�virtual_memory�sr�cCsptj�}|d}|d}||}|dkrBtj�}td||�}nd}d}||}t|d�}tj||||dd�S)z=Swap system memory as a (total, used, free, sin, sout) tuple.rr/g{�G�z�?gr)rxr�Zswap_percent�int�roundr�sswap)r�Z
total_physZtotal_systemr`Zpercentswaprcrdrbr-r-r.�swap_memory�s
r�cCsPtrt|t�r|jtdd�}tj|�\}}||}t||dd�}tj	||||�S)z'Return disk usage associated with path.�strict)�errorsr)r�)
rr~�bytes�decoderrx�
disk_usagerr�
sdiskusage)rkr`rdrcrbr-r-r.r�sr�cCstj|�}dd�|D�S)zReturn disk partitions.cSsg|]}tj|��qSr-)r�	sdiskpart)�.0�xr-r-r.�
<listcomp>+sz#disk_partitions.<locals>.<listcomp>)rx�disk_partitions)�all�rawlistr-r-r.r�(s
r�cCs<tj�\}}}tdd�ttj��D��}t||||j|j�S)z)Return system CPU times as a named tuple.cSsg|]}t|��qSr-)�sum)r��nr-r-r.r�9szcpu_times.<locals>.<listcomp>)rx�	cpu_timesrY�zip�
per_cpu_timesr]r^)rZr[r\Z
percpu_summedr-r-r.r�3sr�cCs>g}x4tj�D](\}}}}}t|||||�}|j|�qW|S)z6Return system per-CPU times as a list of named tuples.)rxr�rY�append)�retrZr[r\r]r^�itemr-r-r.r�?s
r�cCstj�S)z0Return the number of logical CPUs in the system.)rx�cpu_count_logicalr-r-r-r.r�Hsr�cCstj�S)z-Return the number of CPU cores in the system.)rx�cpu_count_coresr-r-r-r.r�Msr�cCs$tj�\}}}}d}tj||||�S)zReturn CPU statistics.r)rx�	cpu_statsr�	scpustats)rD�
interruptsZ_dpcs�syscalls�soft_interruptsr-r-r.r�Rsr�cCs(tj�\}}d}tjt|�|t|��gS)zMReturn CPU frequency.
    On Windows per-cpu frequency is not supported.
    g)rx�cpu_freqr�scpufreq�float)�currZmax_Zmin_r-r-r.r�[sr�FcCs*tstj�datj�}tdd�|D��S)z�Return the number of processes in the system run queue averaged
    over the last 1, 5, and 15 minutes respectively as a tuple.
    TcSsg|]}t|d��qS)r/)r�)r��loadr-r-r.r�sszgetloadavg.<locals>.<listcomp>)�_loadavg_inititializedrxZinit_loadavg_counter�
getloadavg�tuple)Z	raw_loadsr-r-r.r�gs
r�cCs�|tkr(td|djdd�tD��f��t|\}}tj|||�}t�}xL|D]D}|\}}}	}
}}}
t|||	|
||t|dkr�|
ndd�}|j|�qNWt	|�S)	z�Return socket connections.  If pid == -1 return system-wide
    connections (as opposed to connections opened by one process only).
    z+invalid %r kind argument; choose between %sz, cSsg|]}t|��qSr-)�repr)r�r�r-r-r.r��sz#net_connections.<locals>.<listcomp>rN)�pid���)
r
�
ValueErrorrvrx�net_connections�setr�TCP_STATUSES�add�list)�kind�_pidZfamilies�typesr�r�r��fd�fam�type�laddr�raddr�statusr��ntr-r-r.r�{s(
r�cCs~i}tj�}xl|j�D]`\}}ts@t|t�s8tt|���t|�}|\}}}}t	t
d�r`t
j|�}t
j||||d�||<qW|S)z)Get NIC stats (isup, duplex, speed, mtu).�	NicDuplex�)
rx�net_if_stats�itemsrr~r�AssertionErrorr�r��hasattrrr��	snicstats)r�Zrawdict�namer��isup�duplex�speed�mtur-r-r.r��s

r�cCstj�}tdd�|j�D��S)zsReturn network I/O statistics for every network interface
    installed on the system as a dict of raw tuples.
    cSsg|]\}}t|�|f�qSr-)r�)r��k�vr-r-r.r��sz#net_io_counters.<locals>.<listcomp>)rx�net_io_counters�dictr�)r�r-r-r.r��sr�cCs<g}x2tj�D]&}t|�}t|d�|d<|j|�qW|S)z,Return the addresses associated to each NIC.r)rx�net_if_addrsr�r�r�)r�r�r-r-r.r��sr�cCsdtj�\}}}}|dk}t|d@�}t|d@�}|r8dS|s@|rHtj}n|dkrVtj}tj|||�S)zReturn battery information.r�r5Nr�)rx�sensors_battery�boolr�POWER_TIME_UNLIMITED�POWER_TIME_UNKNOWN�sbattery)Z
acline_status�flagsrb�secsleft�
power_pluggedZ
no_batteryZchargingr-r-r.r��sr�cCs,ttj��}t|t�dkr tS|a|SdS)z:The system boot time expressed in seconds since the epoch.rN)r�rx�	boot_time�abs�_last_btime)r�r-r-r.r��s
r�cCsLg}tj�}x:|D]2}|\}}}t|�}tj|d||d�}|j|�qW|S)z:Return currently connected users as a list of namedtuples.N)rx�usersr�r�suserr�)�retlistr�r�rZ�hostnameZtstampr�r-r-r.r��s

r�ccs.x(tj�D]\}}tt|�t|��Vq
WdS)z*Yields a list of WindowsService instances.N)rxZwinservice_enumerate�WindowsServicer�)r��display_namer-r-r.r�scCst|d�}|j�d|_|S)zBOpen a Windows service and return it as a WindowsService instance.Nr�)r��
_query_config�
_display_name)r�Zservicer-r-r.r �s
c@s�eZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Z	dd�Z
ejdd��Z
dd�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd�Zd d!�Zd"d#�Zd$S)%r�z(Represents an installed Windows service.cCs||_||_dS)N)�_namer�)�selfr�r�r-r-r.�__init__szWindowsService.__init__cCs d|j|jf}d|jj|fS)Nz(name=%r, display_name=%r)z%s%s)r�r��	__class__r*)r��detailsr-r-r.�__str__s
zWindowsService.__str__cCsd|j�t|�fS)Nz
<%s at %s>)r��id)r�r-r-r.�__repr__szWindowsService.__repr__cCst|t�stS|j|jkS)N)r~r��NotImplementedr�)r��otherr-r-r.�__eq__s
zWindowsService.__eq__cCs
||kS)Nr-)r�r�r-r-r.�__ne__szWindowsService.__ne__c
CsH|j��tj|j�\}}}}WdQRXtt|�t|�t|�t|�d�S)N)r��binpath�username�
start_type)�_wrap_exceptionsrxZwinservice_query_configr�r�r�)r�r�r�r�r�r-r-r.r� s
zWindowsService._query_configcCs<|j��tj|j�\}}WdQRX|dkr0d}t||d�S)Nr)r�r�)r�rxZwinservice_query_statusr�r�)r�r�r�r-r-r.�
_query_status-s

zWindowsService._query_statusccs�y
dVWnvtk
r�}zZt|�r@d|j}td|j|d��n0|jtjtjfkrnd|j}td|j|d��n�WYdd}~XnXdS)z{Ctx manager which translates bare OSError and WindowsError
        exceptions into NoSuchProcess and AccessDenied.
        Nz2service %r is not querable (not enough privileges))r�r��msgzservice %r does not exist)	�OSError�is_permission_errr�r�winerrorrxZERROR_INVALID_NAMEZERROR_SERVICE_DOES_NOT_EXISTr)r��errr�r-r-r.r�4s


zWindowsService._wrap_exceptionscCs|jS)z�The service name. This string is how a service is referenced
        and can be passed to win_service_get() to get a new
        WindowsService instance.
        )r�)r�r-r-r.r�MszWindowsService.namecCs|jS)z_The service display name. The value is cached when this class
        is instantiated.
        )r�)r�r-r-r.r�TszWindowsService.display_namecCs|j�dS)zwThe fully qualified path to the service binary/exe file as
        a string, including command line arguments.
        r�)r�)r�r-r-r.r�ZszWindowsService.binpathcCs|j�dS)z,The name of the user that owns this service.r�)r�)r�r-r-r.r�`szWindowsService.usernamecCs|j�dS)zRA string which can either be "automatic", "manual" or
        "disabled".
        r�)r�)r�r-r-r.r�dszWindowsService.start_typecCs|j�dS)zzThe process PID, if any, else None. This can be passed
        to Process class to control the service's process.
        r�)r�)r�r-r-r.r�lszWindowsService.pidcCs|j�dS)zService status as a string.r�)r�)r�r-r-r.r�rszWindowsService.statuscCsttj|j���S)zService long description.)r�rxZwinservice_query_descrr�)r�r-r-r.�descriptionvszWindowsService.descriptioncCs>|j�}|j|j��|j�|d<|j�|d<|j�|d<|S)zUUtility method retrieving all the information above as a
        dictionary.
        r�r�r�)r��updater�r�r�r�)r��dr-r-r.�as_dict|szWindowsService.as_dictN)r*r+r,�__doc__r�r�r�r�r�r�r��
contextlib�contextmanagerr�r�r�r�r�r�r�r�r�rr-r-r-r.r�s$
r�cCs@t|t�st|��|jtjtjfkr(dSt|dd�tjtj	fkS)z*Return True if this is a permission error.Tr�rr�)
r~r�r��errno�EPERM�EACCES�getattrrxZERROR_ACCESS_DENIEDZERROR_PRIVILEGE_NOT_HELD)�excr-r-r.r��s
r�cCsFt|t�st|��t|�r&t||d�S|jtjkr>t||d�S|�dS)z3Convert OSError into NoSuchProcess or AccessDenied.)r�r�N)r~r�r�r�rrZESRCHr)rr�r�r-r-r.�convert_oserror�sr	cstj���fdd��}|S)zDDecorator which converts OSError into NoSuchProcess or AccessDenied.csJy�|f|�|�Stk
rD}zt||j|jd��WYdd}~XnXdS)N)r�r�)r�r	r�r�)r��args�kwargsr�)�funr-r.�wrapper�sz wrap_exceptions.<locals>.wrapper)�	functools�wraps)rr
r-)rr.�wrap_exceptions�srcstj���fdd��}|S)z�Workaround for https://github.com/giampaolo/psutil/issues/875.
    See: https://stackoverflow.com/questions/4457745#4457745.
    cs�d}d}xnt|�D]b}y�|f|�|�Stk
rr}z0|}|jtkr`tj|�t|dd�}w�WYdd}~XqXqWdj�||�}t|j	|j
|d��dS)Ng-C��6?�!r/g{�G�z�?zH{} retried {} times, converted to AccessDenied as it's stillreturning {})r�r�r�)r�WindowsErrorr��ERROR_PARTIAL_COPY�time�sleep�min�formatrr�r�)r�r
r�delay�times�_r�r�)rr-r.r
�s


z)retry_error_partial_copy.<locals>.wrapper)rr)rr
r-)rr.�retry_error_partial_copy�src@s�eZdZdZddddgZdd�Zdd	�Zd
d�Zedd
��Z	dd�Z
eedd���Zee
dd���Zee
dd���Zdd�Zdd�Zedd��Zedd��Zdd�Zed d!��Zed"d#��ZedQd%d&��Zed'd(��ZedRd*d+��Zed,d-��Zed.d/��Zed0d1��Zed2d3��Zed4d5��Zee
d6d7���Zed8d9��Z edSd;d<��Z!ed=d>��Z"ed?d@��Z#edAdB��Z$edCdD��Z%edEdF��Z&edGdH��Z'edIdJ��Z(edKdL��Z)edMdN��Z*edOdP��Z+d$S)T�Processz1Wrapper class around underlying C implementation.�_cacher��_ppidr�cCs||_d|_d|_dS)N)r�r�r)r�r�r-r-r.r��szProcess.__init__cCs|jj|�|jj|�dS)N)�
_proc_info�cache_activate�exe)r�r-r-r.�
oneshot_enterszProcess.oneshot_entercCs|jj|�|jj|�dS)N)r�cache_deactivater!)r�r-r-r.�oneshot_exit
szProcess.oneshot_exitcCs$tj|j�}t|�tt�ks t�|S)zOReturn multiple information about this process as a
        raw tuple.
        )rxZ	proc_infor�ry�	pinfo_mapr�)r�r�r-r-r.rszProcess._proc_infocCs,|jdkrdS|jdkrdStjj|j��S)zbReturn process name, which on Windows is always the final
        part of the executable.
        rzSystem Idle Processr2�System)r�rzrk�basenamer!)r�r-r-r.r�s


zProcess.namecCs�tr`ytj|j�}Wqltk
r\}z,|jdkrJtd|�t|j|j���WYdd}~XqlXntj|j�}t	sxt
|�}|jd�r�t|�S|S)N�z%r translated into AccessDeniedru)
�PYPYrxZproc_exer�rrrrr�rr��
startswithr})r�r!r�r-r-r.r!#s

zProcess.execCs�tjtjkrbytj|jdd�}Wqrtk
r^}z"t|�rLtj|jdd�}n�WYdd}~XqrXntj|jdd�}trz|Sdd�|D�SdS)NT)Zuse_pebFcSsg|]}t|��qSr-)r�)r�r{r-r-r.r�Jsz#Process.cmdline.<locals>.<listcomp>)rxZWINVERZWINDOWS_8_1Zproc_cmdliner�r�r�r)r�r�r�r-r-r.�cmdline8szProcess.cmdlinecCs8tj|j�}|r,tr,t|t�s,tt|���tt	|��S)N)
rxZproc_environr�rr~rr�r�rr�)r�Zustrr-r-r.�environLs
zProcess.environcCs4yt�|jStk
r.t|j|j��YnXdS)N)�ppid_mapr��KeyErrorrr�)r�r-r-r.�ppidTszProcess.ppidcCs�ytj|j�Stk
r�}z�t|�r�td�|j�}|td|td|td|td|td|td|td|td	|td
|tdf
S�WYdd}~XnXdS)Nz*attempting memory_info() fallback (slower)rOrPrQrRrSrTrUrVrWrX)rxZproc_memory_infor�r�r�rrr%)r�r��infor-r-r.�_get_raw_meminfoZs"








zProcess._get_raw_meminfocCs(|j�}|d}|d}t||f|�S)Nr/r4)r1re)r��trfrgr-r-r.�memory_infoqszProcess.memory_infocCs,|j�}tj|j�}|t�9}t||f�S)N)r3rxZproc_memory_ussr�r�rh)r�Z	basic_memrir-r-r.�memory_full_info{s
zProcess.memory_full_infoccs�ytj|j�}Wn2tk
rB}zt||j|j��WYdd}~XnBXx>|D]6\}}}}t|�}tsjt|�}t	|�}||||fVqJWdS)N)
rxZproc_memory_mapsr�r�r	r�r}rr��hex)r��rawr��addrZpermrkrfr-r-r.�memory_maps�s"zProcess.memory_mapscCstj|j�S)N)rx�	proc_killr�)r�r-r-r.�kill�szProcess.killcCsX|tjkrtj|j�n<|ttdt��ttdt��fkrHtj|j|�nd}t	|��dS)NZCTRL_C_EVENTZCTRL_BREAK_EVENTzPonly SIGTERM, CTRL_C_EVENT and CTRL_BREAK_EVENT signals are supported on Windows)
�signal�SIGTERMrxr9r�r�objectrzr:r�)r��sigr�r-r-r.�send_signal�s
zProcess.send_signalNc
Cs�|dkrtj}nt|d�}ttdtj�}|dk	r<|�|nd}ytj|j|�}Wn>tjk
rxt||j|j��Yntj	k
r�d}YnXd}xJt
|j�s�|S|r�|�|kr�t||j|jd��tj|�t|dd�}q�WdS)Ni��	monotonicg-C��6?)r�r�r/g{�G�z�?)
rxZINFINITEr�rrZ	proc_waitr�r	r�ZTimeoutAbandoned�
pid_existsrr)r��timeoutZcext_timeoutZtimerZstop_atZ	exit_coderr-r-r.�wait�s&	


zProcess.waitcCs2|jdkrdStj|j�\}}t|�dt|�S)Nrr2zNT AUTHORITY\SYSTEMru)rr2)r�rxZ
proc_usernamer�)r��domainrZr-r-r.r��s
zProcess.usernameFcCsfytj|j�\}}}|Stk
r`}z.t|�rN|r6�td�|j�tdS�WYdd}~XnXdS)Nz*attempting create_time() fallback (slower)rG)rx�
proc_timesr�r�r�rrr%)r�Z	fast_only�_userZ_system�createdr�r-r-r.rG�szProcess.create_timecCs|j�tdS)NrH)rr%)r�r-r-r.rH�szProcess.num_threadscCs@tj|j�}g}x*|D]"\}}}tj|||�}|j|�qW|S)N)rxZproc_threadsr�r�pthreadr�)r�r�r�Z	thread_id�utimeZstime�ntupler-r-r.�threads�szProcess.threadscCs|ytj|j�\}}}WnTtk
rj}z8t|�s2�td�|j�}|td}|td}WYdd}~XnXtj	||dd�S)Nz(attempting cpu_times() fallback (slower)rErFg)
rxrEr�r�r�rrr%r�	pcputimes)r�rZr[Z_createdr�r0r-r-r.r��szProcess.cpu_timescCstj|jd�dS)NT)rx�proc_suspend_or_resumer�)r�r-r-r.�suspendszProcess.suspendcCstj|jd�dS)NF)rxrMr�)r�r-r-r.�resumeszProcess.resumecCs4|jdkrt|j|j��tj|j�}ttjj|��S)Nrr2)rr2)	r�rr�rxZproc_cwdr�rzrk�normpath)r�rkr-r-r.�cwd
s
zProcess.cwdcCsh|jdkrgSt�}tj|j�}x>|D]6}t|�}t|�r&tsFt|�}tj	|d�}|j
|�q&Wt|�S)Nrr2r)rr2r�)r�r�rxZproc_open_filesr}r
rr�r�	popenfiler�r�)r�r�Zraw_file_names�_filerJr-r-r.�
open_filess

zProcess.open_files�inetcCst||jd�S)N)r�)r�r�)r�r�r-r-r.r�'szProcess.net_connectionscCs tj|j�}tdk	rt|�}|S)N)rxZproc_priority_getr��enumr))r��valuer-r-r.�nice_get+szProcess.nice_getcCstj|j|�S)N)rxZproc_priority_setr�)r�rWr-r-r.�nice_set2szProcess.nice_setcCs tj|j�}tdk	rt|�}|S)N)rxZproc_io_priority_getr�rVr1)r�r�r-r-r.�
ionice_get6szProcess.ionice_getcCs>|rd}t|��|ttttfkr,td|��tj|j|�dS)Nz&value argument not accepted on Windowsz%s is not a valid priority)	�	TypeErrorr!r"r#r$r�rxZproc_io_priority_setr�)r��ioclassrWr�r-r-r.�
ionice_set=szProcess.ionice_setcCs�ytj|j�}Wn|tk
r�}z`t|�s,�td�|j�}|td|td|td|td|td|tdf}WYdd}~XnXt|�S)Nz*attempting io_counters() fallback (slower)rIrJrKrLrMrN)	rxZproc_io_countersr�r�r�rrr%rn)r�r�r�r0r-r-r.�io_countersKs




 zProcess.io_counterscCs tj|j�}|rtjStjSdS)N)rxZproc_is_suspendedr�r�STATUS_STOPPED�STATUS_RUNNING)r��	suspendedr-r-r.r�^szProcess.statuscCsdd�}tj|j�}||�S)Ncs�fdd�td�D�S)Ncsg|]}d|>�@r|�qS)rr-)r��i)r�r-r.r�iszBProcess.cpu_affinity_get.<locals>.from_bitmask.<locals>.<listcomp>�@)r)r�r-)r�r.�from_bitmaskhsz.Process.cpu_affinity_get.<locals>.from_bitmask)rxZproc_cpu_affinity_getr�)r�rd�bitmaskr-r-r.�cpu_affinity_getfszProcess.cpu_affinity_getcCsrdd�}tttt����}x<|D]4}||kr t|ttf�sHtd|��q td|��q W||�}t	j
|j|�dS)NcSs2|std|��d}x|D]}|d|O}qW|S)Nzinvalid argument %rrr/)r�)Zls�out�br-r-r.�
to_bitmaskps
z,Process.cpu_affinity_set.<locals>.to_bitmaskz&invalid CPU %r; an integer is requiredzinvalid CPU %r)r�rryr�r~r�rr[r�rxZproc_cpu_affinity_setr�)r�rWriZallcpusZcpurer-r-r.�cpu_affinity_setns
zProcess.cpu_affinity_setcCsVytj|j�Stk
rP}z(t|�r>td�|j�tdS�WYdd}~XnXdS)Nz*attempting num_handles() fallback (slower)rC)rxZproc_num_handlesr�r�r�rrr%)r�r�r-r-r.rC�szProcess.num_handlescCs|j�td}tj|d�S)NrDr)rr%r�pctxsw)r�rDr-r-r.�num_ctx_switches�szProcess.num_ctx_switches)N)F)rU),r*r+r,r�	__slots__r�r"r$rrr�rr!rr+r,r/r1r3r4r8r:r?rCr�rGrHrKr�rNrOrQrTr�rXrYrZr]r^r�rfrjrCrlr-r-r-r.r�sZ	
*		
rr�r�)rir�)r�)NN)�rrrrrzr;�sysr�collectionsrr�rrrrrr	r
rrr
rrrr�_compatrrrrrrrrrrrrrx�ImportErrorr�r�lowerr*�getwindowsversionr��RuntimeErrorrVZ__extra__all__r%r�builtin_module_namesr)r&�IntEnumr(ZMIB_TCP_STATE_ESTAB�CONN_ESTABLISHEDZMIB_TCP_STATE_SYN_SENT�
CONN_SYN_SENTZMIB_TCP_STATE_SYN_RCVD�
CONN_SYN_RECVZMIB_TCP_STATE_FIN_WAIT1�CONN_FIN_WAIT1ZMIB_TCP_STATE_FIN_WAIT2�CONN_FIN_WAIT2ZMIB_TCP_STATE_TIME_WAIT�CONN_TIME_WAITZMIB_TCP_STATE_CLOSED�
CONN_CLOSEZMIB_TCP_STATE_CLOSE_WAIT�CONN_CLOSE_WAITZMIB_TCP_STATE_LAST_ACK�
CONN_LAST_ACKZMIB_TCP_STATE_LISTEN�CONN_LISTENZMIB_TCP_STATE_CLOSING�CONN_CLOSINGZMIB_TCP_STATE_DELETE_TCBZPSUTIL_CONN_NONE�	CONN_NONEr�r)�globalsr��__members__r!r"r#r$r1r�r%rYr_re�_fieldsrhrjrvrlrnr}r�r�r�r�Zdisk_io_countersr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rr r�ZpidsrAr-r�r	rrrr-r-r-r.�<module>s8

	




	


			
0




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