AlkantarClanX12

Your IP : 18.223.43.106


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

�

�܋f���4�dZddlmZddlZddlZddlZddlZddlmZddl	m
Z
ddlmZm
Z
ddlmZmZmZejdkrdd	lmZndd	lmZd*d�Zd+d,d�Ze				d-d.d���Ze		d/d0d���Z				d1d2d$�Zd3d4d(�Zed)kre��dSdS)5alEmacs and Flymake compatible Pylint.

This script is for integration with Emacs and is compatible with Flymake mode.

epylint walks out of python packages before invoking pylint. This avoids
reporting import errors that occur when a module within a package uses the
absolute import path to get another module within this package.

For example:
    - Suppose a package is structured as

        a/__init__.py
        a/b/x.py
        a/c/y.py

   - Then if y.py imports x as "from a.b import x" the following produces pylint
     errors

       cd a/c; pylint y.py

   - The following obviously doesn't

       pylint a/c/y.py

   - As this script will be invoked by Emacs within the directory of the file
     we are checking we need to go out of it to avoid these false positives.

You may also use py_run to run pylint with desired options and get back (or not)
its output.
�)�annotationsN)�Sequence)�StringIO)�PIPE�Popen)�NoReturn�TextIO�overload)��)�Literal�return�dict[str, str]c��ttj��}tj�t
j��|d<|S)zVExtracts the environment PYTHONPATH and appends the current 'sys.path'
    to it.
    �
PYTHONPATH)�dict�os�environ�pathsep�join�sys�path)�envs �_/builddir/build/BUILD/cloudlinux-venv-1.0.6/venv/lib/python3.11/site-packages/pylint/epylint.py�_get_envr8s2���r�z�
�
�C��
�����1�1�C����J���filename�str�options�
Sequence[str]�intc�p�tj�|��}tj�|��}tj�|��}|dkr�tj�tj�|d����r�tj�tj�|��|��}tj�|��}|dkr=tj�tj�|d������d}tjd|gdddd|gzt|��z}t|t|t��d	�
��5}|j
D]m}|�d��r�|�d��}	|	r-|	d
|kr!d�|g|	dd�z��}t!|d����n|���|jcddd��S#1swxYwYdS)a�Pylint the given file.

    When run from Emacs we will be in the directory of a file, and passed its
    filename.  If this file is part of a package and is trying to import other
    modules from within its own package or another package rooted in a directory
    below it, pylint will classify it as a failed import.

    To get around this, we traverse down the directory tree to find the root of
    the package this module is in.  We then invoke pylint from this directory.

    Finally, we must correct the filenames in the output generated by pylint so
    Emacs doesn't become confused (it will expect just the original filename,
    while pylint may extend it with extra directories if we've traversed down
    the tree)
    �/z__init__.pyz:import sys; from pylint.lint import Run; Run(sys.argv[1:])�-cz--msg-templatez;{path}:{line}: {category} ({msg_id}, {symbol}, {obj}) {msg}z-r�nT)�stdout�cwdr�universal_newlineszNo config file found�:r�N� )�end)rr�abspath�dirname�basename�existsrr�
executable�listrrrr'�
startswith�split�print�wait�
returncode)
rr �	full_path�parent_path�
child_path�run_cmd�cmd�process�line�partss
          r�lintrAAsD��"�����)�)�I��'�/�/�)�,�,�K���!�!�)�,�,�J�
��
�
�����
����[�-�0�0�"�"�
��W�\�\�"�'�"2�"2�;�"?�"?��L�L�
��g�o�o�k�2�2��	��
�
�����
����[�-�0�0�"�"�
�K�G�	���w�'��I����
�	
��w�-�-�	��
��D�k�x�z�z�d�
�
�
�"�	��N�		!�		!�D����5�6�6�
���J�J�s�O�O�E��
8��q��Z�/�/��x�x��
�U�1�2�2�Y� 6�7�7���$�C� � � � � ��������!�"�"�"�"�"�"�"�"�"�"�"�"����"�"�"�"�"�"s�BH+�+H/�2H/.�command_options�
return_std�Literal[False]r'�TextIO | int | None�stderr�Nonec��dS�Nr�rBrCr'rFs    r�py_runrK}�	���Cr�
Literal[True]�tuple[StringIO, StringIO]c��dSrIrrJs    rrKrK�rLr�F�bool� tuple[StringIO, StringIO] | Nonec�J�tjdtd���dtjvrtjnd}|ddg}tj|tj�d�����}||z}|�|rtntj
}|�|rtntj}t|d
||t��d���5}|���\}	}
|r*t|	��t|
��fcd	d	d	��S	d	d	d	��d	S#1swxYwYd	S)
asRun pylint from python.

    ``command_options`` is a string containing ``pylint`` command line options;
    ``return_std`` (boolean) indicates return of created standard output
    and error (see below);
    ``stdout`` and ``stderr`` are 'file-like' objects in which standard output
    could be written.

    Calling agent is responsible for stdout/err management (creation, close).
    Default standard output and error are those from sys,
    or standalone ones (``subprocess.PIPE``) are used
    if they are not set and ``return_std``.

    If ``return_std`` is set to ``True``, this function returns a 2-uple
    containing standard output and error related to created process,
    as follows: ``(stdout, stderr)``.

    To silently run Pylint on a module, and get its standard output and error:
        >>> (pylint_stdout, pylint_stderr) = py_run( 'module_name.py', True)
    �^'epylint' will be removed in pylint 3.0, use https://github.com/emacsorphanage/pylint instead.���
stacklevel�pythonr%z(from pylint import epylint;epylint.Run()�win)�posixNFT)�shellr'rFrr))�warnings�warn�DeprecationWarningrr2�shlexr5�platformr4rr'rFrr�communicater)rBrCr'rFr2�epylint_partr �clir>�proc_stdout�proc_stderrs           rrKrK�s���4
�M�h�������$,�s�~�#=�#=����8�J���&P�Q�L��k�/�S�\�5L�5L�U�5S�5S�1S�T�T�T�G�
��
 �C��~�#�3������
�~�#�3������	������J�J��

�
�
��
�#*�#6�#6�#8�#8� ��[��	@��K�(�(�(�;�*?�*?�?������������������������������s�7D�
D�D�D�argv�Sequence[str] | Nonerc��tjdtd���|sTttj��dkr7t
dtjd�d���t	jd��|ptjdd�}tj	�
|d��s.t
|d�d���t	jd��dSt	jt|d|dd�����dS)	NrTrUrVr+zUsage: rz <filename> [options]z does not exist)r\r]r^�lenrrfr6�exitrrr1rA)rfs r�Runrk�s����M�h�������
��C���M�M�Q�&�&�
�:�����:�:�:�;�;�;���������3�8�A�B�B�<�D�
�7�>�>�$�q�'�"�"�*�
��a��)�)�)�*�*�*������������d�1�g�t�A�B�B�x�(�(�)�)�)�)�)r�__main__)rr)r)rrr r!rr")....)
rBrrCrDr'rErFrErrG)..)
rBrrCrMr'rErFrErrN)rPFNN)
rBrrCrQr'rErFrErrRrI)rfrgrr)�__doc__�
__future__rrr_rr\�collections.abcr�ior�
subprocessrr�typingrr	r
�version_infor
�typing_extensionsrrArKrk�__name__rrr�<module>rvs�����>#�"�"�"�"�"�	�	�	�	�����
�
�
�
�����$�$�$�$�$�$�������"�"�"�"�"�"�"�"�-�-�-�-�-�-�-�-�-�-���v����������)�)�)�)�)�)�����9"�9"�9"�9"�9"�x
��!$�"%�"%�	����
���
�#&�"%�	����
�����"&�"&�	9�9�9�9�9�x*�*�*�*�*�$�z����C�E�E�E�E�E��r