Hacked By AnonymousFox

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

�

�܋f7:����UdZddlmZddlZddlZddlZddlZddlZddlm	Z	ddl
m
Z
ddlmZm
Z
mZmZmZddlmZddlmZdd	lmZmZdd
lmZmZddlmZejdkrdd
lmZndd
lmZee e!e"e#e
e ee ee
e ee!dffZ$	d8d�Z%d8d�Z&hd�Z'hd�Z(d9d�Z)d:d�Z*d:d�Z+d8d�Z,d;d�Z-d<d�Z.d=d!�Z/d=d"�Z0e e&e"e!e%e*e+e,e-e.e/e0ej1e)d#�Z2d$e3d%<	Gd&�d'��Z4Gd(�d)e4��Z5Gd*�d+e5��Z6Gd,�d-e5��Z7Gd.�d/e4��Z8Gd0�d1e8��Z9Gd2�d3e8��Z:Gd4�d5e8��Z;Gd6�d7e4��Z<dS)>z�Definition of an Argument class and transformers for various argument types.

An Argument instance represents a pylint option to be handled by an argparse.ArgumentParser
�)�annotationsN)�Callable)�glob)�Any�Pattern�Sequence�Tuple�Union)�
interfaces)�utils)�_CallbackAction�
_ExtendAction)�_NewNamesAction�_OldNamesAction)�	PY38_PLUS)��)�Literal.�value�str�return�
Sequence[str]c��|stjStj|��}|D]6}|tjvr&t	j|�dgtj�R������7|S)z9Transforms a comma separated string of confidence values.z should be in )r�CONFIDENCE_LEVEL_NAMES�pylint_utils�
_check_csv�argparse�ArgumentTypeError)r�values�
confidences   �g/builddir/build/BUILD/cloudlinux-venv-1.0.6/venv/lib/python3.11/site-packages/pylint/config/argument.py�_confidence_transformerr".s~���1��0�0�
�
$�U�
+�
+�F����
��Z�>�>�>��,��M�M�'L��)J�'L�'L�M�M���
�?��M�c�*�tj|��S)z$Transforms a comma separated string.)rr�rs r!�_csv_transformerr&;s���"�5�)�)�)r#>�y�yes�true>�n�no�false�boolc��|���}|tvrdS|tvrdStjdd|�dgt�t�R�����)z4Transforms a yes/no or stringified bool into a bool.TFNzInvalid yn value 'z', should be in )�lower�
YES_VALUES�	NO_VALUESrrr%s r!�_yn_transformerr2Dsh���K�K�M�M�E��
����t��	����u�
�
$��S�5�S�S�9R�:�9R�	�9R�9R�S�S���r#c�V�|stjd���tj|��S)z3Check that a string is not empty and remove quotes.z!Option cannot be an empty string.)rrr�_unquoter%s r!�_non_empty_string_transformerr5Ps.���N��(�)L�M�M�M�� ��'�'�'r#c�z�tj�tj�|����S)z$Expand user and variables in a path.)�os�path�
expandvars�
expanduserr%s r!�_path_transformerr;Ws(��
�7���b�g�0�0��7�7�8�8�8r#c��g}t|��D]3}|�tt|��d������4|S)ziTransforms a comma separated list of paths while expanding user and
    variables and glob patterns.
    T)�	recursive)r&�extendrr;)r�pathsr8s   r!�_glob_paths_csv_transformerr@\sR���E� ��'�'�D�D��
���T�+�D�1�1�T�B�B�B�C�C�C�C��Lr#�tuple[int, ...]c���	td�|�dd���d��D����}n&#t$rt	j|�d���d�wxYw|S)z1Transforms a version string into a version tuple.c3�4K�|]}t|��V��dS)N)�int)�.0�vals  r!�	<genexpr>z*_py_version_transformer.<locals>.<genexpr>is(����O�O�S��C���O�O�O�O�O�Or#�,�.z? has an invalid format, should be a version string. E.g., '3.8'N)�tuple�replace�split�
ValueErrorrr)r�versions  r!�_py_version_transformerrOfs�����O�O�E�M�M�#�s�,C�,C�,I�,I�#�,N�,N�O�O�O�O�O���������(��U�U�U�
�
��	������Ns�AA�#A&�Pattern[str]c��	tj|��S#tj$r/}d|�d|j�d|j��}tj|��|�d}~wwxYw)zReturn `re.compile(value)`.z&Error in provided regular expression: z beginning at index z: N)�re�compile�error�pos�msgrr)r�erVs   r!�_regex_transformerrXqsp��5��z�%� � � ��
�8�5�5�5�b�u�b�b�RS�RW�b�b�[\�[`�b�b���(��-�-�1�4�����5���s��A�*A�A�Sequence[Pattern[str]]c�r�g}t|��D]$}|�t|�����%|S)z9Transforms a comma separated list of regular expressions.)r&�appendrX�r�patterns�patterns   r!�_regexp_csv_transfomerr_zsA��#%�H�#�E�*�*�5�5�����*�7�3�3�4�4�4�4��Or#c
�6�g}t|��D]�}|�tjt	tj|�����dd��dztj|�����z������|S)z?Transforms a comma separated list of regular expressions paths.�\z\\�|)	r&r[rRrSr�pathlib�PureWindowsPathrK�as_posixr\s   r!�_regexp_paths_csv_transfomerrf�s���#%�H�#�E�*�*�
�
������J��G�+�G�4�4�5�5�=�=�d�F�K�K����)�'�2�2�;�;�=�=�>�
�
�	
�	
�	
�	
��Or#)�choice�csv�floatrDr �non_empty_stringr8�glob_paths_csv�
py_version�regexp�
regexp_csv�regexp_paths_csv�string�ynz*dict[str, Callable[[str], _ArgumentTypes]]�_TYPE_TRANSFORMERSc��eZdZdZdd�Zd
S)�	_ArgumentaClass representing an argument to be parsed by an argparse.ArgumentsParser.

    This is based on the parameters passed to argparse.ArgumentsParser.add_message.
    See:
    https://docs.python.org/3/library/argparse.html#argparse.ArgumentParser.add_argument
    �flags�	list[str]�arg_helpr�	hide_helpr-�section�
str | Noner�Nonec��||_	||_	|�dd��|_	|rtj|_||_dS)N�%z%%)rurxrK�helpr�SUPPRESSry)�selfrurwrxrys     r!�__init__z_Argument.__init__�sS����
�'�"���@��$�$�S�$�/�/��	�.��	*� �)�D�I����2�2r#N)
rurvrwrrxr-ryrzrr{)�__name__�
__module__�__qualname__�__doc__r��r#r!rtrt�s2��������3�3�3�3�3�3r#rtc�$��eZdZdZd�fd�Z�xZS)�_BaseStoreArgumentaBase class for store arguments to be parsed by an argparse.ArgumentsParser.

    This is based on the parameters passed to argparse.ArgumentsParser.add_message.
    See:
    https://docs.python.org/3/library/argparse.html#argparse.ArgumentParser.add_argument
    rurv�actionr�default�_ArgumentTypesrwrxr-ryrzrr{c�p��t���||||���||_	||_dS�N)rurwrxry)�superr�r�r��r�rur�r�rwrxry�	__class__s       �r!r�z_BaseStoreArgument.__init__�sH���	������(�i��	�	
�	
�	
����6����0�0r#)rurvr�rr�r�rwrrxr-ryrzrr{�r�r�r�r�r��
__classcell__�r�s@r!r�r��sG���������1�1�1�1�1�1�1�1�1�1r#r�c�$��eZdZdZd�fd�Z�xZS)�_StoreArgumentaClass representing a store argument to be parsed by an argparse.ArgumentsParser.

    This is based on the parameters passed to argparse.ArgumentsParser.add_message.
    See:
    https://docs.python.org/3/library/argparse.html#argparse.ArgumentParser.add_argument
    rurvr�rr�r��arg_type�choices�list[str] | Nonerw�metavarrxr-ryrzrr{c	���t���||||||	���t||_	||_	||_dS�N)rur�r�rwrxry)r�r�rr�typer�r��r�rur�r�r�r�rwr�rxryr�s          �r!r�z_StoreArgument.__init__�sh���	�����������
	�	
�	
�	
�'�x�0��	�U����	�
���	�	r#)rurvr�rr�r�r�rr�r�rwrr�rrxr-ryrzrr{r�r�s@r!r�r��sG���������$�$�$�$�$�$�$�$�$�$r#r�c�$��eZdZdZd�fd�Z�xZS)�_StoreTrueArgumentaClass representing a 'store_true' argument to be parsed by an
    argparse.ArgumentsParser.

    This is based on the parameters passed to argparse.ArgumentsParser.add_message.
    See:
    https://docs.python.org/3/library/argparse.html#argparse.ArgumentParser.add_argument
    rurvr��Literal['store_true']r�r�rwrrxr-ryrzrr{c�V��t���||||||���dSr�)r�r�r�s       �r!r�z_StoreTrueArgument.__init__ sB���	�����������
	�	
�	
�	
�	
�	
r#)rurvr�r�r�r�rwrrxr-ryrzrr{r�r�s@r!r�r�sG���������
�
�
�
�
�
�
�
�
�
r#r�c�$��eZdZdZd�fd�Z�xZS)�_DeprecationArgumentaStore arguments while also handling deprecation warnings for old and new names.

    This is based on the parameters passed to argparse.ArgumentsParser.add_message.
    See:
    https://docs.python.org/3/library/argparse.html#argparse.ArgumentParser.add_argument
    rurvr��type[argparse.Action]r�r�r�rr�r�rwr�rxr-ryrzrr{c	���t���||||	���||_	||_	t||_	||_	||_dSr�)r�r�r�r�rrr�r�r�r�s          �r!r�z_DeprecationArgument.__init__<ss���	������(�i��	�	
�	
�	
����6����0�&�x�0��	�U����	�
���	�	r#)rurvr�r�r�r�r�rr�r�rwrr�rrxr-ryrzrr{r�r�s@r!r�r�4sG���������%�%�%�%�%�%�%�%�%�%r#r�c�$��eZdZdZd�fd�Z�xZS)�_ExtendArgumentaClass for extend arguments to be parsed by an argparse.ArgumentsParser.

    This is based on the parameters passed to argparse.ArgumentsParser.add_message.
    See:
    https://docs.python.org/3/library/argparse.html#argparse.ArgumentParser.add_argument
    rurvr��Literal['extend']r�r�r�rr�rwrxr-ryrzr�r��destrr{c
���tr
tj}nt}|
|_	t	���|||||	||||��	�	dS�N)	rur�r�r�r�rwr�rxry)rrrr�r�r�)
r�rur�r�r�r�rwrxryr�r��action_classr�s
            �r!r�z_ExtendArgument.__init__lsl����	)�#�1�L�L�(�L���	�.�
��������������	�
	
�
	
�
	
�
	
�
	
r#)rurvr�r�r�r�r�rr�rrwrrxr-ryrzr�r�r�rzrr{r�r�s@r!r�r�dsG���������!
�!
�!
�!
�!
�!
�!
�!
�!
�!
r#r�c�$��eZdZdZd�fd�Z�xZS)�_StoreOldNamesArgumentz�Store arguments while also handling old names.

    This is based on the parameters passed to argparse.ArgumentsParser.add_message.
    See:
    https://docs.python.org/3/library/argparse.html#argparse.ArgumentParser.add_argument
    rurvr�r�r�rr�r�rwr�rxr-�kwargs�dict[str, Any]ryrzrr{c	�t��t���|t|||||||	��	�	||_dSr�)r�r�rr��r�rur�r�r�rwr�rxr�ryr�s          �r!r�z_StoreOldNamesArgument.__init__��P���	������"��������	�
	
�
	
�
	
����<�<r#�rurvr�r�r�rr�r�rwrr�rrxr-r�r�ryrzrr{r�r�s@r!r�r���G���������=�=�=�=�=�=�=�=�=�=r#r�c�$��eZdZdZd�fd�Z�xZS)�_StoreNewNamesArgumentz�Store arguments while also emitting deprecation warnings.

    This is based on the parameters passed to argparse.ArgumentsParser.add_message.
    See:
    https://docs.python.org/3/library/argparse.html#argparse.ArgumentParser.add_argument
    rurvr�r�r�rr�r�rwr�rxr-r�r�ryrzrr{c	�t��t���|t|||||||	��	�	||_dSr�)r�r�rr�r�s          �r!r�z_StoreNewNamesArgument.__init__�r�r#r�r�r�s@r!r�r��r�r#r�c�$��eZdZdZd�fd�Z�xZS)�_CallableArgumentaClass representing an callable argument to be parsed by an
    argparse.ArgumentsParser.

    This is based on the parameters passed to argparse.ArgumentsParser.add_message.
    See:
    https://docs.python.org/3/library/argparse.html#argparse.ArgumentParser.add_argument
    rurvr��type[_CallbackAction]rwrr�r�rxr-ryrzr�rr{c���t���||||���||_	||_	||_dSr�)r�r�r�r�r�)	r�rur�rwr�rxryr�r�s	        �r!r�z_CallableArgument.__init__�sV���	������(�i��	�	
�	
�	
����6����<����	�	r#)rurvr�r�rwrr�r�rxr-ryrzr�rrr{r�r�s@r!r�r��sG������������������r#r�)rrrr)rrrr-)rrrr)rrrrA)rrrrP)rrrrY)=r��
__future__rrr7rcrR�sys�collections.abcrr�typingrrrr	r
�pylintrrr�pylint.config.callback_actionsr
r�!pylint.config.deprecation_actionsrr�pylint.constantsr�version_infor�typing_extensionsrrDrir-r�r"r&r0r1r2r5r;r@rOrXr_rfr4rr�__annotations__rtr�r�r�r�r�r�r�r�r�r#r!�<module>r�sI��
���
#�"�"�"�"�"�����	�	�	�	�����	�	�	�	�
�
�
�
�$�$�$�$�$�$�������7�7�7�7�7�7�7�7�7�7�7�7�7�7�������(�(�(�(�(�(�I�I�I�I�I�I�I�I�N�N�N�N�N�N�N�N�&�&�&�&�&�&���v����������)�)�)�)�)�)����	���C�L��S�M��W�S�\��	�#�s�(�O��	��'�
�
�
�
�*�*�*�*�
"�
!�
!�
� � � �	�	�	�	�	�(�(�(�(�9�9�9�9�
��������5�5�5�5�����������
��)�5��1�)� �(�4��#�
�B�B������ �3�3�3�3�3�3�3�3�B1�1�1�1�1��1�1�1�:,�,�,�,�,�'�,�,�,�^
�
�
�
�
�+�
�
�
�<-�-�-�-�-�9�-�-�-�`)
�)
�)
�)
�)
�*�)
�)
�)
�X"=�"=�"=�"=�"=�1�"=�"=�"=�J"=�"=�"=�"=�"=�1�"=�"=�"=�J#�#�#�#�#�	�#�#�#�#�#r#

Hacked By AnonymousFox1.0, Coded By AnonymousFox