Current File : //usr/lib/python3/dist-packages/sos/presets/__pycache__/__init__.cpython-312.pyc
�

-�_g��	��ddlZddlZddlmZdZdZdZdZGd�d�Zd	Z	d
Z
dZdZd
Z
dZeddddd��Ze	ee	e
ee���eeee
ee��iZy)�N)�
SoSOptionsz/etc/sos/presets.d�desc�note�argsc�`�eZdZdZdZdZdZe�ZdZ	d�Z
d�Zddde�fd�Zd�Z
d	�Zy)
�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
��d|j�d|j�d|j�dt|j��d�	S)zeReturn a human readable string representation of this
            ``PresetDefaults`` object.
        zname=z desc=z note=z opts=(�))�namerr�str�opts��selfs �6/usr/lib/python3/dist-packages/sos/presets/__init__.py�__str__zPresetDefaults.__str__4sC����	�	�{�&�����6�$�)�)��E��T�Y�Y��(��+�	,�c
��d|j�d|j�d|j�dt|j��d�	S)zgReturn a machine readable string representation of this
            ``PresetDefaults`` object.
        zPresetDefaults(name='z' desc='z' note='z' opts=(r
)rrr�reprr
rs r�__repr__zPresetDefaults.__repr__;sD��(��	�	�{�(�4�9�9�+�F�����8�D����O�+<�A�?�	@r�c�<�||_||_||_||_y)z�Initialise a new ``PresetDefaults`` object with the specified
            arguments.

            :returns: The newly initialised ``PresetDefaults``
        N�rrrr
)rrrrr
s     r�__init__zPresetDefaults.__init__Bs ����	���	���	���	rc��|jrtd��|jj�}|jt
|jt|jt|ii}tjj|�stj|d��ttjj||j�dd��5}t!j"||�ddd�y#1swYyxYw)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�wzutf-8)�encodingN)�builtin�	TypeErrorr
�dictr�DESCr�NOTEr�OPTS�os�path�exists�makedirs�open�join�json�dump)r�presets_path�odict�pdict�pfiles     r�writezPresetDefaults.writeMs����<�<��:�;�;��	�	��� �����T�4�9�9�d�D�I�I�t�U�K�L���w�w�~�~�l�+��K�K��5�1�
�"�'�'�,�,�|�T�Y�Y�7��"�$�	$�',��I�I�e�U�#�	$�	$�	$�s�C2�2C;c�~�tjtjj||j��y)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)rr,s  r�deletezPresetDefaults.deleteas#��	�	�	�"�'�'�,�,�|�T�Y�Y�7�8r)�__name__�
__module__�__qualname__�__doc__rrrrr
rrrrr0r3�rrrrsM��� �D��D��D��<�D��G�,�@��R�d���	�$�(9rr�nonezDo not load a presetz+Use to disable automatically loaded presets�minimalzCSmall and quick report that reduces sos report resource consumptionzXMay be useful for low-resource systems, but may not provide sufficient data for analysis�
�T)�log_size�journal_size�plugin_timeout�command_timeout�low_priorityr)r*r$�sos.optionsr�PRESETS_PATHr!r"r#r�	NO_PRESET�NO_PRESET_DESC�NO_PRESET_NOTE�SMALL_PRESET�SMALL_PRESET_DESC�SMALL_PRESET_NOTE�SMALL_PRESET_OPTS�GENERIC_PRESETSr8rr�<module>rLs����	�"�#����
��
��O9�O9�d
�	�'��>����#��<�����B�/1��F���~�
�^�.�
�\���.�
� 1�8I�
��	�r