????
Current Path : /lib/python3.6/site-packages/glances/__pycache__/ |
Current File : //lib/python3.6/site-packages/glances/__pycache__/thresholds.cpython-36.opt-1.pyc |
3 Eo�cY � @ s� d Z ddlZddlmZ G dd� de�Ze� ZeG dd� de��ZG dd � d e�ZG d d� de�Z G dd � d e�Z G dd� de�ZdS )z4 Thresholds classes: OK, CAREFUL, WARNING, CRITICAL � N)�total_orderingc @ s6 e Zd ZdZddddgZdd� 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�CRITICALc C s t jt | _i | _d S )N)�sys�modules�__name__�current_module�_thresholds)�self� r � /usr/lib/python3.6/thresholds.py�__init__ s zGlancesThresholds.__init__Nc C s* |dkr| j S || j kr"| j | S i S dS )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_namer r r �get s zGlancesThresholds.getc C s2 || j krdS t| jd|j� �� | j|<