%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /proc/227033/root/opt/alt/python27/lib64/python2.7/site-packages/psutil/
Upload File :
Create Path :
Current File : //proc/227033/root/opt/alt/python27/lib64/python2.7/site-packages/psutil/__init__.pyc

�
���Rc#@ s%dZddlmZdZegejd�D]Zee�^q/�Zddddd	d
ddd
ddddddddddddddddddd d!d"d#d$d%d&d'g#Z	dd(l
Z
dd(lZdd(lZdd(l
Z
dd(lZdd(lZdd(lZydd(lZWnek
r6eZnXdd)lmZmZmZmZdd*lmZdd+lmZmZmZmZm Z!m"Z#dd,lm$Z%m&Z'm(Z)m*Z+m,Z-dd-lm.Z.m/Z/m0Z0m1Z1m2Z2m3Z3m4Z4m5Z5m6Z6m7Z7e
j8j9d.�ridd(l:j;Z<dd/l:m=Z=m>Z>m?Z?m@Z@mAZAmBZBe<j=Z=e<j>Z>n�e
j8j9d0�r�dd(lCjDZ<dd1lCmEZEmFZFmGZGmHZHmIZImJZJn[e
j8j9d2�r�dd(lKjLZ<n7e
j8j9d3�rdd(lMjNZ<neOd4e
j8��e	jPe<jQ�e<jRZRe<jSZSe<jTZTd5�ZUdeVfd6��YZWdeWfd7��YZXe<jYZYe<jZZZiZ[d8�Z\e]d9�Z^e^�a_e^d:e`�aad;e]d<�Zbt_actaadeaed;e]d=�Zfd>�Zgd?�Zhd@�Zie]dA�Zje]dB�Zke]dC�ZldD�ZmdE�Zne%�dF��Zoe%�dG��Zpe%dH�dI��Zqe%dJ�dK��Zre%dL�dM��Zse%dN�dO��Zte%dP�dQ��Zue%dR�dS��ZvdT�ZwexdUkr�ew�n[[[e
jdVdWfkr![nd(S(Xs�psutil is a module providing convenience functions for managing
processes and gather system information in a portable way by using
Python.
i����(tdivisions0.7.0t.tErrort
NoSuchProcesstAccessDeniedtTimeoutExpiredtNUM_CPUStTOTAL_PHYMEMt	BOOT_TIMEtversion_infot__version__tSTATUS_RUNNINGtSTATUS_IDLEtSTATUS_SLEEPINGtSTATUS_DISK_SLEEPtSTATUS_STOPPEDtSTATUS_TRACING_STOPt
STATUS_ZOMBIEtSTATUS_DEADt
STATUS_WAKINGt
STATUS_LOCKEDtProcesstPopent
pid_existstget_pid_listtprocess_itertvirtual_memorytswap_memoryt	cpu_timestcpu_percenttcpu_times_percenttnetwork_io_counterstdisk_io_counterstdisk_partitionst
disk_usaget	get_userst
get_boot_timeN(RRRR(tcached_property(tpropertytcallabletdefaultdictt
namedtupletwrapstPY3(t
deprecatedtnt_disk_iostatt
nt_net_iostatt
nt_sysmeminfot
isfile_strict(
RRR
RRRRRRRtlinux(tphymem_bufferst
cached_phymemtIOPRIO_CLASS_NONEtIOPRIO_CLASS_RTtIOPRIO_CLASS_BEtIOPRIO_CLASS_IDLEtwin32(tABOVE_NORMAL_PRIORITY_CLASStBELOW_NORMAL_PRIORITY_CLASStHIGH_PRIORITY_CLASStIDLE_PRIORITY_CLASStNORMAL_PRIORITY_CLASStREALTIME_PRIORITY_CLASStdarwintfreebsdsplatform %s is not supportedc st���fd��}|S(spDecorator which raises NoSuchProcess in case a process is no
    longer running or its PID has been reused.
    c s7|j�s't|j|jj��n�|||�S(N(t
is_runningRtpidt_platform_implt
_process_name(tselftargstkwargs(tfun(sB/opt/alt/python27/lib64/python2.7/site-packages/psutil/__init__.pytwrapperhs(t_wraps(RHRI((RHsB/opt/alt/python27/lib64/python2.7/site-packages/psutil/__init__.pyt_assert_pid_not_reuseddscB s�eZdZd�Zd�Zd�Zgd7d�Zee	d���Z
ed��Zed��Ze
d��Ze
d	��Zed
��Zed��Zejdkr�ed
��Zed��Zed��Zned��Ze
d��Zd�Zeejd�r)d�Znd�Ze	d��Zeejd�rkd�Zd7d�Z neejd�r�d�Z!d�Z"nejdkr�d�Z#nejdkr�d�Z$nd �Z%d!�Z&d"�Z'e	e(d#��Z)d$d%�Z*d&�Z+d'�Z,d(�Z-d)�Z.e/d*�Z0d+�Z1d,d-�Z2d.�Z3e	d/��Z4e	d0��Z5e	d1��Z6d2�Z7e	d3��Z8d7d4�Z9ed5��Z:e:j;d6��Z:RS(8sRepresents an OS process.cC s�ts-t|ttf�s-td��q-n|dkrHtd��n||_t|_d|_
tj|�|_
d|_d|_y|jWn7tk
r�n'tk
r�t|dd|��nXdS(s�Create a new Process object for the given pid.
        Raises NoSuchProcess if pid does not exist.

        Note that most of the methods of this class do not make sure
        the PID of the process being queried has been reused.
        That means you might end up retrieving an information referring
        to another process in case the original one this instance
        refers to is gone in the meantime.

        The only exceptions for which process identity is pre-emptively
        checked are:
         - parent
         - get_children()
         - set_nice()
         - suspend()
         - resume()
         - send_signal()
         - terminate()
         - kill()

        To prevent this problem for all other methods you can:
          - use is_running() before querying the process
          - if you're continuously iterating over a set of Process
            instances use process_iter() which pre-emptively checks
            process identity for every yielded instance
        spid must be an integerispid must be a positive integersno process found with pid %sN(t_PY3t
isinstancetinttlongt	TypeErrort
ValueErrort_pidtFalset_gonetNonet_ppidt_psplatformRRCt_last_sys_cpu_timest_last_proc_cpu_timestcreate_timeRR(RERB((sB/opt/alt/python27/lib64/python2.7/site-packages/psutil/__init__.pyt__init__ss"					

cC s�y|j}t|j�}Wn;tk
r<d|j}n.tk
rYd|j}nXd||f}d|jj|jj|fS(Ns(pid=%s (terminated))s(pid=%s)s(pid=%s, name=%s)s%s.%s%s(RBtreprtnameRRt	__class__t
__module__t__name__(RERBR]tdetails((sB/opt/alt/python27/lib64/python2.7/site-packages/psutil/__init__.pyt__str__�s	

cC sd|j�t|�fS(Ns
<%s at %s>(Rbtid(RE((sB/opt/alt/python27/lib64/python2.7/site-packages/psutil/__init__.pyt__repr__�scC sotddddddddd	d
dg�}t�}x2t|pKt|��D]}|jd�rjqOn|jd
�rqOn||kr�qOnyOt||�}t|�r�|dkr�|dd�}q�|�}n|}Wn6tk
r�|}n tk
r|rO�qOqOnX|jd�r]|ddkrE|d}q]|dkr]d}q]n|||<qOW|S(s�Utility method returning process information as a hashable
        dictionary.

        If 'attrs' is specified it must be a list of strings reflecting
        available Process class's attribute names (e.g. ['get_cpu_times',
        'name']) else all public (read only) attributes are assumed.

        'ad_value' is the value which gets assigned to a dict key in case
        AccessDenied exception is raised when retrieving that particular
        process information.
        tsend_signaltsuspendtresumet	terminatetkilltwaitRAtas_dicttparenttget_childrentnicet_tset_tget_cpu_percenttintervalitgetiitgetcwdtcwd(tsettdicttdirt
startswithtgetattrR'RtNotImplementedError(REtattrstad_valuetexcluded_namestretdictR]tattrtret((sB/opt/alt/python27/lib64/python2.7/site-packages/psutil/__init__.pyRk�s>	

	

cC sV|j}|dk	rRy&t|�}|j|jkr:|SWqRtk
rNqRXndS(s�Return the parent process as a Process object pre-emptively
        checking whether PID has been reused.
        If no parent is known return None.
        N(tppidRURRZR(RER�Rl((sB/opt/alt/python27/lib64/python2.7/site-packages/psutil/__init__.pyRl�s	
cC s|jS(sThe process pid.(RR(RE((sB/opt/alt/python27/lib64/python2.7/site-packages/psutil/__init__.pyRB�scC sKtjdkr|jj�S|jdkr@|jj�|_n|jSdS(sThe process parent pid.tposixN(tosR]RCtget_process_ppidRVRU(RE((sB/opt/alt/python27/lib64/python2.7/site-packages/psutil/__init__.pyR��s


cC s�|jj�}tjdkryy
|j}Wntk
r>qyX|rytjj|d�}|j|�rv|}qvqyn||j_	|S(sThe process name.R�i(
RCtget_process_nameR�R]tcmdlineRtpathtbasenameRyRD(RER]R�t
extended_name((sB/opt/alt/python27/lib64/python2.7/site-packages/psutil/__init__.pyR]s

c s��fd�}y�jj�}Wn+tk
rOtj�d}|d|�SX|s�y|d|�}Wq�tk
r|q�Xn|SdS(s9The process executable path. May also be an empty string.c s��j}|r�ttd�r�ttd�r�|d}tjj|�}tjj|�r�tjj|�r�tj|tj�r�|Snt	|t
�r�|�n|S(NtaccesstX_OKi(R�thasattrR�R�trealpathtisabstisfileR�R�RMR(tfallbackR�texetrexe(RE(sB/opt/alt/python27/lib64/python2.7/site-packages/psutil/__init__.pytguess_it(s	$
$	iR�N(RCtget_process_exeRtsystexc_info(RER�R�terr((REsB/opt/alt/python27/lib64/python2.7/site-packages/psutil/__init__.pyR�%s

cC s
|jj�S(s.The command line process has been called with.(RCtget_process_cmdline(RE((sB/opt/alt/python27/lib64/python2.7/site-packages/psutil/__init__.pyR�FscC s
|jj�S(s2The process current status as a STATUS_* constant.(RCtget_process_status(RE((sB/opt/alt/python27/lib64/python2.7/site-packages/psutil/__init__.pytstatusKsR�cC s
|jj�S(sgReturn a named tuple denoting the process real,
            effective, and saved user ids.
            (RCtget_process_uids(RE((sB/opt/alt/python27/lib64/python2.7/site-packages/psutil/__init__.pytuidsRscC s
|jj�S(shReturn a named tuple denoting the process real,
            effective, and saved group ids.
            (RCtget_process_gids(RE((sB/opt/alt/python27/lib64/python2.7/site-packages/psutil/__init__.pytgidsYscC s
|jj�S(sVThe terminal associated with this process, if any,
            else None.
            (RCtget_process_terminal(RE((sB/opt/alt/python27/lib64/python2.7/site-packages/psutil/__init__.pytterminal`scC sQtjdkr@tdkr*td��ntj|jj�jS|j	j
�SdS(stThe name of the user that owns the process.
        On UNIX this is calculated by using *real* process uid.
        R�s0requires pwd module shipped with standard pythonN(R�R]tpwdRUtImportErrortgetpwuidR�trealtpw_nameRCtget_process_username(RE((sB/opt/alt/python27/lib64/python2.7/site-packages/psutil/__init__.pytusernamegs
cC s
|jj�S(ssThe process creation time as a floating point number
        expressed in seconds since the epoch, in UTC.
        (RCtget_process_create_time(RE((sB/opt/alt/python27/lib64/python2.7/site-packages/psutil/__init__.pyRZtscC s
|jj�S(sTReturn a string representing the process current working
        directory.
        (RCtget_process_cwd(RE((sB/opt/alt/python27/lib64/python2.7/site-packages/psutil/__init__.pyRt{stget_process_io_counterscC s
|jj�S(s�Return process I/O statistics as a namedtuple including
            the number of read/write calls performed and the amount of
            bytes read and written by the process.
            (RCR�(RE((sB/opt/alt/python27/lib64/python2.7/site-packages/psutil/__init__.pytget_io_counters�scC s
|jj�S(s Get process niceness (priority).(RCtget_process_nice(RE((sB/opt/alt/python27/lib64/python2.7/site-packages/psutil/__init__.pytget_nice�scC s|jj|�S(s[Set process niceness (priority) pre-emptively checking
        whether PID has been reused.(RCtset_process_nice(REtvalue((sB/opt/alt/python27/lib64/python2.7/site-packages/psutil/__init__.pytset_nice�stget_process_ionicecC s
|jj�S(sReturn process I/O niceness (priority).

            On Linux this is a (ioclass, value) namedtuple.
            On Windows it's an integer which can be equal to 2 (normal),
            1 (low) or 0 (very low).

            Available on Linux and Windows > Vista only.
            (RCR�(RE((sB/opt/alt/python27/lib64/python2.7/site-packages/psutil/__init__.pyt
get_ionice�s	cC s|jj||�S(s�Set process I/O niceness (priority).

            On Linux 'ioclass' is one of the IOPRIO_CLASS_* constants.
            'value' is a number which goes from 0 to 7. The higher the
            value, the lower the I/O priority of the process.

            On Windows only 'ioclass' is used and it can be set to 2
            (normal), 1 (low) or 0 (very low).

            Available on Linux and Windows > Vista only.
            (RCtset_process_ionice(REtioclassR�((sB/opt/alt/python27/lib64/python2.7/site-packages/psutil/__init__.pyt
set_ionice�stget_process_cpu_affinitycC s
|jj�S(s!Get process current CPU affinity.(RCR�(RE((sB/opt/alt/python27/lib64/python2.7/site-packages/psutil/__init__.pytget_cpu_affinity�scC s|jj|�S(s�Set process current CPU affinity.
            'cpus' is a list of CPUs for which you want to set the
            affinity (e.g. [0, 1]).
            (RCtset_process_cpu_affinity(REtcpus((sB/opt/alt/python27/lib64/python2.7/site-packages/psutil/__init__.pytset_cpu_affinity�stntcC s
|jj�S(s\Return the number of handles opened by this process
            (Windows only).
            (RCtget_num_handles(RE((sB/opt/alt/python27/lib64/python2.7/site-packages/psutil/__init__.pyR��scC s
|jj�S(scReturn the number of file descriptors opened by this
            process (POSIX only).
            (RCtget_num_fds(RE((sB/opt/alt/python27/lib64/python2.7/site-packages/psutil/__init__.pyR��scC s
|jj�S(shReturn the number voluntary and involuntary context switches
        performed by this process.
        (RCtget_num_ctx_switches(RE((sB/opt/alt/python27/lib64/python2.7/site-packages/psutil/__init__.pyR��scC s
|jj�S(s2Return the number of threads used by this process.(RCtget_process_num_threads(RE((sB/opt/alt/python27/lib64/python2.7/site-packages/psutil/__init__.pytget_num_threads�scC s
|jj�S(s�Return threads opened by process as a list of namedtuples
        including thread id and thread CPU times (user/system).
        (RCtget_process_threads(RE((sB/opt/alt/python27/lib64/python2.7/site-packages/psutil/__init__.pytget_threads�sc	C sVg}|srxCt�D]U}y;|j|jkrV|j|jkrV|j|�qVnWqtk
rjqXqWn�tt�}x=t�D]2}y||jj|�Wq�tk
r�q�Xq�W|jg}x�|D]}}xt||D]h}y|j|jk}Wntk
rq�X|r�|j|�|j|krJ|j|j�qJq�q�Wq�W|S(s�Return the children of this process as a list of Process
        objects pre-emptively checking whether PID has been reused.
        If recursive is True return all the parent descendants.

        Example (A == this process):

         A ─┐
            │
            ├─ B (child) ─┐
            │             └─ X (grandchild) ─┐
            │                                └─ Y (great grandchild)
            ├─ C (child)
            └─ D (child)

        >>> p.get_children()
        B, C, D
        >>> p.get_children(recursive=True)
        B, X, Y, C, D

        Note that in the example above if process X disappears
        process Y won't be returned either as the reference to
        process A is lost.
        (RR�RBRZtappendRR(tlist(	REt	recursiveR�tpttablet	checkpidsRBtchildtintime((sB/opt/alt/python27/lib64/python2.7/site-packages/psutil/__init__.pyRm�s6




g�������?cC sb|dk	o|dk}|rjtt��}|jj�}tj|�tt��}|jj�}n^|j}|j}tt��}|jj�}|dks�|dkr�||_||_dS|j	|j	|j
|j
}||}||_||_y||d}	Wntk
r(dSX|	t}
t
jdkrU|
dkrUdSnt|
d�S(sReturn a float representing the current process CPU
        utilization as a percentage.

        When interval is > 0.0 compares process times to system CPU
        times elapsed before and after the interval (blocking).

        When interval is 0.0 or None compares process times to system
        CPU times elapsed since last call, returning immediately
        (non-blocking).
        In this case is recommended for accuracy that this function
        be called with at least 0.1 seconds between calls.

        Examples:

          >>> p = psutil.Process(os.getpid())
          >>> # blocking
          >>> p.get_cpu_percent(interval=1)
          2.0
          >>> # non-blocking (percentage since last call)
          >>> p.get_cpu_percent(interval=0)
          2.9
          >>>
        gidR�gY@iN(RUtsumRRCt
get_cpu_timesttimetsleepRXRYtusertsystemtZeroDivisionErrorRR�R]tround(RERrtblockingtst1tpt1tst2tpt2t
delta_proct
delta_timetoverall_percenttsingle_cpu_percent((sB/opt/alt/python27/lib64/python2.7/site-packages/psutil/__init__.pyRq s8
				
		

cC s
|jj�S(s{Return a tuple whose values are process CPU user and system
        times. The same as os.times() but per-process.
        (RCR�(RE((sB/opt/alt/python27/lib64/python2.7/site-packages/psutil/__init__.pyR�`scC s
|jj�S(s
Return a tuple representing RSS (Resident Set Size) and VMS
        (Virtual Memory Size) in bytes.

        On UNIX RSS and VMS are the same values shown by ps.

        On Windows RSS and VMS refer to "Mem Usage" and "VM Size" columns
        of taskmgr.exe.
        (RCtget_memory_info(RE((sB/opt/alt/python27/lib64/python2.7/site-packages/psutil/__init__.pyR�fs	cC s
|jj�S(s�Return a namedtuple with variable fields depending on the
        platform representing extended memory information about
        the process. All numbers are expressed in bytes.
        (RCtget_ext_memory_info(RE((sB/opt/alt/python27/lib64/python2.7/site-packages/psutil/__init__.pyR�qscC sB|jj�d}y|tt�dSWntk
r=dSXdS(s�Compare physical system memory to process resident memory
        (RSS) and calculate process memory utilization as a percentage.
        iidgN(RCR�tfloatRR�(REtrss((sB/opt/alt/python27/lib64/python2.7/site-packages/psutil/__init__.pytget_memory_percentxs

c	C s�|jj�}|r�i}xa|D]Y}|d}|d}y!td�|||�||<Wq"tk
rz|||<q"Xq"W|jj}g|D]}||||�^q�S|jj}g|D]}||�^q�SdS(s�Return process's mapped memory regions as a list of nameduples
        whose fields are variable depending on the platform.

        If 'grouped' is True the mapped regions with the same 'path'
        are grouped together and the different memory fields are summed.

        If 'grouped' is False every mapped region is shown as a single
        entity and the namedtuple will also include the mapped region's
        address space ('addr') and permission set ('perms').
        iicS s||S(N((txty((sB/opt/alt/python27/lib64/python2.7/site-packages/psutil/__init__.pyt<lambda>�sN(RCtget_memory_mapstmaptKeyErrortnt_mmap_groupedtnt_mmap_ext(	REtgroupedtittdttuplR�tnumsR�R�((sB/opt/alt/python27/lib64/python2.7/site-packages/psutil/__init__.pyR��s


!
$cC s
|jj�S(s�Return files opened by process as a list of namedtuples
        including absolute file name and file descriptor number.
        (RCtget_open_files(RE((sB/opt/alt/python27/lib64/python2.7/site-packages/psutil/__init__.pyR��stinetcC s|jj|�S(s�Return connections opened by process as a list of namedtuples.
        The kind parameter filters for connections that fit the following
        criteria:

        Kind Value      Connections using
        inet            IPv4 and IPv6
        inet4           IPv4
        inet6           IPv6
        tcp             TCP
        tcp4            TCP over IPv4
        tcp6            TCP over IPv6
        udp             UDP
        udp4            UDP over IPv4
        udp6            UDP over IPv6
        unix            UNIX socket (both UDP and TCP protocols)
        all             the sum of all the possible families and protocols
        (RCtget_connections(REtkind((sB/opt/alt/python27/lib64/python2.7/site-packages/psutil/__init__.pyR��scC sI|jr
tSy|j|jj�kSWntk
rDt|_tSXdS(s�Return whether this process is running.
        It also checks if PID has been reused by another process in
        which case returns False.
        N(RTRSRZRCR�RtTrue(RE((sB/opt/alt/python27/lib64/python2.7/site-packages/psutil/__init__.pyRA�s	
	cC s�tjdkr�ytj|j|�Wq�tk
r�tj�d}|jj}|j	t	j
kr�t|_t
|j|��n|j	t	jkr�t|j|��n�q�Xn+|tjkr�|jj�ntd��dS(s�Send a signal to process pre-emptively checking whether
        PID has been reused (see signal module constants) .
        On Windows only SIGTERM is valid and is treated as an alias
        for kill().
        R�is$only SIGTERM is supported on WindowsN(R�R]RiRBtOSErrorR�R�RCRDterrnotESRCHR�RTRtEPERMRtsignaltSIGTERMtkill_processRQ(REtsigR�R]((sB/opt/alt/python27/lib64/python2.7/site-packages/psutil/__init__.pyRe�s
	
cC s6t|jd�r"|jj�n|jtj�dS(s�Suspend process execution with SIGSTOP pre-emptively checking
        whether PID has been reused.
        On Windows it suspends all process threads.
        tsuspend_processN(R�RCR�ReR�tSIGSTOP(RE((sB/opt/alt/python27/lib64/python2.7/site-packages/psutil/__init__.pyRf�scC s6t|jd�r"|jj�n|jtj�dS(s�Resume process execution with SIGCONT pre-emptively checking
        whether PID has been reused.
        On Windows it resumes all process threads.
        tresume_processN(R�RCR�ReR�tSIGCONT(RE((sB/opt/alt/python27/lib64/python2.7/site-packages/psutil/__init__.pyRg�scC s|jtj�dS(s�Terminate the process with SIGTERM pre-emptively checking
        whether PID has been reused.
        On Windows this is an alias for kill().
        N(ReR�R�(RE((sB/opt/alt/python27/lib64/python2.7/site-packages/psutil/__init__.pyRh�scC s3tjdkr"|jtj�n
|jj�dS(saKill the current process with SIGKILL pre-emptively checking
        whether PID has been reused.R�N(R�R]ReR�tSIGKILLRCR�(RE((sB/opt/alt/python27/lib64/python2.7/site-packages/psutil/__init__.pyRiscC s8|dk	r(|dkr(td��n|jj|�S(s�Wait for process to terminate and, if process is a children
        of the current one also return its exit code, else None.
        is"timeout must be a positive integerN(RURQRCtprocess_wait(REttimeout((sB/opt/alt/python27/lib64/python2.7/site-packages/psutil/__init__.pyRjscC s)d}tj|dtdd�|j�S(s\Get or set process niceness (priority).
        Deprecated, use get_nice() instead.
        sBthis property is deprecated; use Process.get_nice() method insteadtcategoryt
stackleveli(twarningstwarntDeprecationWarningR�(REtmsg((sB/opt/alt/python27/lib64/python2.7/site-packages/psutil/__init__.pyRnscC s,d}tj|dtdd�|j|�S(NsBthis property is deprecated; use Process.set_nice() method insteadRRi(RRRR�(RER�R((sB/opt/alt/python27/lib64/python2.7/site-packages/psutil/__init__.pyRnsN(<R`R_t__doc__R[RbRdRURkR&RKRlRBR�R%R]R�R�R�R�R�R�R�R�RZRtR�RWRR�R�R�R�R�R�R�R�R�R�R�R�RSRmRqR�R�R�R�R�R�R�R�RAReRfRgRhRiRjRntsetter(((sB/opt/alt/python27/lib64/python2.7/site-packages/psutil/__init__.pyRpsp	0	
	1!
							@@				
		

		
	cB s)eZdZd�Zd�Zd�ZRS(s�A more convenient interface to stdlib subprocess module.
    It starts a sub process and deals with it exactly as when using
    subprocess.Popen class but in addition also provides all the
    property and methods of psutil.Process class in a single interface:

      >>> import psutil
      >>> from subprocess import PIPE
      >>> p = psutil.Popen(["/usr/bin/python", "-c", "print 'hi'"], stdout=PIPE)
      >>> p.name
      'python'
      >>> p.uids
      user(real=1000, effective=1000, saved=1000)
      >>> p.username
      'giampaolo'
      >>> p.communicate()
      ('hi
', None)
      >>> p.terminate()
      >>> p.wait(timeout=2)
      0
      >>>

    For method names common to both classes such as kill(), terminate()
    and wait(), psutil.Process implementation takes precedence.

    For a complete documentation refers to:
    http://docs.python.org/library/subprocess.html
    cO s�tj||�|_|jj|_t|_d|_t	j
|j�|_d|_d|_
y|jWn=tk
r{n-tk
r�t|jdd|j��nXdS(Nsno process found with pid %s(t
subprocessRt_Popen__subprocRBRRRSRTRURVRWRRCRXRYRZRR(RERFRG((sB/opt/alt/python27/lib64/python2.7/site-packages/psutil/__init__.pyR[Es				

cC s#tttt�ttj���S(N(R�RvRxRR(RE((sB/opt/alt/python27/lib64/python2.7/site-packages/psutil/__init__.pyt__dir__UscC ssytj||�SWnXtk
rnytj|j|�SWqotk
rjtd|jj|f��qoXnXdS(Ns!%s instance has no attribute '%s'(tobjectt__getattribute__tAttributeErrorRR^R`(RER]((sB/opt/alt/python27/lib64/python2.7/site-packages/psutil/__init__.pyRXs

(R`R_R	R[R
R(((sB/opt/alt/python27/lib64/python2.7/site-packages/psutil/__init__.pyR(s		cc sd�}d�}tt��}ttj��}||}||}x|D]}||�qNWx�tttj��ttj|�j���D]|\}}y=|dkr�||�Vn|j
�r�|Vn||�VWq�tk
r�||�q�tk
r|Vq�Xq�WdS(s�Return a generator yielding a Process class instance for all
    running processes on the local machine.

    Every new Process instance is only created once and then cached
    into an internal table which is updated every time this is used.

    Cached Process instances are checked for identity so that you're
    safe in case a PID has been reused by another process, in which
    case the cached instance is updated.

    The sorting order in which processes are yielded is based on
    their PIDs.
    cS st|�}|t|j<|S(N(Rt_pmapRB(RBtproc((sB/opt/alt/python27/lib64/python2.7/site-packages/psutil/__init__.pytaddzs
cS stj|d�dS(N(RtpopRU(RB((sB/opt/alt/python27/lib64/python2.7/site-packages/psutil/__init__.pytremovesN(
RvRRtkeystsortedR�titemsRwtfromkeysRURARR(RRtatbtnew_pidst	gone_pidsRBR((sB/opt/alt/python27/lib64/python2.7/site-packages/psutil/__init__.pyRls(		


)


cC s|stj�Stj�SdS(s�Return system-wide CPU times as a namedtuple object.
    Every CPU time represents the time CPU has spent in the given mode.
    The attributes availability varies depending on the platform.
    Here follows a list of all available attributes:
     - user
     - system
     - idle
     - nice (UNIX)
     - iowait (Linux)
     - irq (Linux, FreeBSD)
     - softirq (Linux)
     - steal (Linux >= 2.6.11)
     - guest (Linux >= 2.6.24)
     - guest_nice (Linux >= 3.2.0)

    When percpu is True return a list of nameduples for each CPU.
    First element of the list refers to first CPU, second element
    to second CPU and so on.
    The order of the list is consistent across calls.
    N(RWtget_system_cpu_timestget_system_per_cpu_times(tpercpu((sB/opt/alt/python27/lib64/python2.7/site-packages/psutil/__init__.pyR�s
R g�������?cC s�|dk	o|dk}d�}|sb|rFt�}tj|�nt}t�a||t�Sg}|r�tdt�}tj|�nt}tdt�ax3t|t�D]"\}}|j|||��q�W|SdS(sReturn a float representing the current system-wide CPU
    utilization as a percentage.

    When interval is > 0.0 compares system CPU times elapsed before
    and after the interval (blocking).

    When interval is 0.0 or None compares system CPU times elapsed
    since last call or module import, returning immediately.
    In this case is recommended for accuracy that this function be
    called with at least 0.1 seconds between calls.

    When percpu is True returns a list of floats representing the
    utilization as a percentage for each CPU.
    First element of the list refers to first CPU, second element
    to second CPU and so on.
    The order of the list is consistent across calls.

    Examples:

      >>> # blocking, system-wide
      >>> psutil.cpu_percent(interval=1)
      2.0
      >>>
      >>> # blocking, per-cpu
      >>> psutil.cpu_percent(interval=1, percpu=True)
      [2.0, 1.0]
      >>>
      >>> # non-blocking (percentage since last call)
      >>> psutil.cpu_percent(interval=0)
      2.9
      >>>
    gc	S sqt|�}||j}t|�}||j}||krBdS||}||}||d}t|d�S(Ngidi(R�tidleR�(	tt1tt2tt1_alltt1_busytt2_alltt2_busyt
busy_deltat	all_deltat	busy_perc((sB/opt/alt/python27/lib64/python2.7/site-packages/psutil/__init__.pyt	calculate�s



R N(	RURR�R�t_last_cpu_timesR�t_last_per_cpu_timestzipR�(RrR R�R+R"R�ttot1R#((sB/opt/alt/python27/lib64/python2.7/site-packages/psutil/__init__.pyR�s$#			
cC s�|dk	o|dk}d�}|sb|rFt�}tj|�nt}t�a||t�Sg}|r�tdt�}tj|�nt}tdt�ax3t|t�D]"\}}|j|||��q�W|SdS(s�Same as cpu_percent() but provides utilization percentages
    for each specific CPU time as is returned by cpu_times().
    For instance, on Linux we'll get:

      >>> cpu_times_percent()
      cpupercent(user=4.8, nice=0.0, system=4.8, idle=90.5, iowait=0.0,
                 irq=0.0, softirq=0.0, steal=0.0, guest=0.0, guest_nice=0.0)
      >>>

    interval and percpu arguments have the same meaning as in
    cpu_percent().
    gcS s�g}t|�t|�}xo|jD]d}t||�t||�}yd||}Wntk
rsd}nX|jt|d��q&Wtdkr�tddj	|j��ant|�S(Nidgit
cpupercentt (
R�t_fieldsRzR�R�R�t_ptime_cpu_perc_ntRUR)tjoin(R"R#R�R)tfieldtfield_deltat
field_perc((sB/opt/alt/python27/lib64/python2.7/site-packages/psutil/__init__.pyR+#s

R N(	RURR�R�t_last_cpu_times_2R�t_last_per_cpu_times_2R.R�(RrR R�R+R"R�R/R#((sB/opt/alt/python27/lib64/python2.7/site-packages/psutil/__init__.pyRs$			
cC s
tj�S(s�Return statistics about system memory usage as a namedtuple
    including the following fields, expressed in bytes:

     - total:
       total physical memory available.

     - available:
       the actual amount of available memory that can be given
       instantly to processes that request more memory in bytes; this
       is calculated by summing different memory values depending on
       the platform (e.g. free + buffers + cached on Linux) and it is
       supposed to be used to monitor actual memory usage in a cross
       platform fashion.

     - percent:
       the percentage usage calculated as (total - available) / total * 100

     - used:
       memory used, calculated differently depending on the platform and
       designed for informational purposes only:
        OSX: active + inactive + wired
        BSD: active + wired + cached
        LINUX: total - free

     - free:
       memory not being used at all (zeroed) that is readily available;
       note that this doesn't reflect the actual memory available
       (use 'available' instead)

    Platform-specific fields:

     - active (UNIX):
       memory currently in use or very recently used, and so it is in RAM.

     - inactive (UNIX):
       memory that is marked as not used.

     - buffers (BSD, Linux):
       cache for things like file system metadata.

     - cached (BSD, OSX):
       cache for various things.

     - wired (OSX, BSD):
       memory that is marked to always stay in RAM. It is never moved to disk.

     - shared (BSD):
       memory that may be simultaneously accessed by multiple processes.

    The sum of 'used' and 'available' does not necessarily equal total.
    On Windows 'available' and 'free' are the same.
    (RWR(((sB/opt/alt/python27/lib64/python2.7/site-packages/psutil/__init__.pyRLs5cC s
tj�S(s�Return system swap memory statistics as a namedtuple including
    the following attributes:

     - total:   total swap memory in bytes
     - used:    used swap memory in bytes
     - free:    free swap memory in bytes
     - percent: the percentage usage
     - sin:     no. of bytes the system has swapped in from disk (cumulative)
     - sout:    no. of bytes the system has swapped out from disk (cumulative)

    'sin' and 'sout' on Windows are meaningless and always set to 0.
    (RWR(((sB/opt/alt/python27/lib64/python2.7/site-packages/psutil/__init__.pyR�s
cC s
tj|�S(s�Return disk usage statistics about the given path as a namedtuple
    including total, used and free space expressed in bytes plus the
    percentage usage.
    (RWtget_disk_usage(R�((sB/opt/alt/python27/lib64/python2.7/site-packages/psutil/__init__.pyR"�scC s
tj|�S(s&Return mounted partitions as a list of namedtuples including
    device, mount point, filesystem type and mount options (a raw
    string separated by commas which may vary depending on the platform).

    If "all" parameter is False return physical devices only and ignore
    all others.
    (RWR!(tall((sB/opt/alt/python27/lib64/python2.7/site-packages/psutil/__init__.pyR!�scC s�tj�}|s!td��n|rXx*|j�D]\}}t|�||<q4W|Stgt|j��D]}t|�^qn�SdS(s�Return system disk I/O statistics as a namedtuple including
    the following attributes:

     - read_count:  number of reads
     - write_count: number of writes
     - read_bytes:  number of bytes read
     - write_bytes: number of bytes written
     - read_time:   time spent reading from disk (in milliseconds)
     - write_time:  time spent writing to disk (in milliseconds)

    If perdisk is True return the same information for every
    physical disk installed on the system as a dictionary
    with partition names as the keys and the namedutuple
    described above as the values.

    On recent Windows versions 'diskperf -y' command may need to be
    executed first otherwise this function won't find any disk.
    scouldn't find any physical diskN(RWR tRuntimeErrorRt_nt_disk_iostatR.tvaluesR�(tperdisktrawdicttdisktfieldsR�((sB/opt/alt/python27/lib64/python2.7/site-packages/psutil/__init__.pyR �scC s�tj�}|s!td��n|rXx*|j�D]\}}t|�||<q4W|Stgt|j��D]}t|�^qn�SdS(s$Return network I/O statistics as a namedtuple including
    the following attributes:

     - bytes_sent:   number of bytes sent
     - bytes_recv:   number of bytes received
     - packets_sent: number of packets sent
     - packets_recv: number of packets received
     - errin:        total number of errors while receiving
     - errout:       total number of errors while sending
     - dropin:       total number of incoming packets which were dropped
     - dropout:      total number of outgoing packets which were dropped
                     (always 0 on OSX and BSD)

    If pernic is True return the same information for every
    network interface installed on the system as a dictionary
    with network interface names as the keys and the namedtuple
    described above as the values.
    s#couldn't find any network interfaceN(RWRR<Rt_nt_net_iostatR.R>R�(tpernicR@tnicRBR�((sB/opt/alt/python27/lib64/python2.7/site-packages/psutil/__init__.pyR�scC s
tj�S(svReturn the system boot time expressed in seconds since the epoch.
    This is also available as psutil.BOOT_TIME.
    (RWtget_system_boot_time(((sB/opt/alt/python27/lib64/python2.7/site-packages/psutil/__init__.pyR$�scC s
tj�S(s�Return users currently connected on the system as a list of
    namedtuples including the following attributes.

     - user: the name of the user
     - terminal: the tty or pseudo-tty associated with the user, if any.
     - host: the host name associated with the entry, if any.
     - started: the creation time as a floating point number expressed in
       seconds since the epoch.
    (RWtget_system_users(((sB/opt/alt/python27/lib64/python2.7/site-packages/psutil/__init__.pyR#�s
cC s
tt��S(snReturn a list of Process class instances for all running
    processes on the local machine (deprecated).
    (R�R(((sB/opt/alt/python27/lib64/python2.7/site-packages/psutil/__init__.pytget_process_list�scC s(t�}t|j|j|j|j�S(s�Return the amount of total, used and free physical memory
    on the system in bytes plus the percentage usage.
    Deprecated by psutil.virtual_memory().
    (Rt_nt_sysmeminfottotaltusedtfreetpercent(tmem((sB/opt/alt/python27/lib64/python2.7/site-packages/psutil/__init__.pytphymem_usages	spsutil.swap_memory()cC st�S(N(R(((sB/opt/alt/python27/lib64/python2.7/site-packages/psutil/__init__.pyt
virtmem_usagesspsutil.phymem_usage().freecC s
t�jS(N(RORL(((sB/opt/alt/python27/lib64/python2.7/site-packages/psutil/__init__.pytavail_phymemsspsutil.phymem_usage().usedcC s
t�jS(N(RORK(((sB/opt/alt/python27/lib64/python2.7/site-packages/psutil/__init__.pytused_phymemsspsutil.virtmem_usage().totalcC s
t�jS(N(RPRJ(((sB/opt/alt/python27/lib64/python2.7/site-packages/psutil/__init__.pyt
total_virtmemsspsutil.virtmem_usage().usedcC s
t�jS(N(RPRK(((sB/opt/alt/python27/lib64/python2.7/site-packages/psutil/__init__.pytused_virtmemsspsutil.virtmem_usage().freecC s
t�jS(N(RPRL(((sB/opt/alt/python27/lib64/python2.7/site-packages/psutil/__init__.pyt
avail_virtmem#sc
C sWddl}ddlm}|jj�}d}ddddd	d
ddg}tjd
krn|jd�n||d*�x�tt	�dd��D]�}y|j
|dd�}Wntk
r�q�X|dr|jj|d�}|j�|kr|j
d�}q$|j
d�}nd}tj
dtjt|d ���}|d}	tjd!kr�d"|	kr�|	jd"�d#}	n|d$r�t|d$jd%�p�d&}
|d$r�t|d$jd%�p�d&}|d'r�t|d'd#�p�d&}|||	d( |d|d)||
||jdd�p.d&|||d	j�pGd&f
�q�WdS(+sNList info of all currently running processes emulating ps aux
    output.
    i����N(tprint_s+%-10s %5s %4s %4s %7s %7s %-13s %5s %7s  %sRBR�RqR�R]R�RZR�R�R�tUSERtPIDs%CPUs%MEMtVSZtRSStTTYtSTARTtTIMEtCOMMANDtkeycS s|jS(N(RB(R�((sB/opt/alt/python27/lib64/python2.7/site-packages/psutil/__init__.pyR�6sR}ts%H:%Ms%b%ds%M:%SRR�s\itmemory_infoit?tmemory_percenti
R(
RWRXs%CPUs%MEMRYRZR[R\R]R^(tdatetimetpsutil._compatRVtdatettodayR�R]R�RRRkRt
fromtimestamptstrftimeR�t	localtimeR�tsplitRNtvmsR�R�Rststrip(
RdRVt	today_dayttemplR|R�tpinfotctimetcputimeR�RlR�tmemp((sB/opt/alt/python27/lib64/python2.7/site-packages/psutil/__init__.pyttest'sR

%




t__main__ii(yR	t
__future__RR
ttupleRktnumRNR	t__all__R�R�R�R�RR�RR�R�RUt
psutil._errorRRRRtpsutil._commonR%ReR&R'R(R)R*RJR+RLR,t_deprecatedR-R=R.RCR/RIR0t_isfile_strictRRR
RRRRRRRtplatformRytpsutil._pslinuxt_pslinuxRWR2R3R4R5R6R7tpsutil._psmswindowst_psmswindowsR9R:R;R<R=R>t
psutil._psosxt_psosxt
psutil._psbsdt_psbsdR{textendt__extra__all__RRRRKRRRRRRRRSRR,R�R-RR8R9R3RRRR"R!R RR$R#RHRORPRQRRRSRTRURtR`(((sB/opt/alt/python27/lib64/python2.7/site-packages/psutil/__init__.pyt<module>
s�.				

".(F.	1				���?			5	O:	7		
!!				2
	

Zerion Mini Shell 1.0