AnonSec Shell
Server IP : 209.38.156.173  /  Your IP : 216.73.216.122   [ Reverse IP ]
Web Server : Apache/2.4.52 (Ubuntu)
System : Linux lakekumayuhotel 5.15.0-136-generic #147-Ubuntu SMP Sat Mar 15 15:53:30 UTC 2025 x86_64
User : root ( 0)
PHP Version : 8.1.2-1ubuntu2.22
Disable Function : NONE
Domains : 2 Domains
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : ON
Directory :  /lib/python3/dist-packages/sos/help/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ HOME ]     [ BACKUP SHELL ]     [ JUMPING ]     [ MASS DEFACE ]     [ SCAN ROOT ]     [ SYMLINK ]     

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

���b�*�@s�ddlZddlZddlZddlZddlmZddlmZddlm	Z	ddl
mZddlm
Z
mZddlmZz
ee��jd�ZWneyKdZYnwGd	d
�d
e�ZGdd�d�ZdS)
�N)�OrderedDict)�SoSComponent)�
import_policy)�Plugin)�bold�ImporterHelper)�fill�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�cs"tt|��|||�|jj|_dS)N)�superr
�__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!ty8}ztd|jj|f�t�d�WYd}~nd}~ww|rdzt	�}|�
|�|��WdStyc}z
td|�WYd}~dSd}~wwtd|jj�dS)Nrz Could not load help for '%s': %s�zError loading help: %szNo help section found for '%s')rr�display_self_help�sys�exitr.�get_obj_for_topic�	Exception�print�HelpSection�display_help�display)r�klass�err�htrrr�executeDs*
��
��zSoSHelper.executecCs�dddddddd�}d	}|jj|vr&t�d
|jj�}t|||jj�}|S|j|j|j|jd�}|D]}|jj�	|�rD||�}|Sq3|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�_secrrrr3\s2�
��
�zSoSHelper.get_obj_for_topiccCs2ddlm}|jj�d�d}||vr||SdS)Nr)�
TRANSPORTSr$���)�sos.collector.sosnoderSrrr*)rrS�
_transportrrrrL|s
�z SoSHelper._get_collect_transportcCsXddlm}ddl}|�|jjd�}|D]}|d|jj�d�dkr)|dSqdS)Nr)r?�clustersr$rTr/)	�
sos.collectorr?�sos.collector.clusters�
_load_modulesr&rWrrr*)rr?�sosrW�clusterrrrrM�s
���zSoSHelper._get_collect_clustercCsdt�d|jj�}|��t�|tj�}dd�|D�}|D]}|��r/|j	�
|���}|SqdS)NrFcSs"g|]
}t|dt�r|d�qS)r/)�
issubclassr)�.0�mrrr�
<listcomp>�s"z1SoSHelper._get_plugin_variant.<locals>.<listcomp>)rGrHrr�load_local_policy�inspect�
getmembers�isclass�__subclasses__�policy�match_plugin)rrP�mems�plugins�pluginr!rrrrJ�s��zSoSHelper._get_plugin_variantcCsl|jj�d�d}ddl}t|jj�}|��D]}t|�D]}|j	�
��dd�}||kr2|SqqdS)Nr$rTrrfr)rrr*�sos.policies.distrosrrE�distros�get_modulesr�__name__�lowerr+)r�_topicr[�_helperrPrf�_prrrrK�s���zSoSHelper._get_policy_by_namecCs�tdd�}|�dtd��|�d�}td�}|�d|�td�}|�d	|�|�d
�}|�d�dd
ddddd�}|D]}|jd�t|�||�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.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)rCrDzreport.plugins.$pluginr'r)rEz		{:<36}{}F)�newlineN)r6�add_textr�add_section�formatr8)r�	self_help�subsectr�rep_ex�
avail_help�sections�sectrrrr0�sJ���

���
��	�zSoSHelper.display_self_help)rn�
__module__�__qualname__�__doc__�desc�configure_logging�load_policy�
load_probe�arg_defaultsr�classmethodr#r.r<r3rLrMrJrKr0�
__classcell__rrrrr
s&�


 	
r
c@sHeZdZdZddd�Zdd�Zddd	�Zdd
d�Zddd
�Zdd�Z	dS)r6z�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�rs�lnrrrrt�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�rrrrus
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{r4r6r�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)
r5rrr��TERMSIZEr�r��
splitlinesr{r8)rr��sectionrrrr8#s�
�zHelpSection.displayN)rrr)T)rr)
rnr}r~rrr�rtrur�r8rrrrr6�s




r6)rbrGr1�os�collectionsr�
sos.componentr�sos.policiesr�sos.report.pluginsr�
sos.utilitiesrr�textwrapr�min�get_terminal_size�columnsr�r4r
r6rrrr�<module>s$
�=

Anon7 - 2022
AnonSec Team