Current File : //lib/python2.7/site-packages/sos/reporting.pyc
�
u��ec@s`dZyddlZWnek
r5ddlZnXddlZdefd��YZdefd��YZdefd��YZd	�Z	d
efd��YZ
defd
��YZdefd��YZdefd��YZ
defd��YZdefd��YZd�Zdefd��YZdefd��YZdefd��YZdS(sR This provides a restricted tag language to define the sosreport
    index/report
i����NtNodecBseZd�Zd�ZRS(cCstj|j�S(N(tjsontdumpstdata(tself((s1/usr/lib/python2.7/site-packages/sos/reporting.pyt__str__scCstS(N(tFalse(Rtnode((s1/usr/lib/python2.7/site-packages/sos/reporting.pytcan_adds(t__name__t
__module__RR(((s1/usr/lib/python2.7/site-packages/sos/reporting.pyRs	tLeafcBseZdZRS(s0Marker class that can be added to a Section node(R	R
t__doc__(((s1/usr/lib/python2.7/site-packages/sos/reporting.pyR"stReportcBs)eZdZd�Zd�Zd�ZRS(s?The root element of a report. This is a container for sections.cCs
i|_dS(N(R(R((s1/usr/lib/python2.7/site-packages/sos/reporting.pyt__init__*scCs
t|t�S(N(t
isinstancetSection(RR((s1/usr/lib/python2.7/site-packages/sos/reporting.pyR-scGs:x3|D]+}|j|�r|j|j|j<qqWdS(N(RRtname(RtnodesR((s1/usr/lib/python2.7/site-packages/sos/reporting.pytadd0s
(R	R
RRRR(((s1/usr/lib/python2.7/site-packages/sos/reporting.pyR
's		cCs&t|tj�r|S|jdd�S(s3returns a string text for a given unicode/str inputtutf8tignore(Rtsixt	text_typetdecode(ts((s1/usr/lib/python2.7/site-packages/sos/reporting.pyt_decode6sRcBs)eZdZd�Zd�Zd�ZRS(seA section is a container for leaf elements. Sections may be nested
    inside of Report objects only.cCst|�|_i|_dS(N(RRR(RR((s1/usr/lib/python2.7/site-packages/sos/reporting.pyR?scCs
t|t�S(N(RR(RR((s1/usr/lib/python2.7/site-packages/sos/reporting.pyRCscGsIxB|D]:}|j|�r|jj|jg�j|j�qqWdS(N(RRt
setdefaulttADDS_TOtappend(RRR((s1/usr/lib/python2.7/site-packages/sos/reporting.pyRFs
(R	R
RRRR(((s1/usr/lib/python2.7/site-packages/sos/reporting.pyR;s		tCommandcBseZdZd�ZRS(tcommandscCs.it|�d6|d6t|�d6|_dS(NRtreturn_codethref(RR(RRR R!((s1/usr/lib/python2.7/site-packages/sos/reporting.pyRPs(R	R
RR(((s1/usr/lib/python2.7/site-packages/sos/reporting.pyRLst
CopiedFilecBseZdZd�ZRS(tcopied_filescCs'it|�d6t|�d6|_dS(NRR!(RR(RRR!((s1/usr/lib/python2.7/site-packages/sos/reporting.pyRZs(R	R
RR(((s1/usr/lib/python2.7/site-packages/sos/reporting.pyR"VstCreatedFilecBseZdZd�ZRS(t
created_filescCs'it|�d6t|�d6|_dS(NRR!(RR(RRR!((s1/usr/lib/python2.7/site-packages/sos/reporting.pyRcs(R	R
RR(((s1/usr/lib/python2.7/site-packages/sos/reporting.pyR$_stAlertcBseZdZd�ZRS(talertscCst|�|_dS(N(RR(Rtcontent((s1/usr/lib/python2.7/site-packages/sos/reporting.pyRls(R	R
RR(((s1/usr/lib/python2.7/site-packages/sos/reporting.pyR&hstNotecBseZdZd�ZRS(tnotescCst|�|_dS(N(RR(RR(((s1/usr/lib/python2.7/site-packages/sos/reporting.pyRts(R	R
RR(((s1/usr/lib/python2.7/site-packages/sos/reporting.pyR)pscCs
|jd�S(s 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'
    s\(tendswith(tstring((s1/usr/lib/python2.7/site-packages/sos/reporting.pytends_bsxstPlainTextReportcBs�eZdZdZdZdZdZdZdZdZ	dZ
dZdZd	Z
d
dZeeddfeed
dfeeddfeeddfeeddffZgZd�Zd�Zd�ZRS(s@Will generate a plain text report from a top_level Report objectts  * %(name)ss  ! %ss  * %ssLoaded Plugins:s  {name}s
is{name}t=iHs-  commands executed:s-  files copied:s-  files created:s
-  alerts:s	-  notes:cCsttj|j��|_dS(N(tsortedRt	iteritemsRtreport_data(Rtreport_node((s1/usr/lib/python2.7/site-packages/sos/reporting.pyR�sc
Cs�g|_}t|j�dkr5|j|j�n|j|j�d}d}t|j�}xi|jD]^\}}||jjd|�7}|d7}||jdkrj||krj||j	7}qjqjW||j
7}|j|�x|jD]t\}}|j|j�|j|jjd|��x9|j
D].\}}	}
}|j||j|
|	|�q2Wq�Wt|j�dkr�|j|j�ng|D]"}t|�r�|dn|^q�}djtd�|��}tjr�|S|jd�SdS(	NiR/Rit u
cSs&t|tj�r|S|jdd�S(NRR(RRRR(ti((s1/usr/lib/python2.7/site-packages/sos/reporting.pyt<lambda>�sR(tline_buftlentHEADERRtPLUGLISTHEADERR3tPLUGLISTITEMtformattPLUGLISTMAXITEMStPLUGLISTSEPtPLUGLISTFOOTERtPLUGDIVIDERtPLUGINFORMATtsubsectionstprocess_subsectionRtFOOTERR-tjointmapRtPY3tencode(
RR8tlineR6t	plugcounttsection_namet_tsection_contentsttype_tformat_theadertfootertoutput((s1/usr/lib/python2.7/site-packages/sos/reporting.pytunicode�s8



/	cCsv||krr|jj|�x+|j|�D]}|jj||�q,Wt|�dkrr|jj|�qrndS(Ni(R8RtgetR9(RtsectiontkeyRQRPRRtitem((s1/usr/lib/python2.7/site-packages/sos/reporting.pyRD�s(R	R
RR:REtLEAFtALERTtNOTER;R<R?R>R@RBRARR"R$R&R)RCR8RRTRD(((s1/usr/lib/python2.7/site-packages/sos/reporting.pyR.�s,
		*t
HTMLReportcBs�eZdZdZdZdZdZdZdZdZ	dZ
dZd	Zd
Z
dZeedd
feedd
feedd
feedd
feedd
ffZRS(s:Will generate a HTML report from a top_level Report objects�<!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>
s</body></html>s(<li><a href="%(href)s">%(name)s</a></li>s<li>%s</li>s#<h3>Loaded Plugins:</h3><table><tr>s&<td><a href="#{name}">{name}</a></td>
s
</tr>
<tr>is
</tr></table>s+<h2 id="{name}">Plugin <em>{name}</em></h2>s<hr/>
s<p>Commands executed:</p><ul>s</ul>s<p>Files copied:</p><ul>s<p>Files created:</p><ul>s<p>Alerts:</p><ul>s<p>Notes:</p><ul>(R	R
RR:RERYRZR[R;R<R?R>R@RBRARR"R$R&R)RC(((s1/usr/lib/python2.7/site-packages/sos/reporting.pyR\�s$t
JSONReportcBseZdZd�ZRS(s:Will generate a JSON report from a top_level Report objectcCs<tj|jdddt�}tjr+|S|jd�SdS(Ntindentitensure_asciiR(RRR3RRRHRI(RRS((s1/usr/lib/python2.7/site-packages/sos/reporting.pyRT�s	(R	R
RRT(((s1/usr/lib/python2.7/site-packages/sos/reporting.pyR]�s(RRtImportErrort
simplejsonRtobjectRRR
RRRR"R$R&R)R-R.R\R](((s1/usr/lib/python2.7/site-packages/sos/reporting.pyt<module>s&
		
			P&