| Server IP : 104.21.4.30 / Your IP : 172.71.28.133 Web Server : Apache System : Linux keen-cori.18-142-40-148.plesk.page 5.15.0-1084-aws #91~20.04.1-Ubuntu SMP Fri May 2 06:59:36 UTC 2025 x86_64 User : simottodesign.com_2tntp341vs7 ( 10011) PHP Version : 8.3.31 Disable Function : opcache_get_status MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /lib/python3/dist-packages/sos/presets/__pycache__/ |
Upload File : |
U
i��d� � @ s� d dl Z d dlZd dlmZ dZdZdZdZG dd� d�Zd Z d
Z
dZdZd
Z
dZedddddd�Ze ee e
ee� d�eeee
eed�iZdS )� N)�
SoSOptionsz/etc/sos/presets.d�desc�note�argsc @ sZ e Zd ZdZdZdZdZe� ZdZ dd� Z
dd� Zddde� fd d
�Zdd� Z
d
d� ZdS )�PresetDefaultsa� Preset command line defaults to allow for quick reference to sets of
commonly used options
:param name: The name of the new preset
:type name: ``str``
:param desc: A description for the new preset
:type desc: ``str``
:param note: Note for the new preset
:type note: ``str``
:param opts: Options set for the new preset
:type opts: ``SoSOptions``
NTc C s d| j | j| jt| j�f S )zeReturn a human readable string representation of this
``PresetDefaults`` object.
z!name=%s desc=%s note=%s opts=(%s))�namer r �str�opts��self� r �6/usr/lib/python3/dist-packages/sos/presets/__init__.py�__str__4 s �zPresetDefaults.__str__c C s d| j | j| jt| j�f S )zgReturn a machine readable string representation of this
``PresetDefaults`` object.
z6PresetDefaults(name='%s' desc='%s' note='%s' opts=(%s))r r r �reprr r
r r r
�__repr__; s �zPresetDefaults.__repr__� c C s || _ || _|| _|| _dS )z�Initialise a new ``PresetDefaults`` object with the specified
arguments.
:returns: The newly initialised ``PresetDefaults``
N�r r r r )r r r r r r r r
�__init__B s zPresetDefaults.__init__c C s~ | j rtd��| j�� }| jt| jt| jt |ii}t
j�|�sLt
j
|dd� tt
j�|| j�d��}t�||� W 5 Q R X dS )z�Write this preset to disk in JSON notation.
:param presets_path: the directory where the preset will be written
:type presets_path: ``str``
zCannot write built-in preseti� )�mode�wN)�builtin� TypeErrorr �dictr �DESCr �NOTEr �OPTS�os�path�exists�makedirs�open�join�json�dump)r �presets_pathZodictZpdictZpfiler r r
�writeM s
zPresetDefaults.writec C s t �t j�|| j�� dS )z�Delete a preset from disk
:param presets_path: the directory where the preset is saved
:type presets_path: ``str``
N)r �unlinkr r! r )r r$ r r r
�delete` s zPresetDefaults.delete)�__name__�
__module__�__qualname__�__doc__r r r r r r r r r r% r'