+
    iq  c                   sF   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                   s0   a  ] tR t^t o / tR tR tRtV tR# )Nodec                sB    \         P                  ! V P                  4      # N)jsondumpsdataself   &9/usr/lib/python3.14/site-packages/sos/report/reporting.py__str__ZNode.__str__   s    zz$))$$    c                s    R # )F r   node   &&r   can_addZNode.can_add   s    r
   r   N)	__name__
__module____qualname____firstlineno__r   r	   r   __static_attributes____classdictcell__Z__classdict__   @r   r    r       s     D% r
   r    c                   s    ] 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                   s6   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                s    / V n         R # r   r   r   r   r   __init__ZReport.__init__)   s	    	r
   c                "    \        V\        4      # r   )
isinstanceSectionr   r   r   r   ZReport.can_add,   s    $((r
   c                s    V F?  pV P                  V4      '       g   K  VP                  V P                  VP                  &   KA  	  R # r   )r   r   namer   Znodesr      &* r   addZ
Report.add/   s1    D||D!!'+yy		$))$ r
   r   N
r   r   r   r   r   r   r   r#   r   r   r   r   r   r   r   &   s     I)1 1r
   r   c                sV    \        V \        4      '       d   V # V P                  RR4      # )z3returns a string text for a given unicode/str inpututf8ignorer   ZstrZdecode)Zsr   r   _decoder(   5   s$    As##AD&()CDr
   c                   s6   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                s4    \        V4      V n        / V n        R # r   )r(   r    r   )r   r    r   r   r   ZSection.__init__>   s    DM		r
   c                r   r   )r   r   r   r   r   r   ZSection.can_addB   s    $%%r
   c                s    V F[  pV P                  V4      '       g   K  V P                  P                  VP                  . 4      P	                  VP                  4       K]  	  R # r   )r   r   Z
setdefaultADDS_TOappendr!   r"   r   r#   ZSection.addE   sB    D||D!!		$$T\\26==diiH r
   )r   r    Nr$   r   r   r   r   r   :   s      &&I Ir
   r   c                   s*   a  ] tR t^Kt o RtR tRtV tR# )CommandZcommandsc                sD    R \        V4      RVR\        V4      /V n        R# )r    return_codehrefNr(   r   )r   r    r,   r-   s   &&&&r   r   ZCommand.__init__O   s"    WT]"KWT],	r
   r   Nr   r   r   r   r)   r   r   r   r   r   r   r+   r+   K   s     G, ,r
   r+   c                   s*   a  ] tR t^Ut o RtR tRtV tR# )
CopiedFileZcopied_filesc                @    R \        V4      R\        V4      /V n        R# r    r-   Nr.   r   r    r-      &&&r   r   ZCopiedFile.__init__Y       WT]WT],	r
   r   Nr/   r   r   r   r0   r0   U   s     G, ,r
   r0   c                   s*   a  ] tR t^^t o RtR tRtV tR# )CreatedFileZcreated_filesc                r1   r2   r.   r3   r4   r   r   ZCreatedFile.__init__b   r5   r
   r   Nr/   r   r   r   r6   r6   ^   s     G, ,r
   r6   c                   s*   a  ] tR t^gt o RtR tRtV tR# )AlertZalertsc                &    \        V4      V n        R # r   r.   r   Zcontentr   r   r   ZAlert.__init__k       G$	r
   r   Nr/   r   r   r   r7   r7   g   s     G% %r
   r7   c                   s*   a  ] tR t^ot o RtR tRtV tR# )NoteZnotesc                r8   r   r.   r9   r   r   r   ZNote.__init__s   r:   r
   r   Nr/   r   r   r   r;   r;   o   s     G% %r
   r;   c                s$    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'
Z\)Zendswith)Zstringr   r   ends_bsr<   w   s     ??4  r
   c                   s   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                s`    \        \        P                  VP                  4      4      V n        R # r   )sorteddictZitemsr   report_data)r   Zreport_noder   r   r   ZPlainTextReport.__init__   s    !$**[-=-=">?r
   c           	     s   . ;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# )i    r>   r    r?   c                 sV    \        V \        4      '       d   V # V P                  R R4      # )r%   r&   r'   )ir   r   <lambda>Z)PlainTextReport.unicode.<locals>.<lambda>   s*    z!S/A/A! +J/0xx/I+Jr
   )line_buflenHEADERr*   PLUGLISTHEADERrB   PLUGLISTITEMPLUGLISTMAXITEMSPLUGLISTSEPPLUGLISTFOOTERPLUGDIVIDERPLUGINFORMATsubsectionsprocess_subsectionr)   FOOTERZjoinZmap)r   rE   ZlinerC   Z	plugcountZsection_nameZ_Zsection_contentsZtype_format_headerfooteroutputs   &            r   unicodeZ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                s0   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                 sD    \        V \        4      '       d
   V R ,          # R# )r    r>   )r   rA   )Zxr   r   rD   Z4PlainTextReport.process_subsection.<locals>.<lambda>   s    z!T/B/B!F)"J"Jr
   )keyN)rE   r*   r@   ZgetrF   )r   ZsectionrW   rS   rR   rT   Zitems   &&&&&& r   rP   Z"PlainTextReport.process_subsection   sv    >MM  (KK$J $$W^4	
 6{Q$$V,  r
   )rE   rB   NzH========================================================================)r   r   r   r   r   rG   rQ   LEAFALERTNOTErH   rI   rK   rJ   rL   rN   rM   r+   r0   r6   r7   r;   rO   rE   r   rV   rP   r   r   r   r   r   r=   r=      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
   r=   c                   s    ] 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   rG   rQ   rX   rY   rZ   rH   rI   rK   rJ   rL   rN   rM   r+   r0   r6   r7   r;   rO   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                   s*   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                sL    \         P                  ! V P                  ^RR7      pV# )i   F)ZindentZensure_ascii)r   r   rB   )r   rU   s   & r   rV   ZJSONReport.unicode   s    D,,QUKr
   r   N)r   r   r   r   r   rV   r   r   r   r   r   r\   r\      s     D r
   r\   )r   r   ZImportErrorZ
simplejsonr    r   r   r(   r   r+   r0   r6   r7   r;   r<   r=   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 