Advanced Web Server Manager
Complete File Manager & Terminal - Standalone Version
By Sid Gifari | Gifari Industries
Current path:
/
/
usr
/
local
/
lib
/
python3.6
/
site-packages
/
nixstatsagent
/
plugins
/
__pycache__
✏️
Editing: plugins.cpython-36.pyc
3 ��`� � @ sF d dl Z d dlZd dlZejdkr,d dlZnd dlZG dd� d�ZdS )� N� c @ sJ e Zd ZdZdZ g fdd�Zddd�Zdd � Zd d� Zdd � Zdd� Z dS )� BasePluginz$ Abstract class for plugins � c C s t |t�r|| _ntd��d S )Nz#Type of agent_cache have to be list)� isinstance�list�agent_cache� TypeError)�selfr � r �G/usr/local/lib/python3.6/site-packages/nixstatsagent/plugins/plugins.py�__init__ s zBasePlugin.__init__Nc C s dS )z7 Virtual method for running the plugin Nr )r �configr r r �run s zBasePlugin.runc C sZ d}t tj�dkrBtjdkr(tjt�}n tjt�}|jtjd � t j | j|�tj� dS )zL Execution wrapper for the plugin argv[1]: ini_file N� r )r ) �len�sys�argv�version_info�configparser�RawConfigParser�defaults�ConfigParser�read�pickle�dumpr �stdout)r r r r r �execute! s zBasePlugin.executec C s$ y | j d S tk r i S X dS )zE Return agent cached value for this specific plugin. r N)r � Exception)r r r r �get_agent_cache/ s zBasePlugin.get_agent_cachec C s4 y|| j d<