https://t.me/RX1948
Server : LiteSpeed
System : Linux host 5.15.0-161-generic #171-Ubuntu SMP Sat Oct 11 08:17:01 UTC 2025 x86_64
User : idnco5810 ( 1093)
PHP Version : 8.2.29
Disable Function : NONE
Directory :  /usr/lib/python3/dist-packages/sos/help/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //usr/lib/python3/dist-packages/sos/help/__pycache__/__init__.cpython-310.pyc
o

([Qhk+�@s�ddlZddlZddlZddlZddlmZddlmZddlm	Z	ddl
mZddlm
Z
ddlmZmZz
ee��jd�ZWneyKdZYnwGd	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�args�cmdline��	__class__��3/usr/lib/python3/dist-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 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_grprrr�add_parser_options/s�
�zSoSHelper.add_parser_optionscCsF|jj�d�d}dddd�}||vr!|jj�|||�|j_dSdS)N�.r�cleaner�	collector)�clean�mask�collect)rr�split�replace)r�_com�_replacerrr�sanitize_topic_component:s��z"SoSHelper.sanitize_topic_componentc
Cs�|jjs
|��t�d�|��z|��}Wn#ty:}ztd|jj�d|���t�d�WYd}~nd}~ww|rgzt	�}|�
|�|��WdStyf}ztd|���WYd}~dSd}~wwtd|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�HelpSection�display_help�display)r�klass�err�htrrr�executeDs*
��
��zSoSHelper.executec	Cs�ddddddddd	�}d
}|jj|vr't�d|jj�}t|||jj�}|S|j|j|j|jd�}|�	�D]\}}|jj�
|�rG|�}|Sq6|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�	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)r�
static_mapr!�mod�_help�_sec�valuerrrr4\s4����zSoSHelper.get_obj_for_topiccCs2ddlm}|jj�d�d}||vr||SdS)Nr)�
TRANSPORTSr$���)�sos.collector.sosnoderXrrr*)rrX�
_transportrrrrO}s
z SoSHelper._get_collect_transportcCsXddlm}ddl}|�|jjd�}|D]}|d|jj�d�dkr)|dSqdS)Nr)r@�clustersr$rYr/)	�
sos.collectorr@�sos.collector.clusters�
_load_modulesr&r\rrr*)rr@�sosr\�clusterrrrrP�s
��zSoSHelper._get_collect_clustercCsdt�d|jj�}|��t�|tj�}dd�|D�}|D]}|��r/|j	�
|���}|SqdS)NrIcSs"g|]
}t|dt�r|d�qS)r/)�
issubclassr)�.0�mrrr�
<listcomp>�s"z1SoSHelper._get_plugin_variant.<locals>.<listcomp>)rJrKrr�load_local_policy�inspect�
getmembers�isclass�__subclasses__�policy�match_plugin)rrT�mems�plugins�pluginr!rrrrM�s�zSoSHelper._get_plugin_variantcCsl|jj�d�d}ddl}t|jj�}|��D]}t|�D]}|j	�
��dd�}||kr2|SqqdS)Nr$rYrrkr)rrr*�sos.policies.distrosrrG�distros�get_modulesr�__name__�lowerr+)r�_topicr`�_helperrTrk�_prrrrN�s��zSoSHelper._get_policy_by_namec	Cs�tdd�}|�dtd��d��|�d�}td�}|�d|�d	��td
�}|�d|�d��|�d
�}|�d�dddddddd�}|��D]\}}|jdt|�d�|��dd�qG|��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)rErFzreport.plugins.$pluginr'r)rHrG�	z<36F)�newlineN)r7�add_textr�add_sectionrQr9)	r�	self_help�subsectr�rep_ex�
avail_help�sections�sectrWrrrr1�sB���
	��
��
 zSoSHelper.display_self_help)rs�
__module__�__qualname__�__doc__�desc�configure_logging�load_policy�
load_probe�arg_defaultsr�classmethodr#r.r=r4rOrPrMrNr1�
__classcell__rrrrr
s&�


!

r
c@sHeZdZdZddd�Zdd�Zddd	�Zdd
d�Zddd
�Zdd�Z	dS)r7z�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��rr�r�r�rrrr�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)r�)rr�rrr�	set_title�s
zHelpSection.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)r�)rr�ry�lnrrrrz�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�r�rrrr{s
zHelpSection.add_sectioncCs(||jvr	td��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�r5r7r�rrrr�s
zHelpSection._add_sectioncCsdttt|j�t|jd��|j��D]}tt|t|jd��q|jD]
}td�|j|�	�q"dS)zWPrint the HelpSection contents, including any subsections, to
        console.
        )�width�initial_indentrN)
r6rrr��TERMSIZEr�r��
splitlinesr�r9)rr��sectionrrrr9&s�
�zHelpSection.displayN)rrr)T)rr)
rsr�r�r�rr�rzr{r�r9rrrrr7�s




r7)rgrJr2�os�collectionsr�textwrapr�
sos.componentr�sos.policiesr�sos.report.pluginsr�
sos.utilitiesrr�min�get_terminal_size�columnsr�r5r
r7rrrr�<module>s$
�@

https://t.me/RX1948 - 2025