????

Your IP : 3.149.237.146


Current Path : /lib/python3.6/site-packages/glances/__pycache__/
Upload File :
Current File : //lib/python3.6/site-packages/glances/__pycache__/thresholds.cpython-36.pyc

3

Eo�cY
�@s�dZddlZddlmZGdd�de�Ze�ZeGdd�de��ZGdd	�d	e�ZGd
d�de�Z	Gdd
�d
e�Z
Gdd�de�ZdS)z4
Thresholds classes: OK, CAREFUL, WARNING, CRITICAL
�N)�total_orderingc@s6eZdZdZddddgZdd�Zd
d	d
�Zdd�ZdS)�GlancesThresholdsz�Class to manage thresholds dict for all Glances plugins:

    key: Glances stats (example: cpu_user)
    value: Threshold instance
    �OK�CAREFUL�WARNING�CRITICALcCstjt|_i|_dS)N)�sys�modules�__name__�current_module�_thresholds)�self�r� /usr/lib/python3.6/thresholds.py�__init__szGlancesThresholds.__init__NcCs*|dkr|jS||jkr"|j|SiSdS)z�Return the threshold dict.
        If stat_name is None, return the threshold for all plugins (dict of Threshold*)
        Else return the Threshold* instance for the given plugin
        N)r)r
�	stat_namerrr�gets


zGlancesThresholds.getcCs2||jkrdSt|jd|j���|j|<dSdS)z1Add a new threshold to the dict (key = stat_name)FZGlancesThresholdTN)�threshold_list�getattrr�
capitalizer)r
rZthreshold_descriptionrrr�add,s

zGlancesThresholds.add)N)r
�
__module__�__qualname__�__doc__rrrrrrrrrs


rc@s@eZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Z	dS)�_GlancesThresholdz%Father class for all other ThresholdscCs
|jdS)N�description)�
_threshold)r
rrrr@sz_GlancesThreshold.descriptioncCs
|jdS)N�value)r)r
rrrrCsz_GlancesThreshold.valuecCs
t|j�S)N)�strr)r
rrr�__repr__Fsz_GlancesThreshold.__repr__cCs|j�S)N)r)r
rrr�__str__Isz_GlancesThreshold.__str__cCs|j�|j�kS)N)r)r
�otherrrr�__lt__Lsz_GlancesThreshold.__lt__cCs|j�|j�kS)N)r)r
r!rrr�__eq__Osz_GlancesThreshold.__eq__N)
r
rrrrrrr r"r#rrrrr;src@seZdZdZddd�ZdS)�GlancesThresholdOkzOk Threshold classrr)rrN)r
rrrrrrrrr$Ssr$c@seZdZdZddd�ZdS)�GlancesThresholdCarefulzCareful Threshold classr�)rrN)r
rrrrrrrrr%Zsr%c@seZdZdZddd�ZdS)�GlancesThresholdWarningzWarning Threshold classr�)rrN)r
rrrrrrrrr'asr'c@seZdZdZddd�ZdS)�GlancesThresholdCriticalzWarning Threshold classr�)rrN)r
rrrrrrrrr)hsr))rr�	functoolsr�objectrZglances_thresholdsrr$r%r'r)rrrr�<module>s&