+
    G%@iq                     F   R t  ^ RIt ! R R4      t ! R R]4      t ! R R]4      tR t ! R	 R
]4      t ! R R]4      t	 ! R R]4      t
 ! R R]4      t ! R R]4      t ! R R]4      tR t ! R R4      t ! R R]4      t ! R R]4      tR#   ] d    ^ RIt Li ; i)zNThis provides a restricted tag language to define the sos report
index/report
Nc                   0   a  ] tR t^t o / tR tR tRtV tR# )Nodec                B    \         P                  ! V P                  4      # N)jsondumpsdataselfs   &6/usr/lib/python3/dist-packages/sos/report/reporting.py__str__Node.__str__   s    zz$))$$    c                    R # )F r
   nodes   &&r   can_addNode.can_add   s    r   r   N)	__name__
__module____qualname____firstlineno__r   r   r   __static_attributes____classdictcell____classdict__s   @r   r   r      s     D% r   r   c                       ] tR t^"tRtRtR# )Leafz0Marker class that can be added to a Section noder   N)r   r   r   r   __doc__r   r   r   r   r   r   "   s    :r   r   c                   6   a  ] tR t^&t o RtR tR tR tRtV t	R# )Reportz?The root element of a report. This is a container for sections.c                    / V n         R # r   r   r	   s   &r   __init__Report.__init__)   s	    	r   c                "    \        V\        4      # r   )
isinstanceSectionr   s   &&r   r   Report.can_add,   s    $((r   c                    V F?  pV P                  V4      '       g   K  VP                  V P                  VP                  &   KA  	  R # r   )r   r   namer
   nodesr   s   &* r   add
Report.add/   s1    D||D!!'+yy		$))$ r   r#   N
r   r   r   r   r   r$   r   r.   r   r   r   s   @r   r!   r!   &   s     I)1 1r   r!   c                V    \        V \        4      '       d   V # V P                  RR4      # )z3returns a string text for a given unicode/str inpututf8ignorer'   strdecode)ss   &r   _decoder8   5   s$    As##AD&()CDr   c                   6   a  ] tR t^:t o RtR tR tR tRtV t	R# )r(   zaA section is a container for leaf elements. Sections may be nested
inside of Report objects only.c                4    \        V4      V n        / V n        R # r   )r8   r+   r   )r
   r+   s   &&r   r$   Section.__init__>   s    DM		r   c                "    \        V\        4      # r   )r'   r   r   s   &&r   r   Section.can_addB   s    $%%r   c                    V F[  pV P                  V4      '       g   K  V P                  P                  VP                  . 4      P	                  VP                  4       K]  	  R # r   )r   r   
setdefaultADDS_TOappendr,   s   &* r   r.   Section.addE   sB    D||D!!		$$T\\26==diiH r   )r   r+   Nr0   r   s   @r   r(   r(   :   s      &&I Ir   r(   c                   *   a  ] tR t^Kt o RtR tRtV tR# )Commandcommandsc                D    R \        V4      RVR\        V4      /V n        R# )r+   return_codehrefNr8   r   )r
   r+   rG   rH   s   &&&&r   r$   Command.__init__O   s"    WT]"KWT],	r   r#   Nr   r   r   r   r@   r$   r   r   r   s   @r   rD   rD   K   s     G, ,r   rD   c                   *   a  ] tR t^Ut o RtR tRtV tR# )
CopiedFilecopied_filesc                @    R \        V4      R\        V4      /V n        R# r+   rH   NrI   r
   r+   rH   s   &&&r   r$   CopiedFile.__init__Y       WT]WT],	r   r#   NrK   r   s   @r   rM   rM   U   s     G, ,r   rM   c                   *   a  ] tR t^^t o RtR tRtV tR# )CreatedFilecreated_filesc                @    R \        V4      R\        V4      /V n        R# rP   rI   rQ   s   &&&r   r$   CreatedFile.__init__b   rS   r   r#   NrK   r   s   @r   rU   rU   ^   s     G, ,r   rU   c                   *   a  ] tR t^gt o RtR tRtV tR# )Alertalertsc                &    \        V4      V n        R # r   rI   r
   contents   &&r   r$   Alert.__init__k       G$	r   r#   NrK   r   s   @r   rZ   rZ   g   s     G% %r   rZ   c                   *   a  ] tR t^ot o RtR tRtV tR# )Notenotesc                &    \        V4      V n        R # r   rI   r]   s   &&r   r$   Note.__init__s   r`   r   r#   NrK   r   s   @r   rb   rb   o   s     G% %r   rb   c                $    V P                  R4      # )zReturn 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)strings   &r   ends_bsrj   w   s     ??4  r   c                      a  ] tR t^t o RtRtRtRtRtRt	Rt
RtRt^tRtR	tRt]]R
R3]]RR3]]RR3]]RR3]]	RR33t. tR tR tR tRtV tR# )PlainTextReportz@Will generate a plain text report from a top_level Report object z  * %(name)sz  ! %sz  * %szLoaded Plugins:z
  %(name)s
z%(name)sz-  commands executed:z-  files copied:z-  files created:z
-  alerts:z	-  notes:c                `    \        \        P                  VP                  4      4      V n        R # r   )sorteddictitemsr   report_data)r
   report_nodes   &&r   r$   PlainTextReport.__init__   s    !$**[-=-=">?r   c           	        . ;V n         p\        V P                  4      ^ 8  d   VP                  V P                  4       VP                  V P                  4       Rp^ p\        V P
                  4      pV P
                   F\  w  rVW P                  RV/,          ,          pV^,          pW0P                  ,          ^ 8X  g   KB  W48  g   KJ  W P                  ,          pK^  	  W P                  ,          pVP                  V4       V P
                   Fw  w  rWVP                  V P                  4       VP                  V P                  RV/,          4       V P                   F#  w  rrV P                  WxP                  WV4       K%  	  Ky  	  \        V P                  4      ^ 8  d   VP                  V P                  4       RP!                  \#        R V4      4      pV# )    rm   r+   rn   c                 V    \        V \        4      '       d   V # V P                  R R4      # )r2   r3   r4   )is   &r   <lambda>)PlainTextReport.unicode.<locals>.<lambda>   s*    z!S/A/A! +J/0xx/I+Jr   )line_buflenHEADERrA   PLUGLISTHEADERrs   PLUGLISTITEMPLUGLISTMAXITEMSPLUGLISTSEPPLUGLISTFOOTERPLUGDIVIDERPLUGINFORMATsubsectionsprocess_subsectionr@   FOOTERjoinmap)r
   r|   linery   	plugcountsection_name_section_contentstype_format_headerfooteroutputs   &            r   unicodePlainTextReport.unicode   s   #%%t{{aOODKK( 	++,(()	#//OL%%(>>>DFA)))Q.Q](((	  0
 	###.2.>.>*LOOD,,-OOD--0FFG262B2B.''(8--(.A 3C /? t{{aOODKK(3  K') * r   c                0   W!9   d   V P                   P                  V4       \        VP                  V4      R  R7       F$  pV P                   P                  WF,          4       K&  	  \	        V4      ^ 8  d   V P                   P                  V4       R# R# R# )c                 D    \        V \        4      '       d
   V R ,          # R# )r+   rm   )r'   rq   )xs   &r   rz   4PlainTextReport.process_subsection.<locals>.<lambda>   s    z!T/B/B!F)"J"Jr   )keyN)r|   rA   rp   getr}   )r
   sectionr   r   r   r   items   &&&&&& r   r   "PlainTextReport.process_subsection   sv    >MM  (KK$J $$W^4	
 6{Q$$V,  r   )r|   rs   NzH========================================================================)r   r   r   r   r   r~   r   LEAFALERTNOTEr   r   r   r   r   r   r   rD   rM   rU   rZ   rb   r   r|   r$   r   r   r   r   r   s   @r   rl   rl      s     JFFDED&NLKNLK 
$4b9	T/b9	d0b9	\b9	t[b9K H@ D	- 	-r   rl   c                       ] tR t^tRtRtRtRtRtRt	Rt
RtRt^tR	tR
tRt]]RR3]]RR3]]RR3]]RR3]]	RR33tRtR# )
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)s">%(name)s</a></td>
z
</tr>
<tr>z</tr></table>z/<h2 id="%(name)s">Plugin <em>%(name)s</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>r   N)r   r   r   r   r   r~   r   r   r   r   r   r   r   r   r   r   r   rD   rM   rU   rZ   rb   r   r   r   r   r   r   r      s    DF F5DED:N@LK$NDLK 
$<gF	T7gF	d8gF	1gF	t0gFKr   r   c                   *   a  ] tR t^t o RtR tRtV tR# )
JSONReportz:Will generate a JSON report from a top_level Report objectc                L    \         P                  ! V P                  ^RR7      pV# )   F)indentensure_ascii)r   r   rs   )r
   r   s   & r   r   JSONReport.unicode   s    D,,QUKr   r   N)r   r   r   r   r   r   r   r   r   s   @r   r   r      s     D r   r   )r   r   ImportError
simplejsonr   r   r!   r8   r(   rD   rM   rU   rZ   rb   rj   rl   r   r   r   r   r   <module>r      s   
	 	;4 ;1T 1E
Id I",d ,, ,,$ ,%D %%4 %!H- H-V# #L C  s   B B B 