404

[ Avaa Bypassed ]




Upload:

Command:

elspacio@18.216.78.112: ~ $
3

�f!�@sdZyddlZWnek
r,ddlZYnXGdd�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tj|j�S)N)�json�dumps�data)�self�r�/usr/lib/python3.6/reporting.py�__str__szNode.__str__cCsdS)NFr)r�noderrr�can_addszNode.can_addN)�__name__�
__module__�__qualname__r	rrrrrrsrc@seZdZdZdS)�Leafz0Marker class that can be added to a Section nodeN)rr
r�__doc__rrrrrsrc@s(eZdZdZdd�Zdd�Zdd�ZdS)	�Reportz?The root element of a report. This is a container for sections.cCs
i|_dS)N)r)rrrr�__init__'szReport.__init__cCs
t|t�S)N)�
isinstance�Section)rr
rrrr*szReport.can_addcGs*x$|D]}|j|�r|j|j|j<qWdS)N)rr�name)r�nodesr
rrr�add-s

z
Report.addN)rr
rrrrrrrrrr$srcCst|t�r|S|jdd�S)z3returns a string text for a given unicode/str input�utf8�ignore)r�str�decode)�srrr�_decode3src@s(eZdZdZdd�Zdd�Zdd�ZdS)	rzeA section is a container for leaf elements. Sections may be nested
    inside of Report objects only.cCst|�|_i|_dS)N)rrr)rrrrrr<s
zSection.__init__cCs
t|t�S)N)rr)rr
rrrr@szSection.can_addcGs4x.|D]&}|j|�r|jj|jg�j|j�qWdS)N)rr�
setdefault�ADDS_TO�append)rrr
rrrrCs

zSection.addN)rr
rrrrrrrrrr8src@seZdZdZdd�ZdS)�CommandZcommandscCst|�|t|�d�|_dS)N)r�return_code�href)rr)rrr"r#rrrrMszCommand.__init__N)rr
rrrrrrrr!Isr!c@seZdZdZdd�ZdS)�
CopiedFileZcopied_filescCst|�t|�d�|_dS)N)rr#)rr)rrr#rrrrWszCopiedFile.__init__N)rr
rrrrrrrr$Ssr$c@seZdZdZdd�ZdS)�CreatedFileZ
created_filescCst|�t|�d�|_dS)N)rr#)rr)rrr#rrrr`szCreatedFile.__init__N)rr
rrrrrrrr%\sr%c@seZdZdZdd�ZdS)�AlertZalertscCst|�|_dS)N)rr)r�contentrrrriszAlert.__init__N)rr
rrrrrrrr&esr&c@seZdZdZdd�ZdS)�NoteZnotescCst|�|_dS)N)rr)rr'rrrrqsz
Note.__init__N)rr
rrrrrrrr(msr(cCs
|jd�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)�stringrrr�ends_bsusr,c@s�eZdZdZdZdZdZdZdZdZ	dZ
dZd	ZdZ
d
ZddZeed
dfeeddfeeddfeeddfeeddffZgZdd�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}�=�Hz-  commands executed:z-  files copied:z-  files created:z
-  alerts:z	-  notes:cCsttj|j��|_dS)N)�sorted�dict�itemsr�report_data)rZreport_noderrrr�szPlainTextReport.__init__c
Cs,g|_}t|j�dkr$|j|j�|j|j�d}d}t|j�}xH|jD]>\}}|d|��7}|d7}||jdkrJ||krJ||j7}qJW||j7}|j|�xV|jD]L\}}|j|j	�|j|��x*|j
D] \}}	}
}|j||j|
|	|�q�Wq�Wt|j
�dk�r|j|j
�djtdd�|��}|S)Nrr.z  �r/cSst|t�r|S|jdd�S)Nrr)rrr)�irrr�<lambda>�sz)PlainTextReport.unicode.<locals>.<lambda>)�line_buf�len�HEADERr �PLUGLISTHEADERr6�PLUGLISTMAXITEMS�PLUGLISTSEP�PLUGLISTFOOTER�PLUGDIVIDER�subsections�process_subsectionr�FOOTER�join�map)
rr:�liner8Z	plugcountZsection_name�_Zsection_contentsZtype_�format_�header�footer�outputrrr�unicode�s2




zPlainTextReport.unicodecCs`||kr\|jj|�x.t|j|�dd�d�D]}|jj||�q,Wt|�dkr\|jj|�dS)NcSst|t�r|dSdS)Nrr.)rr4)�xrrrr9�sz4PlainTextReport.process_subsection.<locals>.<lambda>)�keyr)r:r r3�getr;)rZsectionrOrJrIrK�itemrrrrC�sz"PlainTextReport.process_subsectionN)rr
rrr<rD�LEAF�ALERT�NOTEr=�PLUGLISTITEMr?r>r@�PLUGINFORMATrAr!r$r%r&r(rBr:rrMrCrrrrr-�s,



"r-c@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>r0z
</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)rr
rrr<rDrRrSrTr=rUr?r>r@rVrAr!r$r%r&r(rBrrrrrW�s$



rWc@seZdZdZdd�ZdS)�
JSONReportz:Will generate a JSON report from a top_level Report objectcCstj|jddd�}|S)N�F)�indentZensure_ascii)rrr6)rrLrrrrM�szJSONReport.unicodeN)rr
rrrMrrrrrX�srX)rr�ImportErrorZ
simplejson�objectrrrrrr!r$r%r&r(r,r-rWrXrrrr�<module>s$	
		K&

Filemanager

Name Type Size Permission Actions
__init__.cpython-36.opt-1.pyc File 50.76 KB 0644
__init__.cpython-36.pyc File 50.76 KB 0644
reporting.cpython-36.opt-1.pyc File 8.06 KB 0644
reporting.cpython-36.pyc File 8.06 KB 0644