????
Your IP : 3.22.234.133
�
k�`�����ddlZddlZddlZddlZddlmZddlmZddlm Z ddl
mZmZm
Z
ddlmZddlmZddlmZdd lmZdd
lmZddlmZmZddlmZmZdd
lmZddl m!Z!Gd�d��Z"d�Z#d�Z$e%dkre$��dSdS)�N)�datetime��Path)�TextIO)�blender�
postfilter�tools)�is_relative_to)�ProspectorConfig)�
configuration)�FatalProspectorException)�
FileFinder)�
FORMATTERS� Formatter)�Location�Message)�DEPRECATED_TOOL_NAMES)�
CaptureOutputc�H�eZdZdefd�Zd�Zd�Zd�Zd�Zd�Z de
d efd
�ZdS)�
Prospector�configc�:�||_d|_|j|_dS�N)r�summary�messages)�selfrs �_/builddir/build/BUILD/cloudlinux-venv-1.0.7/venv/lib/python3.11/site-packages/prospector/run.py�__init__zProspector.__init__s�����������
�
�
�c�N�|jjrtj|��}|jjr`g}d�tj��D��}|D]<}|�|j|j��|_|� |���=|}tj|j|��S)Nc��i|]\}}||�� S�r")�.0�k�vs r�
<dictcomp>z/Prospector.process_messages.<locals>.<dictcomp>!s��H�H�H�$�!�Q��A�H�H�Hr)
r�blendingr�blend�legacy_tool_namesr�items�get�source�appendr�filter_messages�python_modules)r�found_filesr�updated� new_names�msgs r�process_messageszProspector.process_messagess����;�� /��}�X�.�.�H��;�(� ��G�H�H�*?�*E�*G�*G�H�H�H�I��
$�
$��&�]�]�3�:�s�z�B�B��
����s�#�#�#�#��H��)�+�*D�h�O�O�Orc
��|j���}dtj��i}|�|j�����d�|jjD��}t|d|j���gi�}g}|D]{}t|jj
dddd��}t|}d|�d|�d|�d�} tdd || �
��}
|�
|
��tj| t ����||j�|��D�]+}t$j���D]\}}
|
|jkr|}n�d} t-|jj�
��5}||�|��z
}|jjr�t|jj
dddd��}|���r@d|�d|�����} |�
t|d|| �
����|���r@d|�d|�����} |�
t|d|| �
����ddd��n#1swxYwY��W#t8$rK}t:j�tA|����t;j!d��Yd}~���d}~wtD$rv}|jj#rt9d|�d���|�t|jj
dddd��}d|�d�} t|d|| �
��}
|�
|
��Yd}~��%d}~wwxYw|�$||��}tK|��|d<tj��|d<|d|dz
}d|�&��z|d<g}|jj'���D]\}}|�|�
||f���tK|��dkr"d�(d�|D����|d<||_)|j*|z|_*dS)N�startedc�,�g|]}t|����Sr"r)r#�ps r�
<listcomp>z&Prospector.execute.<locals>.<listcomp>1s��4�4�4�Q��a���4�4�4r�exclusion_filterszTool z has been renamed to z. The old name zf is now deprecated and will be removed in Prospector 2.0. Please update your prospector configuration.�
prospector�Deprecation)�message)�category�Unknown)�hidezstderr from z:
z
hidden-outputzstdout from �z failed to run.zV failed to run (exception was raised, re-run prospector with -X to see the stacktrace)�failure�
message_count� completedz%0.2f�
time_takenrz, c��g|]}d|z��S)z%s: %sr")r#�infos rr9z&Prospector.execute.<locals>.<listcomp>�s��3`�3`�3`��H�t�O�3`�3`�3`r�external_config)+r�replace_deprecated_tool_namesr�now�update�get_summary_information�pathsr�make_exclusion_filterr�workdirrrr-�warnings�warn�DeprecationWarning� get_toolsr �TOOLSr*� __class__r�direct_tool_stdout�run�include_tool_stdout�get_hidden_stderr�get_hidden_stdoutr
�sys�stderr�write�str�exit� Exception�die_on_tool_errorr4�len�
total_seconds�
configured_by�joinrr)r�deprecated_namesrrMr0r�deprecated_name�loc�new_namer3r=�tool�name�cls�toolname�capture�fatal�ex�deltarHrds r�executezProspector.execute)s<���;�D�D�F�F��
�x�|�~�~�
�� ���t�{�:�:�<�<�=�=�=�4�4�$�+�"3�4�4�4�� �%�a�D�K�<]�<]�<_�<_�;`�a�a���� 0� <� <�O��4�;�.��d�D�$�G�G�C�,�_�=�H�@��@�@�h�@�@� /�@�@�@�
������ ���G�
�O�O�G�$�$�$��M�#�(:�;�;�;�;�;��K�)�)�+�6�6�+ )�+ )�D�"�[�.�.�0�0�
%�
%� ��c��$�.�(�(�#�H��E�)�%��#
)�#�D�K�,J�(J�K�K�K�b�w������ 5� 5�5�H��{�6�b�&�t�{�':�D�$��d�S�S��"�4�4�6�6�b�"[��"[�"[�g�>W�>W�>Y�>Y�"[�"[�C�$�O�O�G�H�o�s�\_�,`�,`�,`�a�a�a�"�4�4�6�6�b�"[��"[�"[�g�>W�>W�>Y�>Y�"[�"[�C�$�O�O�G�H�o�s�\_�,`�,`�,`�a�a�a�b�b�b�b�b�b�b�b�b�b�b����b�b�b�b���,�
�
�
��
� � ��U���,�,�,�����������������
)�
)�
)��;�0�^�2�3T�8�3T�3T�3T�U�U�[]�]��t�{�2�D�$��d�K�K��_�H�_�_�_��"����� ��������(�(�(�(�(�(�(�(�����
)���� �(�(��h�?�?��#&�x�=�=��� �'�|�~�~������$�w�y�'9�9�� '�%�*=�*=�*?�*?� ?������#'�;�#<�#B�#B�#D�#D� >� >��D�-��(��&�&��m�'<�=�=�=������!�#�#�)-���3`�3`�P_�3`�3`�3`�)a�)a�G�%�&�����
��0��
�
�
sK�(J�C*I9�-J�9I= �=J�I= �J�
M�AK�
M�#A+M�Mc��|jSr)r�rs r�get_summaryzProspector.get_summary�s
���|�rc��|jSr)rrts r�get_messageszProspector.get_messages�s
���}�rc�$���j���}|D]�}|\}}|�jd<d}�jjs1t �fd��jjD����r�jj}t|�j�j�jj |��}|s,�jj
s ��|tj
��|D]E}tj|d��5}��||��ddd��n#1swxYwY�F��dS)N� formatterc3�L�K�|]}t|�jj��V��dSr)r
rrO)r#r8rs �r� <genexpr>z,Prospector.print_messages.<locals>.<genexpr>�sC�����6�6�;<��q�$�+�"5�6�6�6�6�6�6�6�6rzw+)r�get_output_reportr�absolute_paths�allrMrOrr�profile�quiet�write_tor[�stdout�codecs�open) r�output_reports�report�
output_format�output_files�relative_tory�output_file�targets ` r�print_messageszProspector.print_messages�sz�����6�6�8�8��$� 5� 5�F�*0�'�M�<�(5�D�L��%��K��;�-�
2�#�6�6�6�6�@D��@Q�6�6�6�3�3�
2�#�k�1��"�=�1�$�,��
�t�{�Ob�do�p�p�I��
5���(9�
5��
�
�i���4�4�4�+�
5�
5���[��d�3�3�5�v��M�M�)�V�4�4�4�5�5�5�5�5�5�5�5�5�5�5����5�5�5�5��
5� 5� 5s� D�D�
Dryr�c���|�|�|jj|jj|jj�����|�d��dS)N)rrr�
)r]�renderr�
messages_only�summary_only�show_profile)rryr�s rr�zProspector.write_to�sh�������� �K�5�5�!�[�5�5���0�
�
�
�
�
�
� ���T�����rN)
�__name__�
__module__�__qualname__rrr4rrrurwr�rrr�r"rrrrs�������(�/�(�(�(�(�
P�P�P�]1�]1�]1�~������5�5�5�, �)� �V� � � � � � rrc��tj��}tjdd���}|�|jd��S)z�
This is a helper method to return an argparse parser, to
be used with the Sphinx argparse plugin for documentation.
r;N)�prog�description)�cfg�
build_manager�build_command_line_source�build_parser�settings)�managerr,s r�
get_parserr��s@��
��!�!�G�
�
*��$�
O�
O�
O�F����w�/��6�6�6rc��t��}|j}t|��dkrltd�|D����sStj�d��t�����t j d��t|��}|���|���|�
��rt j d��t|�����dkrt j d��t j d��dS)N�c3�TK�|]#}tj�|��V��$dSr)�os�path�isfile)r#r�s rr{zmain.<locals>.<genexpr>�s0����!I�!I�4�"�'�.�.��"6�"6�!I�!I�!I�!I�!I�!IrzA
In multi-path mode, all inputs must be files, not directories.
rAr)rrMrbr~r[r\r]r��print_usager_rrrr��exit_with_zero_on_successrw)rrMr;s r�mainr��s
��
�
�
�F��L�E�
�5�z�z�A�~�~�c�!I�!I�5�!I�!I�!I�I�I�~��
���b�c�c�c���� � �"�"�"��������F�#�#�J�������������
�'�'�)�)�� ������
�:�"�"�$�$�%�%��)�)��������H�Q�K�K�K�K�Kr�__main__)&r��os.pathr�r[rPr�pathlibr�typingrr;rrr �prospector.compatr
�prospector.configrrr��prospector.exceptionsr
�prospector.finderr�prospector.formattersrr�prospector.messagerr�prospector.toolsr�prospector.tools.utilsrrr�r�r�r"rr�<module>r�s���
�
�
�
�����
�
�
�
�����������������������1�1�1�1�1�1�1�1�1�1�,�,�,�,�,�,�.�.�.�.�.�.�2�2�2�2�2�2�:�:�:�:�:�:�(�(�(�(�(�(�7�7�7�7�7�7�7�7�0�0�0�0�0�0�0�0�2�2�2�2�2�2�0�0�0�0�0�0�X�X�X�X�X�X�X�X�v7�7�7����8�z����D�F�F�F�F�F��r