/usr/lib/python3/dist-packages/landscape/lib/__pycache__
Edit: /usr/lib/python3/dist-packages/landscape/lib/__pycache__/process.cpython-310.pyc (4383B)
o
c @ sl d dl mZ d dlZd dlZd dlmZmZ d dlmZ d dlm Z d dl
mZ G dd deZ
d d
ZdS ) )absolute_importN) timedeltadatetime)sysstats)to_timestamp)detect_jiffiesc @ s. e Zd ZdZ d
ddZdd Zdd ZdS )ProcessInformationaI
@param proc_dir: The directory to use for process information.
@param jiffies: The value to use for jiffies per second.
@param boot_time: An alternate value to use for the last boot time. If
None, the system last boot time will be used.
@param uptime: The uptime value to use (for unit tests only).
/procNc C sH |d u r
t }|d urt|}|| _|| _|pt | _|| _ d S )N)
r BootTimesget_last_boot_timer utcfromtimestamp
_boot_time _proc_dirr _jiffies_per_sec_uptime)selfproc_dirjiffies boot_timeuptime r 7/usr/lib/python3/dist-packages/landscape/lib/process.py__init__ s
zProcessInformation.__init__c c sL t | jD ]}zt|}W n ty Y qw | |}|r#|V qdS )z8Get process information for all processes on the system.N)oslistdirr int
ValueErrorget_process_info)r filename
process_idprocess_infor r r get_all_process_info s
z'ProcessInformation.get_all_process_infoc C s d}t j| jt|}d|i}ztt j|dd}z| }t j|dd }W | n| w tt j|dd}z|D ]y}|dd }|d d
kr_|
p[|d
|d<