HEX
Server: Apache
System: Linux nc-ph-4101.simplemoneygoals.com 5.14.0-503.21.1.el9_5.x86_64 #1 SMP PREEMPT_DYNAMIC Sun Jan 12 09:45:05 EST 2025 x86_64
User: dailygoldindex (1004)
PHP: 8.1.33
Disabled: NONE
Upload Files
File: //lib/python3.9/site-packages/sos/help/__pycache__/__init__.cpython-39.pyc
a

\��hk+�@s�ddlZddlZddlZddlZddlmZddlmZddlm	Z	ddl
mZddlm
Z
ddlmZmZzee��jd�ZWney�dZYn0Gd	d
�d
e	�ZGdd�d�ZdS)
�N)�OrderedDict)�fill)�SoSComponent)�
import_policy)�Plugin)�bold�ImporterHelper�xcs�eZdZdZdZdZdZdZddiZ�fdd�Z	e
dd	��Zd
d�Zdd
�Z
dd�Zdd�Zdd�Zdd�Zdd�Zdd�Z�ZS)�	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�cst��|||�|jj|_dS)N)�super�__init__�optsr)�self�parser�argsZcmdline��	__class__��5/usr/lib/python3.9/site-packages/sos/help/__init__.pyr+szSoSHelper.__init__cCs*d|_|�dd�}|jdddddd	�dS)
Nzsos help TOPIC [options]zHelp Information Optionsz<These options control what detailed information is displayedrZTOPICr�?z/name of the topic or component to show help for)�metavar�default�nargs�help)�usage�add_argument_group�add_argument)�clsrZhelp_grprrr�add_parser_options/s��zSoSHelper.add_parser_optionscCsB|jj�d�d}dddd�}||vr>|jj�|||�|j_dS)N�.r�cleaner�	collector)�clean�mask�collect)rr�split�replace)rZ_com�_replacerrr�sanitize_topic_component:s�z"SoSHelper.sanitize_topic_componentc
Cs�|jjs|��t�d�|��z|��}WnFtyt}z.td|jj�d|���t�d�WYd}~n
d}~00|r�zt	�}|�
|�|��Wq�ty�}ztd|���WYd}~q�d}~00ntd|jj�d��dS)NrzCould not load help for 'z': �zError loading help: zNo help section found for '�')rr�display_self_help�sys�exitr*�get_obj_for_topic�	Exception�print�HelpSectionZdisplay_help�display)r�klass�errZhtrrr�executeDs"
 
&zSoSHelper.executec	Cs�ddddddddd	�}d
}|jj|vrLt�d|jj�}t|||jj�}n@|j|j|j|jd�}|�	�D] \}}|jj�
|�rj|�}q�qj|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.
        Z	SoSReportrZ
SoSCleaner�SoSCollectorZRemoteTransportZClusterZPolicyZ	SoSUpload)�report�report.pluginsr"r#zcollector.transportszcollector.clusters�policies�uploadN�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�items�
startswith)rZ
static_mapr�modZ_helpZ_sec�valuerrrr0\s.��zSoSHelper.get_obj_for_topiccCs2ddlm}|jj�d�d}||vr.||SdS)Nr)�
TRANSPORTSr!���)Zsos.collector.sosnoderIrrr')rrIZ
_transportrrrrC}s
z SoSHelper._get_collect_transportcCsXddlm}ddl}|�|jjd�}|D]*}|d|jj�d�dkr(|dSq(dS)Nr)r8�clustersr!rJr+)	Z
sos.collectorr8Zsos.collector.clustersZ
_load_modulesr#rKrrr')rr8�sosrKZclusterrrrrD�s
�zSoSHelper._get_collect_clustercCsdt�d|jj�}|��t�|tj�}dd�|D�}|D]$}|��r:|j	�
|���}|Sq:dS)Nr=cSs"g|]}t|dt�r|d�qS)r+)�
issubclassr)�.0�mrrr�
<listcomp>��z1SoSHelper._get_plugin_variant.<locals>.<listcomp>)r>r?rrZload_local_policy�inspectZ
getmembersZisclass�__subclasses__�policyZmatch_plugin)rrGZmemsZpluginsZpluginrrrrrA�s
zSoSHelper._get_plugin_variantcCsl|jj�d�d}ddl}t|jj�}|��D]8}t|�D]*}|j	�
��dd�}||kr:|Sq:q.dS)Nr!rJrrTr)rrr'Zsos.policies.distrosrr;ZdistrosZget_modulesr�__name__�lowerr()rZ_topicrLZ_helperrGrTZ_prrrrB�szSoSHelper._get_policy_by_namec	Cs�tdd�}|�dtd��d��|�d�}td�}|�d|�d	��td
�}|�d|�d��|�d
�}|�d�dddddddd�}|��D]&\}}|jdt|�d�|��dd�q�|��dS)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.z�SoS - 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 z
sos reportz� (formerly sosreport) which is used to collect troubleshooting information into an archive for review by sysadmins or technical support teams.zHow to search using sos helpz$component.$topic.$subtopicz8To get more information on a given topic, use the form 'z'.zsos help report.plugins.kernelz
For example 'zM' 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#Detailed help on the upload commandz+How sos operates on different distributions)r9r:zreport.plugins.$pluginr$r&r<r;�	z<36F)�newlineN)r3�add_textr�add_sectionrEr4)	rZ	self_helpZsubsectrZrep_exZ
avail_help�sectionsZsectrHrrrr-�sB���	
��
��
 zSoSHelper.display_self_help)rU�
__module__�__qualname__�__doc__ZdescZconfigure_loggingZload_policyZ
load_probeZarg_defaultsr�classmethodr r*r7r0rCrDrArBr-�
__classcell__rrrrr
s$�


!

r
c@sHeZdZdZddd�Zdd�Zddd	�Zdd
d�Zddd
�Zdd�Z	dS)r3z�This class is used to build the output displayed by `sos help` in a
    standard fashion that provides easy formatting controls.
    rcCs||_||_||_t�|_dS)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[�rrarbrcrrrr�s
zHelpSection.__init__cCs
||_dS)z�Set or override the title for this help section

        :param title:   The name to set for this help section
        :type title:    ``str``
        N)ra)rrarrr�	set_title�szHelpSection.set_titleTcCs,|jr|rdnd}||}|j|7_dS)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)rb)rrbrX�lnrrrrY�szHelpSection.add_textcCs|�|||�|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[rdrrrrZszHelpSection.add_sectioncCs(||jvrtd��t|||�|j|<dS)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[r1r3rdrrrrhs
zHelpSection._add_sectioncCsdttt|j�t|jd��|j��D]}tt|t|jd��q$|jD]}td�|j|�	�qDdS)zWPrint the HelpSection contents, including any subsections, to
        console.
        )�width�initial_indentrN)
r2rrra�TERMSIZErcrb�
splitlinesr[r4)rrg�sectionrrrr4&s�
zHelpSection.displayN)rrr)T)rr)rr)
rUr\r]r^rrerYrZrhr4rrrrr3�s




r3)rRr>r.�os�collectionsr�textwraprZ
sos.componentrZsos.policiesrZsos.report.pluginsrZ
sos.utilitiesrr�min�get_terminal_size�columnsrkr1r
r3rrrr�<module>s 
@