%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /lib/python3/dist-packages/sos/report/__pycache__/
Upload File :
Create Path :
Current File : //lib/python3/dist-packages/sos/report/__pycache__/reporting.cpython-312.pyc

�

i��dS��D�dZ	ddlZGd�de�ZGd�de�ZGd�de�Zd	�ZGd
�de�Z	Gd�d
e�Z
Gd�de�ZGd�de�ZGd�de�Z
Gd�de�Zd�ZGd�de�ZGd�de�ZGd�de�Zy#e$rddlZY��wxYw)zR This provides a restricted tag language to define the sosreport
    index/report
�Nc��eZdZd�Zd�Zy)�Nodec�@�tj|j�S�N)�json�dumps�data��selfs �6/usr/lib/python3/dist-packages/sos/report/reporting.py�__str__zNode.__str__s���z�z�$�)�)�$�$�c��y)NF��r�nodes  r�can_addzNode.can_adds��rN)�__name__�
__module__�__qualname__r
rrrrrrs��%�rrc��eZdZdZy)�Leafz0Marker class that can be added to a Section nodeN)rrr�__doc__rrrrrs��:�rrc�"�eZdZdZd�Zd�Zd�Zy)�Reportz?The root element of a report. This is a container for sections.c��i|_yr)r	r
s r�__init__zReport.__init__'s	����	rc�"�t|t�Sr)�
isinstance�Sectionrs  rrzReport.can_add*s���$��(�(rc�|�|D]7}|j|�s�|j|j|j<�9yr)rr	�name�r�nodesrs   r�addz
Report.add-s3���	1�D��|�|�D�!�'+�y�y��	�	�$�)�)�$�	1rN�rrrrrrr%rrrrr$s��I��)�1rrc�J�t|t�r|S|jdd�S)z3returns a string text for a given unicode/str input�utf8�ignore�r�str�decode)�ss r�_decoder.3s!���A�s�#�A�D����&�(�)C�Drc�"�eZdZdZd�Zd�Zd�Zy)r zeA section is a container for leaf elements. Sections may be nested
    inside of Report objects only.c�2�t|�|_i|_yr)r.r"r	)rr"s  rrzSection.__init__<s���D�M��	���	rc�"�t|t�Sr)rrrs  rrzSection.can_add@s���$��%�%rc��|D]S}|j|�s�|jj|jg�j	|j��Uyr)rr	�
setdefault�ADDS_TO�appendr#s   rr%zSection.addCsF���	I�D��|�|�D�!��	�	�$�$�T�\�\�2�6�=�=�d�i�i�H�	IrNr&rrrr r 8s��&��&�Irr c��eZdZdZd�Zy)�Command�commandsc�>�t|�|t|�d�|_y)N)r"�return_code�href�r.r	)rr"r:r;s    rrzCommand.__init__Ms��$�T�]�$/�$�T�]�,��	rN�rrrr4rrrrr7r7Is���G�,rr7c��eZdZdZd�Zy)�
CopiedFile�copied_filesc�<�t|�t|�d�|_y�N)r"r;r<�rr"r;s   rrzCopiedFile.__init__W���$�T�]�$�T�]�,��	rNr=rrrr?r?Ss���G�,rr?c��eZdZdZd�Zy)�CreatedFile�
created_filesc�<�t|�t|�d�|_yrBr<rCs   rrzCreatedFile.__init__`rDrNr=rrrrFrF\s���G�,rrFc��eZdZdZd�Zy)�Alert�alertsc�$�t|�|_yrr<�r�contents  rrzAlert.__init__i����G�$��	rNr=rrrrJrJes���G�%rrJc��eZdZdZd�Zy)�Note�notesc�$�t|�|_yrr<rMs  rrz
Note.__init__qrOrNr=rrrrQrQms���G�%rrQc�$�|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)�strings r�ends_bsrXus���?�?�4� � rc��eZdZdZdZdZdZdZdZdZ	dZ
dZd	ZdZ
d
ZdZeeddfeed
dfeeddfeeddfeeddffZgZd�Zd�Zd�Zy)�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:c�^�ttj|j��|_yr)�sorted�dict�itemsr	�report_data)r�report_nodes  rrzPlainTextReport.__init__�s��!�$�*�*�[�-=�-=�">�?��rc	��gx|_}t|j�dkDr|j|j�|j|j�d}d}t|j
�}|j
D]Q\}}||jj|��z
}|dz
}||jzdk(s�=||ks�C||jz
}�S||jz
}|j|�|j
D]�\}}|j|j�|j|jj|���|jD]&\}}	}
}|j||j|
|	|��(��t|j �dkDr|j|j �dj#t%d�|��}|S)Nrr[)r"�r\c�J�t|t�r|S|jdd�S)Nr(r)r*)�is r�<lambda>z)PlainTextReport.unicode.<locals>.<lambda>�s"��
�1�c�0B�1��01�����0J�r)�line_buf�len�HEADERr5�PLUGLISTHEADERrb�PLUGLISTITEM�format�PLUGLISTMAXITEMS�PLUGLISTSEP�PLUGLISTFOOTER�PLUGDIVIDER�PLUGINFORMAT�subsections�process_subsectionr4�FOOTER�join�map)
rri�linerg�	plugcount�section_name�_�section_contents�type_�format_�header�footer�outputs
             r�unicodezPlainTextReport.unicode�s���#%�%��
�������q� ��O�O�D�K�K�(�	����+�+�,���
����(�(�)�	�#�/�/�	)�O�L�!��D�%�%�,�,�,�,�?�?�D�
��F�A��D�)�)�)�Q�.�Q��]���(�(�(��		)�
	
��#�#�#�������.2�.>�.>�	A�*�L�*��O�O�D�,�,�-��O�O�D�-�-�4�4�,�4�G�H�26�2B�2B�
A�.��w����'�'�(8�%�-�-�(.���A�
A�	A�
�����q� ��O�O�D�K�K�(����C�!L� (�*�+���
rc��||vr�|jj|�t|j|�d���D] }|jj||z��"t	|�dkDr|jj|�yyy)Nc�0�t|t�r|dSdS)Nr"r[)rr`)�xs rrhz4PlainTextReport.process_subsection.<locals>.<lambda>�s��z�!�T�/B�!�F�)���r)�keyr)rir5r_�getrj)r�sectionr�r�rr��items       rruz"PlainTextReport.process_subsection�s���'�>��M�M� � ��(���K�K��$�J��
5���
�
�$�$�W�t�^�4�	
5�
�F��a���
�
�$�$�V�,� �rN)rrrrrkrv�LEAF�ALERT�NOTErlrmrprorqrsrrr7r?rFrJrQrtrirr�rurrrrZrZ�s���J�
�F�
�F��D��E��D�&�N��L��K����N��L��K�
�$�4�b�9�	�T�/�b�9�	�d�0�b�9�	��\�b�9�	
�t�[�b�9��K��H�@� �D	-rrZc�v�eZdZdZdZdZdZdZdZdZ	dZ
dZd	Zd
Z
dZdZeed
dfeeddfeeddfeeddfeeddffZy)�
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>r]z
</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)rrrrrkrvr�r�r�rlrmrprorqrsrrr7r?rFrJrQrtrrrr�r��s���D�
�F��F�5�D��E��D�:�N�<�L��K���$�N�@�L��K�
�$�<�g�F�	�T�7�g�F�	�d�8�g�F�	��1�g�F�	
�t�0�g�F��Krr�c��eZdZdZd�Zy)�
JSONReportz:Will generate a JSON report from a top_level Report objectc�J�tj|jdd��}|S)N�F)�indent�ensure_ascii)rrrb)rr�s  rr�zJSONReport.unicode�s�����D�,�,�Q�U�K���
rN)rrrrr�rrrr�r��s
��D�rr�)rr�ImportError�
simplejson�objectrrrr.r r7r?rFrJrQrXrZr�r�rrr�<module>r�s������
�6��	�4�	�
1�T�1�E�
I�d�I�",�d�,�,��,�,�$�,�%�D�%�%�4�%�!�H-�f�H-�V#��#�L��������s�B�	B�B

Zerion Mini Shell 1.0