Spamworldpro Mini Shell
Spamworldpro


Server : Apache/2.4.52 (Ubuntu)
System : Linux webserver 6.8.0-49-generic #49~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Wed Nov 6 17:42:15 UTC 2 x86_64
User : www-data ( 33)
PHP Version : 8.1.2-1ubuntu2.21
Disable Function : NONE
Directory :  /lib/python3/dist-packages/sos/report/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

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

i��dS�@sdZzddlZWn
eyddlZYnwGdd�de�ZGdd�de�ZGdd�de�Zd	d
�ZGdd�de�Z	Gd
d�de�Z
Gdd�de�ZGdd�de�ZGdd�de�Z
Gdd�de�Zdd�ZGdd�de�ZGdd�de�ZGdd�de�ZdS)zR This provides a restricted tag language to define the sosreport
    index/report
�Nc@seZdZdd�Zdd�ZdS)�NodecCst�|j�S�N)�json�dumps�data��self�r	�6/usr/lib/python3/dist-packages/sos/report/reporting.py�__str__szNode.__str__cCsdS)NFr	�r�noder	r	r
�can_addszNode.can_addN)�__name__�
__module__�__qualname__rrr	r	r	r
rsrc@seZdZdZdS)�Leafz0Marker class that can be added to a Section nodeN)rrr�__doc__r	r	r	r
rsrc@�(eZdZdZdd�Zdd�Zdd�ZdS)	�Reportz?The root element of a report. This is a container for sections.cCs
i|_dSr)rrr	r	r
�__init__'�
zReport.__init__cC�
t|t�Sr)�
isinstance�Sectionrr	r	r
r*rzReport.can_addcGs&|D]}|�|�r|j|j|j<qdSr)rr�name�r�nodesr
r	r	r
�add-s

��z
Report.addN�rrrrrrrr	r	r	r
r$s
rcC�t|t�r|S|�dd�S)z3returns a string text for a given unicode/str input�utf8�ignore�r�str�decode)�sr	r	r
�_decode3sr'c@r)	rzeA section is a container for leaf elements. Sections may be nested
    inside of Report objects only.cCst|�|_i|_dSr)r'rr)rrr	r	r
r<s

zSection.__init__cCrr)rrrr	r	r
r@rzSection.can_addcGs0|D]}|�|�r|j�|jg��|j�qdSr)rr�
setdefault�ADDS_TO�appendrr	r	r
rCs

��zSection.addNrr	r	r	r
r8s
rc@�eZdZdZdd�ZdS)�Command�commandscCst|�|t|�d�|_dS)N)r�return_code�href�r'r)rrr.r/r	r	r
rMs�zCommand.__init__N�rrrr)rr	r	r	r
r,I�r,c@r+)�
CopiedFile�copied_filescC�t|�t|�d�|_dS�N)rr/r0�rrr/r	r	r
rW��zCopiedFile.__init__Nr1r	r	r	r
r3Sr2r3c@r+)�CreatedFile�
created_filescCr5r6r0r7r	r	r
r`r8zCreatedFile.__init__Nr1r	r	r	r
r9\r2r9c@r+)�Alert�alertscC�t|�|_dSrr0�r�contentr	r	r
ri�zAlert.__init__Nr1r	r	r	r
r;er2r;c@r+)�Note�notescCr=rr0r>r	r	r
rqr@z
Note.__init__Nr1r	r	r	r
rAmr2rAcCs
|�d�S)a Return True if 'string' ends with a backslash, and False otherwise.

        Define this as a named function for no other reason than that pep8
        now forbids binding of a lambda expression to a name:

        'E731 do not assign a lambda expression, use a def'
    �\)�endswith)�stringr	r	r
�ends_bsus
rFc@s�eZdZdZdZdZdZdZdZdZ	dZ
dZd	ZdZ
d
ZdZeeddfeed
dfeeddfeeddfeeddffZgZdd�Zdd�Zdd�ZdS)�PlainTextReportz@Will generate a plain text report from a top_level Report object�z  * %(name)sz  ! %sz  * %szLoaded Plugins:z  {name}�
�z{name}zH========================================================================z-  commands executed:z-  files copied:z-  files created:z
-  alerts:z	-  notes:cCstt�|j��|_dSr)�sorted�dict�itemsr�report_data)r�report_noder	r	r
r�szPlainTextReport.__init__c
	Cs*g|_}t|j�dkr|�|j�|�|j�d}d}t|j�}|jD]!\}}||jj|d�7}|d7}||jdkrE||krE||j	7}q$||j
7}|�|�|jD](\}}|�|j�|�|jj|d��|j
D]\}}	}
}|�||j|
|	|�qjqSt|j�dkr�|�|j�d�tdd�|��}|S)NrrH)r�rIcSr )Nr!r"r#)�ir	r	r
�<lambda>�sz)PlainTextReport.unicode.<locals>.<lambda>)�line_buf�len�HEADERr*�PLUGLISTHEADERrN�PLUGLISTITEM�format�PLUGLISTMAXITEMS�PLUGLISTSEP�PLUGLISTFOOTER�PLUGDIVIDER�PLUGINFORMAT�subsections�process_subsectionr)�FOOTER�join�map)
rrS�linerQ�	plugcount�section_name�_�section_contents�type_�format_�header�footer�outputr	r	r
�unicode�s:


�


���zPlainTextReport.unicodecCsd||vr.|j�|�t|�|�dd�d�D]
}|j�||�qt|�dkr0|j�|�dSdSdS)NcSst|t�r	|dSdS)NrrH)rrL)�xr	r	r
rR�sz4PlainTextReport.process_subsection.<locals>.<lambda>)�keyr)rSr*rK�getrT)r�sectionrorjrirk�itemr	r	r
r_�s
��z"PlainTextReport.process_subsectionN)rrrrrUr`�LEAF�ALERT�NOTErVrWrZrYr[r]r\r,r3r9r;rAr^rSrrmr_r	r	r	r
rG�s0




�"rGc@sveZdZdZdZdZdZdZdZdZ	dZ
dZd	Zd
Z
dZdZeed
dfeeddfeeddfeeddfeeddffZdS)�
HTMLReportz:Will generate a HTML report from a top_level Report objecta�<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
         "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
        <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
        <head>
            <meta http-equiv="Content-Type" content="text/html;
                  charset=utf-8" />
            <title>Sos System Report</title>
            <style type="text/css">
                td {
                    padding: 0 5px;
                   }
            </style>
        </head>
        <body>
z</body></html>z(<li><a href="%(href)s">%(name)s</a></li>z<li>%s</li>z#<h3>Loaded Plugins:</h3><table><tr>z&<td><a href="#{name}">{name}</a></td>
z
</tr>
<tr>rJz
</tr></table>z+<h2 id="{name}">Plugin <em>{name}</em></h2>z<hr/>
z<p>Commands executed:</p><ul>z</ul>z<p>Files copied:</p><ul>z<p>Files created:</p><ul>z<p>Alerts:</p><ul>z<p>Notes:</p><ul>N)rrrrrUr`rsrtrurVrWrZrYr[r]r\r,r3r9r;rAr^r	r	r	r
rv�s(




�rvc@r+)�
JSONReportz:Will generate a JSON report from a top_level Report objectcCstj|jddd�}|S)N�F)�indent�ensure_ascii)rrrN)rrlr	r	r
rm�szJSONReport.unicodeN)rrrrrmr	r	r	r
rw�srw)rr�ImportError�
simplejson�objectrrrr'rr,r3r9r;rArFrGrvrwr	r	r	r
�<module>s(�	
		K&

Spamworldpro Mini