AlkantarClanX12

Your IP : 3.137.169.56


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

�

�܋f����dZddlZddlZddlZddlZddlZddlmZmZddlm	Z
gd�Zejd��Z
dd�Zdd�Zd	�Zd
�Zd�Zd�Zd
�Zdd�ZdS)z,
API for the command-line I{pyflakes} tool.
�N)�checker�__version__)�reporter)�check�	checkPath�checkRecursive�iterSourceCode�mains#^#!.*\bpython(3(\.\d+)?|w)?[dmu]?\sc�*�|�tj��}	tj||���}nm#t$r>}|�||jd|j|j|j	��Yd}~dSd}~wt$r|�|d��YdSwxYwtj
|��}tj|||���}|j�d����|jD]}|�|���t%|j��S)	a�
    Check the Python source given by C{codeString} for flakes.

    @param codeString: The Python source to check.
    @type codeString: C{str}

    @param filename: The name of the file the source came from, used to report
        errors.
    @type filename: C{str}

    @param reporter: A L{Reporter} instance, where errors and warnings will be
        reported.

    @return: The number of warnings emitted.
    @rtype: C{int}
    N)�filenamer�zproblem decoding source)�file_tokensrc��|jS�N)�lineno)�ms �]/builddir/build/BUILD/cloudlinux-venv-1.0.6/venv/lib/python3.11/site-packages/pyflakes/api.py�<lambda>zcheck.<locals>.<lambda>1s��!�(��)�key)�modReporter�_makeDefaultReporter�ast�parse�SyntaxError�syntaxError�argsr�offset�text�	Exception�unexpectedErrorr�make_tokens�Checker�messages�sort�flake�len)�
codeStringrr�tree�er�w�warnings        rrrs-��"���3�5�5����y��h�7�7�7�����������X�q�v�a�y�!�(�A�H�a�f�M�M�M��q�q�q�q�q���������� � ��+D�E�E�E��q�q������%�j�1�1�K����+��I�I�I�A��J�O�O�*�*�O�+�+�+��:� � �����w������q�z�?�?�s�.�
B�3A1�1#B�Bc�<�|�tj��}	t|d��5}|���}ddd��n#1swxYwYn9#t$r,}|�||jd��Yd}~dSd}~wwxYwt|||��S)z�
    Check the given path, printing out any warnings detected.

    @param reporter: A L{Reporter} instance, where errors and warnings will be
        reported.

    @return: the number of warnings printed
    N�rbr
)rr�open�read�OSErrorr!rr)rr�f�codestrr*s     rrr7s������3�5�5���
�(�D�
!�
!�	�Q��f�f�h�h�G�	�	�	�	�	�	�	�	�	�	�	����	�	�	�	�������� � ��1�6�!�9�5�5�5��q�q�q�q�q�����������(�H�-�-�-s9�A�A�A�A�A�A�A�
B
�!B�B
c�X�|�d��rdS|�d��rdSd}	t|d��5}|�|��}|s	ddd��dS	ddd��n#1swxYwYn#t$rYdSwxYwt�|��S)z0Return True if filename points to a Python file.z.pyT�~F�r.N)�endswithr/r0r1�PYTHON_SHEBANG_REGEX�match)r�	max_bytesr2rs    r�isPythonFiler;Ks*����������t���������u��I��
�(�D�
!�
!�	�Q��6�6�)�$�$�D��
��	�	�	�	�	�	�	�	�
�	�	�	�	�	�	�	�	�	�	�	����	�	�	�	��������u�u����� �%�%�d�+�+�+s;�B�A5�B�)B�5A9�9B�<A9�=B�
B�Bc#�K�|D]y}tj�|��rTtj|��D]>\}}}|D]5}tj�||��}t|��r|V��6�?�u|V��zdS)z�
    Iterate over all Python source files in C{paths}.

    @param paths: A list of paths.  Directories will be recursed into and
        any .py files found will be yielded.  Any non-directories will be
        yielded as-is.
    N)�os�path�isdir�walk�joinr;)�pathsr>�dirpath�dirnames�	filenamesr�	full_paths       rr	r	as���������
�7�=�=����	�02���
�
�
(�
(�,���9� )�(�(�H� "����W�h� ?� ?�I�#�I�.�.�(�'�����(�
(��J�J�J�J��rc�T�d}t|��D]}|t||��z
}�|S)a;
    Recursively check all source files in C{paths}.

    @param paths: A list of paths to Python source files and directories
        containing Python source files.
    @param reporter: A L{Reporter} where all of the warnings and errors
        will be reported to.
    @return: The number of warnings found.
    r)r	r)rBr�warnings�
sourcePaths    rrrts;���H�$�U�+�+�4�4�
��I�j�(�3�3�3����Orc���ddl}	t||��}n#t$rYdSwxYw�fd�}	|�||��dS#t$rYdSwxYw)z�Handles a signal with sys.exit.

    Some of these signals (SIGPIPE, for example) don't exist or are invalid on
    Windows. So, ignore errors that might arise.
    rNc�0��tj���dSr)�sys�exit)�sigr2�messages  �r�handlerz_exitOnSignal.<locals>.handler�s����������r)�signal�getattr�AttributeError�
ValueError)�sigNamerOrQ�	sigNumberrPs `   r�
_exitOnSignalrW�s�����M�M�M���F�G�,�,�	�	������	���	���������
��
�
�i��)�)�)�)�)���
�
�
�	
���
���s��
&�&�A�
A�Ac�d�t�dtj���dtj����S)zQ
    Retrieve and format package version along with python version & OS used
    z Python z on )r�platform�python_version�system�rr�_get_versionr]�s5��
�[�[�(�1�3�3�3�3�X�_�5F�5F�5F�
H�Irc���ddl}tdd��tdd��|�|d���}|�d	d
dt	�����|�d
dd���|�|���j}tj��}|rt||��}n-ttj�
��d|��}t|dk���)z&Entry point for the script "pyflakes".rN�SIGINTz... stopped�SIGPIPEr
z$Check Python source files for errors)�prog�descriptionz-Vz	--version�version)�actionrcr>�*z7Path(s) of Python file(s) to check. STDIN if not given.)�nargs�help)rz<stdin>)�argparserW�ArgumentParser�add_argumentr]�
parse_argsr>rrrrrL�stdinr0�
SystemExit)rarrh�parserrrHs      rr
r
�s���O�O�O��(�M�*�*�*��)�Q����
�
$�
$�$�1W�%�Y�Y�F�
����k�)�\�^�^��T�T�T�
����c�V��X�X�X����$��'�'�,�D��/�1�1�H��@�!�$��1�1��������)�)�9�h�?�?��
�X��\�
"�
"�"rr)NN)�__doc__rr=rY�rerL�pyflakesrrrr�__all__�compiler8rrr;r	rrWr]r
r\rr�<module>rts�����
�
�
�	�	�	�	�����	�	�	�	�
�
�
�
�)�)�)�)�)�)�)�)�,�,�,�,�,�,�
L�
L�
L��!�r�z�"I�J�J��"�"�"�"�J.�.�.�.�(,�,�,�,���&
�
�
� 
�
�
�6I�I�I�#�#�#�#�#�#r