
    Je(                         d Z ddlZddlmZ ddlmZ ddlmZ  G d de      Z G d d	e      Z	 G d
 de      Z
d Zedk(  r e        yy)zDefault status bar widgets.    N_)BaseTimerStatus)memory_usagec                        e Zd ZdZdZd Zd Zy)MemoryStatusz*Status bar widget for system memory usage.memory_statusc                 D    dt               z  }d|j                  d      z   S )zReturn memory usage.%d%%zMem    )r   rjustselftexts     I/usr/lib/python3/dist-packages/spyder/plugins/statusbar/widgets/status.py	get_valuezMemoryStatus.get_value   s!    &

1%%    c                     t        d      S )Return the widget tooltip text.zGlobal memory usager   r   s    r   get_tooltipzMemoryStatus.get_tooltip   s    &''r   N__name__
__module____qualname____doc__IDr   r    r   r   r   r      s    4	B&
(r   r   c                        e Zd ZdZdZd Zd Zy)	CPUStatusz'Status bar widget for system cpu usage.
cpu_statusc                 \    dt        j                  d      z  }d|j                  d      z   S )zReturn CPU usage.r   r   )intervalzCPU r   )psutilcpu_percentr   r   s     r   r   zCPUStatus.get_value%   s*    **A66

1%%r   c                     t        d      S )r   z	CPU usager   r   s    r   r   zCPUStatus.get_tooltip*   s    ~r   Nr   r   r   r   r    r    !   s    1	B&
r   r    c                        e Zd ZdZdZd Zd Zy)ClockStatusz-"Add clock to statusbar in a fullscreen mode.clock_statusc                 P    ddl m}m}  |d |             }|j                  d      S )zReturn the time.r   )	localtimestrftimez%H:%Mr   )timer+   r,   r   )r   r+   r,   r   s       r   r   zClockStatus.get_value3   s!    ,-zz!}r   c                     t        d      S )r   Clockr   r   s    r   r   zClockStatus.get_tooltip:   s    zr   Nr   r   r   r   r(   r(   /   s    7	Br   r(   c                  h   ddl m}  ddlm}  |d      } |        }|j	                  d       |j                  dd       g }|j                         }t        t        t        fD ]-  } ||      }|j                  d|       |j                  |       / |j                          |j                          y )	Nr   )QMainWindow)qapplication   )	test_timezStatus widgets testi  i,  )qtpy.QtWidgetsr1   spyder.utils.qthelpersr2   setWindowTitleresize	statusBarr   r    r(   insertPermanentWidgetappendshowexec_)r1   r2   appwinstatus_widgets	statusbarstatus_classstatus_widgets           r   testrD   ?   s    *3

#C
-C,-JJsCNI%y+> -$S)''=9m,-
 HHJIIKr   __main__)r   r$   spyder.api.translationsr   spyder.api.widgets.statusr   spyder.utils.systemr   r   r    r(   rD   r   r   r   r   <module>rI      sW    "  & 5 ,(? ( /  & zF r   