%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /lib/python3/dist-packages/sos/help/__pycache__/
Upload File :
Create Path :
Current File : //lib/python3/dist-packages/sos/help/__pycache__/__init__.cpython-312.pyc

�

i��d�*���ddlZddlZddlZddlZddlmZddlmZddlm	Z	ddl
mZddlm
Z
mZddlmZ	eej$�j&d�ZGd	�d
e�ZGd�d�Zy#e$rdZY�wxYw)
�N)�OrderedDict)�SoSComponent)�
import_policy)�Plugin)�bold�ImporterHelper)�fill�xc�z��eZdZdZdZdZdZdZddiZ�fd�Z	e
d��Zd�Zd	�Z
d
�Zd�Zd�Zd
�Zd�Zd�Z�xZS)�	SoSHelperz�Provide better, more in-depth help for specific parts of sos than is
    provided in either standard --help output or in manpages.
    zDetailed help infomationF�topic�c�f��tt|�|||�|jj|_y)N)�superr�__init__�optsr
)�self�parser�args�cmdline�	__class__s    ��3/usr/lib/python3/dist-packages/sos/help/__init__.pyrzSoSHelper.__init__+s%���
�i��'���g�>��Y�Y�_�_��
�c�b�d|_|jdd�}|jddddd�	�y)
Nzsos help TOPIC [options]zHelp Information Optionsz<These options control what detailed information is displayedr
�TOPICr�?z/name of the topic or component to show help for)�metavar�default�nargs�help)�usage�add_argument_group�add_argument)�clsr�help_grps   r�add_parser_optionszSoSHelper.add_parser_options/sA��1����,�,�&�J�
��	���g�w��#�%/�	�	1rc���|jjjd�d}dddd�}||vr9|jjj|||�|j_yy)N�.r�cleaner�	collector)�clean�mask�collect)rr
�split�replace)r�_com�_replaces   r�sanitize_topic_componentz"SoSHelper.sanitize_topic_component:sb���y�y���$�$�S�)�!�,����"�
��
�8��"�i�i�o�o�5�5�d�H�T�N�K�D�I�I�O�rc�F�|jjs%|j�tjd�|j�	|j
�}r-	t�}|j|�|j�ytd|jjz�y#t$rD}td|jj�d|���tjd�Yd}~��d}~wwxYw#t$r}td|z�Yd}~yd}~wwxYw)NrzCould not load help for 'z': �zError loading help: %szNo help section found for '%s')rr
�display_self_help�sys�exitr2�get_obj_for_topic�	Exception�print�HelpSection�display_help�display)r�klass�err�hts    r�executezSoSHelper.executeDs����y�y����"�"�$��H�H�Q�K�	
�%�%�'�	��*�*�,�E�
�
6� �]���"�"�2�&��
�
��
�2�T�Y�Y�_�_�D�E���	���	�	����M�N��H�H�Q�K�K��	���
6��.��4�5�5��
6�s0�
B/� +C?�/	C<�8:C7�7C<�?	D �D�D c��dddddddd�}d	}|jj|vrQtjd
|jjz�}t	|||jj�}|S|j
|j|j|jd�}|D]4}|jjj|�s�)||�}|S|S)z�Based on the help topic we're after, try to smartly decide which
        object we need to manipulate in order to get help information.
        �	SoSReportr�
SoSCleaner�SoSCollector�RemoteTransport�Cluster�Policy)�report�report.pluginsr)r*zcollector.transportszcollector.clusters�policiesN�sos.)zreport.plugins.z	policies.zcollector.transports.zcollector.clusters.)
rr
�	importlib�
import_module�getattr�_get_plugin_variant�_get_policy_by_name�_get_collect_transport�_get_collect_cluster�
startswith)r�
static_mapr$�mod�_help�_secs      rr8zSoSHelper.get_obj_for_topic\s���
"�&�#�'�$5�"+� �
�
����9�9�?�?�j�(��)�)�&�4�9�9�?�?�*B�C�C��#�z�$�)�)�/�/�:�;�C��
�$(�#;�#;�!�5�5�)-�)D�)D�'+�'@�'@�	�E��
���9�9�?�?�-�-�d�3�%�%��+�-�C���
�	
��
rc�r�ddlm}|jjj	d�d}||vr||Sy)Nr)�
TRANSPORTSr(���)�sos.collector.sosnoderZrr
r.)rrZ�
_transports   rrRz SoSHelper._get_collect_transport|s:��4��Y�Y�_�_�*�*�3�/��3�
���#��j�)�)�$rc���ddlm}ddl}|j|jj
d�}|D]7}|d|jjjd�dk(s�2|dcSy)Nr)rE�clustersr(r[r4)	�
sos.collectorrE�sos.collector.clusters�
_load_modulesr*r_rr
r.)rrE�sosr_�clusters     rrSzSoSHelper._get_collect_cluster�sd��.�%��-�-�c�m�m�.D�.D�.8�:���	"�G��q�z�T�Y�Y�_�_�2�2�3�7��;�;��q�z�!�	"rc��tjd|jjz�}|j	�tj|t
j�}|D�cgc]}t|dt�s�|d��}}|D]?}|j�s�|jj|j��}|cSycc}w)NrLr4)
rMrNrr
�load_local_policy�inspect�
getmembers�isclass�
issubclassr�__subclasses__�policy�match_plugin)rrV�mems�m�plugins�pluginr$s       rrPzSoSHelper._get_plugin_variant�s����%�%�f�t�y�y���&>�?����� ��!�!�#�w���7��!%�B�A��A�a�D�&�)A�1�Q�4�B��B��	�F��$�$�&��k�k�.�.�v�/D�/D�/F�G���
�	��Cs�%C�>Cc�N�|jjjd�d}ddl}t	|j
j�}|j�D]G}t|�D]7}|jj�jdd�}||k(s�3|ccS�Iy)Nr(r[rrlr)rr
r.�sos.policies.distrosrrK�distros�get_modulesr�__name__�lowerr/)r�_topicrc�_helperrVrl�_ps       rrQzSoSHelper._get_policy_by_name�s��������&�&�s�+�B�/��	$� ����!5�!5�6���&�&�(�	"�C�'��,�
"���_�_�*�*�,�4�4�X�r�B����<�!�M�
"�	"rc���tdd�}|jdtd�z�|jd�}td�}|jd|z�td�}|jd	|z�|jd
�}|jd�dd
ddddd�}|D]1}|jdj	t|�||�d���3|j�y)zhDisplays the help information for this component directly, that is
        help for `sos help`.
        zDetailed help for sos helpz�The 'help' sub-command is used to provide more detailed information on different sub-commands available to sos as well as different components at play within those sub-commands.ahSoS - officially pronounced "ess-oh-ess" - is a diagnostic and supportability utility used by several Linux distributions as an easy-to-use tool for standardized data collection. The most known component of which is %s (formerly sosreport) which is used to collect troubleshooting information into an archive for review by sysadmins or technical support teams.z
sos reportzHow to search using sos helpz$component.$topic.$subtopicz<To get more information on a given topic, use the form '%s'.zsos help report.plugins.kernelz\For example '%s' will provide more information on the kernel plugin for the report function.zAvailable Help Sectionsz�The following help sections are available. Additional help topics and subtopics may be displayed within their respective help section.
z#Detailed help on the report commandz'Information on the plugin design of sosz!Information on a specific $pluginz"Detailed help on the clean commandz$Detailed help on the collect commandz+How sos operates on different distributions)rIrJzreport.plugins.$pluginr+r-rKz		{:<36}{}F)�newlineN)r;�add_textr�add_section�formatr=)r�	self_help�subsectr!�rep_ex�
avail_help�sections�sects        rr5zSoSHelper.display_self_help�s+�� �(�J�
�	�	���
7��<� �

!�	
��'�'�(F�G���2�3�����L��
�	
�
�6�7�����F�HN�O�	P��*�*�+D�E�
����
�	
�>�G�&I�<�>�E�

���	�D�����#�#�D��J����?��
 �
�	�	���r)rv�
__module__�__qualname__�__doc__�desc�configure_logging�load_policy�
load_probe�arg_defaultsr�classmethodr&r2rAr8rRrSrPrQr5�
__classcell__)rs@rrrsq����&�D����K��J�	���L�%��1��1�L�F�0�@*�"��
"�5rrc�<�eZdZdZd	d�Zd�Zd
d�Zdd�Zdd�Zd�Z	y)r;z�This class is used to build the output displayed by `sos help` in a
    standard fashion that provides easy formatting controls.
    c�L�||_||_||_t�|_y)a�
        :param title:   The title of the output section, will be prominently
                        displayed
        :type title:    ``str``

        :param content: The text content to be displayed with this section
        :type content:  ``str``

        :param indent:  If the section should be nested, set this to a multiple
                        of 4.
        :type indent:   ``int``
        N)�title�content�indentrr��rr�r�r�s    rrzHelpSection.__init__�s"����
�������#�
��
rc��||_y)z�Set or override the title for this help section

        :param title:   The name to set for this help section
        :type title:    ``str``
        N)r�)rr�s  r�	set_titlezHelpSection.set_title�s����
rc�\�|jr|rdnd}||z}|xj|z
c_y)z�Add body text to this section. If content for this section already
        exists, append the new ``content`` after a newline.

        :param content:     The text to add to the section
        :type content:      ``str``
        z

�
N)r�)rr�r|�lns    rr}zHelpSection.add_text�s+���<�<�"���B��7�l�G������rc�F�|j|||�|j|S)acAdd a section of text to the help section that will be displayed
        when the HelpSection object is printed.

        Sections will be printed *in the order added*.

        This will return a subsection object with which block(s) of text may be
        added to the subsection associated with ``title``.

        :param title:   The title of the subsection being added
        :type title:    ``str``

        :param content: The text the new section should contain
        :type content:  ``str``

        :returns:   The newly created subsection for ``title``
        :rtype:     ``HelpSection``
        )�_add_sectionr�r�s    rr~zHelpSection.add_sections%��$	
���%��&�1��}�}�U�#�#rc�j�||jvrtd��t|||�|j|<y)z�Internal method used to add a new subsection to this help output

        :param title:   The title of the subsection being added
        :type title:    ``str`
        z(A section with that title already existsN)r�r9r;r�s    rr�zHelpSection._add_sections3���D�M�M�!��F�G�G�*�5�'�6�B��
�
�e�rc�n�ttt|j�t|j
���|jj�D]'}tt|t|j
����)|jD]*}td�|j|j��,y)zWPrint the HelpSection contents, including any subsections, to
        console.
        )�width�initial_indentrN)
r:r	rr��TERMSIZEr�r��
splitlinesr�r=)rr��sections   rr=zHelpSection.display#s���	�d������H�T�[�[�
�	��,�,�)�)�+�	H�B��$�r��$�+�+�F�G�	H��}�}�	-�G��"�I��M�M�'�"�*�*�,�	-rN)rrr)T)rr)
rvr�r�r�rr�r}r~r�r=�rrr;r;�s&���&�$�
 �$�*C�-rr;)rgrMr6�os�collectionsr�
sos.componentr�sos.policiesr�sos.report.pluginsr�
sos.utilitiesrr�textwrapr	�min�get_terminal_size�columnsr�r9rr;r�rr�<module>r�sz����
�	�#�&�&�%�.����'�2�'�'�)�1�1�3�7�H�
y��y�xU-�U-��A���H��s�"A0�0A:�9A:

Zerion Mini Shell 1.0