ÿØÿà JFIF      ÿÛ „ 	 ( %!1!%)+//.383,7(-.+



-%%-////---/-.+/--+------/------/--0+--/-/-----.-----ÿÀ  ¥2" ÿÄ               ÿÄ J  	     ! 1AQ"aq2‘#BR‚¡ÁÑ3br’¢±Âð$CSƒ²á4c“%DsÓñÿÄ              ÿÄ *        !1AQa‘"2q3±ð#b¡ÿÚ   ? ¼QxJQaÍuò¸Zö Úü8,ÐÚú
"SSn<rçù–´âE—^ªBÖ9À\†¸ÔÁT­ÃÛ5
ëd´³Í#Ý;Þ38œî ¶H£M:wÎ3…³…âpÔF&‚FK¸9„â4àGEõªfÿ ‘ñ(ßw­pŽF|È¥ù®häðÍÑ¶¹‘[ÒinÙW¶ùñY˜Q{›K"išÒ[Ú8žë\F¹@-?v"ÔU”,ìöžkÿ {I‡£šÍ?e
ríV
..............................................................................................................................................................................
.............................................................................                                                  
                                                                                                                                                                                     ÿØÿà JFIF      ÿÛ „ 	 ( %!1!%)+//.383,7(-.+



-%%-////---/-.+/--+------/------/--0+--/-/-----.-----ÿÀ  ¥2" ÿÄ               ÿÄ J  	     ! 1AQ"aq2‘#BR‚¡ÁÑ3br’¢±Âð$CSƒ²á4c“%DsÓñÿÄ              ÿÄ *        !1AQa‘"2q3±ð#b¡ÿÚ   ? ¼QxJQaÍuò¸Zö Úü8,ÐÚú
"SSn<rçù–´âE—^ªBÖ9À\†¸ÔÁT­ÃÛ5
ëd´³Í#Ý;Þ38œî ¶H£M:wÎ3…³…âpÔF&‚FK¸9„â4àGEõªfÿ ‘ñ(ßw­pŽF|È¥ù®häðÍÑ¶¹‘[ÒinÙW¶ùñY˜Q{›K"išÒ[Ú8žë\F¹@-?v"ÔU”,ìöžkÿ {I‡£šÍ?e
ríV
..............................................................................................................................................................................
.............................................................................                                                  
                                                                                                                                                                                     3
ft`                 @   s   d Z ddlmZ ddlmZ ddlmZ ddlmZ ddlZ	ddl
Z
ddlZddlZejejd Ze
jdZd	d
 Zdd Zdd Zdd ZdS )z/Various utility functions, and a utility class.    )absolute_import)unicode_literals)format_number)_N
SC_CLK_TCKdnfc             C   s   t | t S )zConvert a number of jiffies to seconds. How many jiffies are in a second
    is system-dependent, e.g. 100 jiffies = 1 second is common.

    :param jiffies: a number of jiffies
    :return: the equivalent number of seconds
    )int_USER_HZ)Zjiffies r
   /usr/lib/python3.6/utils.pyjiffies_to_seconds   s    r   c             C   sj   | dkr0d| d	 | d
 d | d d | d f S | dkrVd| d | d d | d f S d| d | d f S )a  Return a human-readable string representation of the length of
    a time interval given in seconds.

    :param seconds: the length of the time interval in seconds
    :return: a human-readable string representation of the length of
      the time interval
    <      z%d day(s) %d:%02d:%02dz%d:%02d:%02dz	%02d:%02di  iQ i  iQ i  i  i  r
   )Zsecondsr
   r
   r   seconds_to_ui_time)   s    

r   c             C   s  t | } tjjd|   s:tjjd s:tjjd|   r>dS i }td|  v}xn|D ]f}|d dkrhqV|dd jdd}t|dk rqVtjj	|d d	|d< |d j
 ||d
 j
 j < qVW W dQ R X d|krdS d|krdS d}td4}x,|D ]$}|jdrt |tdd }P qW W dQ R X |dkr6dS td|  ^}|j j }|t|d  |d< tdtdtdtdtddj|d td|d< W dQ R X |S )z!Return info dict about a process.z/proc/%d/statusz
/proc/statz/proc/%d/statN   
z:	   z kBr   vmrssvmsizezbtime    
start_timeZRunningZSleepingZUninterruptibleZZombiezTraced/Stopped)RSDZTZUnknownstater   r   )r   ospathexistsopensplitlenr   utilZrtrimstriplower
startswithreadr   r   get)pidpsZstatus_filelinedataZ	boot_timeZ	stat_fileZps_statr
   r
   r   get_process_info<   sJ    
*



r.   c             C   s   t | }|s$td}tj||  dS td| |d f }tjd| tjtdtt|d d tt|d	 d  tttj |d
  }tjtdtj	j
|d
 | tjtd|d  dS )z0Output information about process holding a lock.z=Unable to find information about the locking process (PID %d)Nz$  The application with PID %d is: %snamez%sz    Memory : %5s RSS (%5sB VSZ)r   i   r   r   z    Started: %s - %s agoz    State  : %sr   )r.   r   loggerZcriticalr   r   r   timer   r$   Znormalize_time)r*   r+   msgZagor
   r
   r   show_lock_ownerl   s    

r3   )__doc__Z
__future__r   r   Zdnf.cli.formatr   Zdnf.i18nr   Zdnf.utilr   Zloggingr   r1   sysconfsysconf_namesr	   Z	getLoggerr0   r   r   r.   r3   r
   r
   r
   r   <module>   s   

0