Hacked By AnonymousFox

Current Path : /opt/cloudlinux/venv/lib/python3.11/site-packages/pylint/reporters/__pycache__/
Upload File :
Current File : //opt/cloudlinux/venv/lib/python3.11/site-packages/pylint/reporters/__pycache__/text.cpython-311.pyc

�

�܋f�*�
�D�dZddlmZddlZddlZddlZddlZddlmZm	Z	ddl
mZmZm
Z
mZmZmZmZddlmZddlmZddlmZdd	lmZerdd
lmZddlmZGd�d
e
��ZeeefZ gd�Z!dZ"dZ#dZ$dddddddd�Z%dddddddd d!d"�	Z&d#�e	e��D��Z'	dEd'�Z(e	dFdGd+���Z)e		dHd(d,�dId0���Z)		dJdKd4�Z)dLd6�Z*Gd7�d8e��Z+Gd9�d:e+��Z,Gd;�d<e+��Z-Gd=�d>e-��Z.Gd?�d@e+��Z/dMdD�Z0dS)NzwPlain text reporters:.

:text: the default one grouping messages by module
:colorized: an ANSI colorized text reporter
�)�annotationsN)�asdict�fields)�
TYPE_CHECKING�Dict�
NamedTuple�Optional�TextIO�cast�overload)�Message)�BaseReporter)�
TextWriter)�_splitstrip)�PyLinter)�Sectionc�.�eZdZUdZded<	dZded<dS)�MessageStylezStyling of a message.�
str | None�color�ztuple[str, ...]�styleN)�__name__�
__module__�__qualname__�__doc__�__annotations__rr��f/builddir/build/BUILD/cloudlinux-venv-1.0.6/venv/lib/python3.11/site-packages/pylint/reporters/text.pyrrs<�������������� �E�����J�Jrr)��=�-�.z[�mz�0�1�3�4�5�7�9)�reset�bold�italic�	underline�blink�inverse�strike�30�31�32�33�34�35�36�37)	r,�black�red�green�yellow�blue�magenta�cyan�whitec��h|]	}|j��
Sr)�name)�.0�is  r�	<setcomp>rGEs��2�2�2�Q�!�&�2�2�2r�	msg_style�return�strc�d�d�|jD��}|jrp|j���r2|�ddg��|�|j��n%|�t
|j��|r%td�|��ztzSdS)z�Return ANSI escape code corresponding to color and style.

    :param msg_style: the message style

    :raise KeyError: if a nonexistent color or style identifier is given

    :return: the built escape code
    c�(�g|]}t|��Sr)�ANSI_STYLES)rE�effects  r�
<listcomp>z"_get_ansi_code.<locals>.<listcomp>Rs��C�C�C���V�$�C�C�Cr�38r)�;r )	rr�isdigit�extend�append�ANSI_COLORS�ANSI_PREFIX�join�ANSI_END)rH�	ansi_codes  r�_get_ansi_coderZIs���D�C�9�?�C�C�C�I���;��?�"�"�$�$�	;����d�C�[�)�)�)����Y�_�-�-�-�-����[���9�:�:�:��<��S�X�X�i�0�0�0�8�;�;�
�2r.�msg�MessageStyle | Nonec��dS�Nr)r[rHs  r�
colorize_ansir_^s	��
�Cr)rrrrc��dSr^r)r[rHrrs    rr_r_fs	���Crr �MessageStyle | str | None�kwargsc�l�t|t��s_tjdtd���|�d��}t
t|����}t|p||��}|j�t|j
��dkr|St|��}|r
|�|�t��S|S)a�colorize message by wrapping it with ANSI escape codes

    :param msg: the message string to colorize

    :param msg_style: the message style
        or color (for backwards compatibility): the color of the message style

    :param style: the message's style elements, this will be deprecated

    :param \**kwargs: used to accept `color` parameter while it is being deprecated

    :return: the ANSI escaped string
    zeIn pylint 3.0, the colorize_ansi function of Text reporters will only accept a MessageStyle parameter���
stacklevelrNr)
�
isinstancer�warnings�warn�DeprecationWarning�get�tuplerr�lenrrZ�
ANSI_RESET)r[rHrrbr�style_attrs�escape_codes       rr_r_rs���(�i��.�.�	B��
�
%���		
�	
�	
�	
��
�
�7�#�#���K��.�.�/�/�� ��!3�)�[�A�A�	����3�y��#7�#7�1�#<�#<��
� ��+�+�K��1��0�s�0�J�0�0�0��Jrr
c��d|j��S)Nz************* Module )�module)r[s r�make_headerrs�s��/�3�:�/�/�/rc�R��eZdZdZdZdZdZdd�fd
�
Zdd�Zdd�Z	dd�Z
dd�Z�xZS)�TextReporterz+Reports messages and layouts in plain text.�text�txtz2{path}:{line}:{column}: {msg_id}: {msg} ({symbol})N�output�
TextIO | NonerI�Nonec���t���|��t��|_|j|_|j|_dSr^)�super�__init__�set�_modules�line_format�	_template�_fixed_template��selfrx�	__class__s  �rr}zTextReporter.__init__�sA���
������ � � �"%�%�%��
��)���#�/���Q�QrrrrJ�filepathrc�X�t|jjjp|j��}||jkrdS||_tjd|��}|D]Q}|dtvr@tj	d|d�d���tj
d|dzdzd|��}�R||_dS)	zHSet the format template to be used and check for unrecognized arguments.Nz\{(\w+?)(:.*)?\}rzDon't recognize the argument 'zW' in the --msg-template. Are you sure it is supported on the current version of pylint?z\{z	(:.*?)?\}r )rJ�linter�config�msg_templater��re�findall�MESSAGE_FIELDSrhri�subr�)r�rrr��template�	arguments�arguments      r�on_set_current_modulez"TextReporter.on_set_current_module�s����t�{�)�6�H�$�.�I�I���t�~�%�%��F�"����J�2�H�=�=�	�!�	T�	T�H���{�.�0�0��
�U�X�a�[�U�U�U�����6�%�(�1�+�"5��"D�b�(�S�S���'����rr[r
c��t|��}dD]}||pd||<�|�|jjdi|����dS)z]Convenience method to write a formatted message with class default
        template.
        )�end_line�
end_columnr Nr)r�writelnr��format)r�r[�	self_dict�keys    r�
write_messagezTextReporter.write_message�sa���3�K�K�	�-�	2�	2�C�&�s�^�1�r�I�c�N�N����0�T�)�0�=�=�9�=�=�>�>�>�>�>rc���|j|jvrA|�t|����|j�|j��|�|��dS)z<Manage message of different type and in the context of path.N)rrrr�rs�addr��r�r[s  r�handle_messagezTextReporter.handle_message�s]���:�T�]�*�*��L�L��S�)�)�*�*�*��M���c�j�)�)�)����3�����r�layoutrc�~�t|j���t���||j��dS)zLaunch layouts display.)�fileN)�print�outrr�)r�r�s  r�_displayzTextReporter._display�s7��
�4�8����������F�D�H�-�-�-�-�-rr^�rxryrIrz)rrrJr�rrIrz�r[r
rIrz)r�rrIrz)
rrrrrD�	extensionr�r}r�r�r�r��
__classcell__�r�s@rruru�s��������5�5��D��I�F�K�R�R�R�R�R�R�R�(�(�(�(�,?�?�?�?� � � � �.�.�.�.�.�.�.�.rruc��eZdZdZdZd	d�ZdS)
�NoHeaderReporterzCReports messages and layouts in plain text without a module header.z	no-headerr[r
rIrzc��|j|jvr|j�|j��|�|��dS)z'Write message(s) without module header.N)rrrr�r�r�s  rr�zNoHeaderReporter.handle_message�sC���:�T�]�*�*��M���c�j�)�)�)����3�����rNr�)rrrrrDr�rrrr�r��s3������M�M��D� � � � � � rr�c�.��eZdZdZdZdZd
d�fd	�
Z�xZS)�ParseableTextReporterz�A reporter very similar to TextReporter, but display messages in a form
    recognized by most text editors :

    <filename>:<linenum>:<msg>
    �	parseablez0{path}:{line}: [{msg_id}({symbol}), {obj}] {msg}NrxryrIrzc���tj|j�d|j��td���t���|��dS)NzC output format is deprecated. This is equivalent to --msg-template=rdre)rhrirDr�rjr|r}r�s  �rr}zParseableTextReporter.__init__�sY����
��y�o�o�]a�]m�o�o���	
�	
�	
�	
�
	������ � � � � rr^r�)rrrrrDr�r}r�r�s@rr�r��sX����������D�D�K�!�!�!�!�!�!�!�!�!�!�!rr�c��eZdZdZdZdZdS)�VSTextReporterzVisual studio text reporter.�msvsz/{path}({line}): [{msg_id}({symbol}){obj}] {msg}N)rrrrrDr�rrrr�r��s������&�&��D�C�K�K�Krr�c
����eZdZUdZdZed��edd��edd��ed��edd��edd	��ed
d��d�Zd
ed<		dd�fd�
Zdd�Z	d d�Z
�xZS)!�ColorizedTextReporterz/Simple TextReporter that colorizes text output.�	colorizedr=N)r-r@)r-r.r<)r-r/r>)r1)�I�C�R�W�E�F�S�ColorMappingDict�
COLOR_MAPPINGrxry�
color_mapping�;ColorMappingDict | dict[str, tuple[str | None, str]] | NonerIrzc����t���|��|r�tt|�����dt
��sxt
jdtd���i}|�	��D]B\}}|d}tt|d����}t||��||<�C|}n ttt|��}|ptj|_ddg}t$j�d��|vr5t*jd	kr'ddl}	|	�|j��|_dSdSdS)
NrzeIn pylint 3.0, the ColorizedTextReporter will only accept ColorMappingDict as color_mapping parameterrdre�z
xterm-16colorzxterm-256color�TERM�win32)r|r}rg�list�valuesrrhrirj�itemsrlrrr	r�r�r�r��os�environrk�sys�platform�colorama�AnsiToWin32r�)r�rxr��temp_color_mappingr��valuerro�
ansi_termsr�r�s          �rr}zColorizedTextReporter.__init__
sq���	������ � � ��	L����%�%�'�'�(�(��+�\�"
�"
�	L�
�M�*�"��	
�
�
�
�46��+�1�1�3�3�
K�
K�
��U��a���#�K��a��$9�$9�:�:��*6�u�k�*J�*J�"�3�'�'�.�M�M� ��*:�!;�]�K�K�M�*�Q�.C�.Q���%�'7�8�
�
�:�>�>�&�!�!��3�3��|�w�&�&�����#�/�/���9�9�����4�3�&�&r�msg_idrJrc�`�|j�|d��ptd��S)z;Returns the message style as defined in self.color_mapping.rN)r�rkr)r�r�s  r�_get_decorationz%ColorizedTextReporter._get_decoration1s*���!�%�%�f�Q�i�0�0�F�L��4F�4F�Frr[r
c��|j|jvrf|�d��}tt	|��|��}|�|��|j�|j��|�|j��}t|j|��|_t|j	|��|_	t|j
|��|_
t|j|��|_|�|��dS)z`Manage message of different types, and colorize output
        using ANSI escape codes.
        r�N)rrrr�r_rsr�r�r�r[�symbol�categoryr�)r�r[rH�modseps    rr�z$ColorizedTextReporter.handle_message5s����:�T�]�*�*��,�,�S�1�1�I�"�;�s�#3�#3�Y�?�?�F��L�L�� � � ��M���c�j�)�)�)��(�(���/�/�	�����3�3���"�3�:�y�9�9��
�$�S�\�9�=�=����c�e�Y�/�/������3�����r)NN)rxryr�r�rIrz)r�rJrIrr�)rrrrrDrr�rr}r�r�r�r�s@rr�r��s
��������9�9��D�
�\�'�
"�
"�
�\�$�	�
*�
*�
�\�)�%7�
8�
8�
�\�)�
$�
$�
�\�%��
+�
+�
�\�%�!6�
7�
7�
�\�(�L�
1�
1�'�'�M�����!%�
�":�":�":�":�":�":�":�HG�G�G�G� � � � � � � � rr�r�rrzc�
�|�t��|�t��|�t��|�t��|�t
��dSr^)�register_reporterrur�r�r�r�)r�s r�registerr�Gso��
���\�*�*�*�
���-�.�.�.�
���2�3�3�3�
���^�,�,�,�
���2�3�3�3�3�3r)rHrrIrJ).)r[rJrHr\rIrJ)..)
r[rJrHrrrJrrrIrJ)Nr )
r[rJrHrarrJrbrrIrJ)r[r
rIrJ)r�rrIrz)1r�
__future__rr�r�r�rh�dataclassesrr�typingrrrr	r
rr�pylint.messager
�pylint.reportersr�%pylint.reporters.ureports.text_writerr�pylint.utilsr�pylint.lintr�pylint.reporters.ureports.nodesrrrJr��TITLE_UNDERLINESrVrXrnrMrUr�rZr_rsrur�r�r�r�r�rrr�<module>r�s���
��#�"�"�"�"�"�	�	�	�	�	�	�	�	�
�
�
�
�����&�&�&�&�&�&�&�&�T�T�T�T�T�T�T�T�T�T�T�T�T�T�T�T�T�T�"�"�"�"�"�"�)�)�)�)�)�)�<�<�<�<�<�<�$�$�$�$�$�$��8�$�$�$�$�$�$�7�7�7�7�7�7�K�K�K�K�K�:�K�K�K���\�)�*��&�&�&������
�
�
����
�������
��
�����
�
�
��3�2�&�&��/�/�2�2�2��&�����*
�&)�����
���
� ���
������
���,0��%�%�%�%�%�P0�0�0�0�8.�8.�8.�8.�8.�<�8.�8.�8.�v	 �	 �	 �	 �	 �|�	 �	 �	 �!�!�!�!�!�L�!�!�!�&D�D�D�D�D�*�D�D�D�E �E �E �E �E �L�E �E �E �P4�4�4�4�4�4r

Hacked By AnonymousFox1.0, Coded By AnonymousFox