HEX
Server: Apache
System: Linux pdx1-shared-a1-38 6.6.104-grsec-jammy+ #3 SMP Tue Sep 16 00:28:11 UTC 2025 x86_64
User: mmickelson (3396398)
PHP: 8.1.31
Disabled: NONE
Upload Files
File: //usr/lib/python3/dist-packages/sos/__pycache__/__init__.cpython-310.pyc
o

([Qhf �@sjdZdZddlZddlZddlZddlmZddlmZdZ	dZ
e�e
e	�dd	�ZeZ
Gd
d�d�ZdS)zu
This module houses the i18n setup and message function. The default is to use
gettext to internationalize messages.
z4.9.2�N)�ArgumentParser)�
SosListOptionz/usr/share/locale�soscCst�t|�S�N)�gettext�dgettext�gettext_app)�msg�r
�./usr/lib/python3/dist-packages/sos/__init__.py�_defaultsrc@s0eZdZdZdd�Zdd�Zdd�Zdd	�Zd
S)�SoSaRMain entrypoint for sos from the command line

    Upon intialization, this class loads the basic option parser which will
    include the options shared by support components/subcommands. This is also
    where all subcommands present in the local installation are discovered,
    loaded, and if a matching one is found, intialized.
    c
Cs||_ddl}ddl}ddl}ddl}|jjdgf|jjddgf|j	j
gf|jjgfd�|_
zddl}|jjdgf|j
d<Wn9tyw}z-ddl}dt|j�vr[|jjgf|j
d<nd	t|j�vrl|jjgf|j
d<n�WYd}~nd}~wwd
}|j
��D]#\}}|d}|�d|�d�|�}|dj}	|d
|d�|	�d�7}qd}
|
|}
d}t|
|d�|_|j�ddt�|jj dddd�|_!d|j!_"|j
��D]3\}}|j!j#||dd|��d�}
d|�d�|
_$|
�ddt�|�%|
�|dj&|
d�|
j'|d�q�|j�(|j�|_)|�*�dS)Nr�rep�cleaner�mask)�report�clean�help�upload�	collector�collectz
sos.collector�pexpect��z, �	z<30�
z6%(prog)s <component> [options]

Available components:
z1See `sos <component> --help` for more information)�usage�epilog�action�extend�	componentzsos component to run)�dest�metavarrTzsos )�aliases�progz
 [options])�parser)r )+�cmdline�
sos.report�sos.cleaner�sos.help�
sos.uploadr�	SoSReportr�
SoSCleanerr�	SoSHelperr�	SoSUpload�_components�
sos.collectorr�SoSCollector�ModuleNotFoundError�sos.missing�strr	�missing�MissingCollect�MissingPexpect�items�insert�join�descrr%�registerr�add_subparsers�
subparsers�required�
add_parserr�_add_common_options�add_parser_options�set_defaults�
parse_args�args�_init_component)�selfrEr�err�_com_string�com�valuer#�_comr;�usage_stringr�comp�_com_subparserr
r
r�__init__/sn

�	���

��
zSoS.__init__c	Cs|�d�}|jddddd�|jdtdd	d
dd�|jd
dddd�|jddddddd�|jddddddd�|jdddddd�|jdddd d!td"d#�|jd$d%d&d'd(d)d�|jd*d+d,gd-�d.d/�|��}|jd0ddd1d�|jd2d3d4�|jd5d6d4�dS)7z@Adds the options shared across components to the parser
        zGlobal Optionsz--batchF�
store_truezDo not prompt interactively)�defaultrrz
--config-file�store�config_filez/etc/sos/sos.confz$specify alternate configuration file)�typerr!rRrz--debug�debugz6enable interactive debugging using the python debugger)rr!rz-qz--quiet�quietzonly print fatal errors)rr!rRrz-sz	--sysroot�sysrootNz!system rootdir path (default='/')z	--tmp-dir�tmp_dirz%specify alternate temporary directoryz-tz	--threads�threads�zNumber of threads to use)rr!rRrUrz-vz	--verbose�count�	verbosityrzincrease verbosityz-zz--compression-type�compression_type)�auto�gzip�xzzcompression technology to use)r!�choicesrz	--encryptz_Encrypt the archive, either prompting for a password/key or referencing an environment variablez
--encrypt-keyz(Encrypt the archive using a GPG key-pair)rz--encrypt-passz$Encrypt the archive using a password)�add_argument_group�add_argumentr4�int�add_mutually_exclusive_group)rGr%�
global_grp�encrypt_grpr
r
rrAxs`

�
�
�
�
�
�
�
����
�zSoS._add_common_optionsc
Cs�|jj}||jvrtd|�d��z!|j|d}|jr&t��dks&td��||j|j|j	�|_
WdStyZ}ztd|�d|���|jjrJ|�t�
d�WYd}~dSd}~ww)	znDetermine which component has been requested by the user, and then
        initialize that component.
        zUnknown subcommand 'z' specifiedrz*Component must be run with root privilegeszCould not initialize 'z': rN)rEr r/�print�
root_required�os�getuid�	Exceptionr%r&�
_componentrV�sys�exit)rGrL�_to_loadrHr
r
rrF�s
��zSoS._init_componentcCs|j��dSr)rn�execute)rGr
r
rrr�szSoS.executeN)�__name__�
__module__�__qualname__�__doc__rPrArFrrr
r
r
rr
&sI/r
)rv�__version__rkror�argparser�sos.optionsr�gettext_dirr�bindtextdomainr�_sosr
r
r
r
r�<module>s