403Webshell
Server IP : 65.1.209.187  /  Your IP : 216.73.216.144
Web Server : nginx/1.24.0
System : Linux ip-172-31-5-206 6.14.0-1015-aws #15~24.04.1-Ubuntu SMP Tue Sep 23 22:44:48 UTC 2025 x86_64
User :  ( 1001)
PHP Version : 8.3.6
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : OFF
Directory :  /lib/python3/dist-packages/deprecated/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /lib/python3/dist-packages/deprecated/__pycache__/sphinx.cpython-312.pyc
�

���d(��f�dZddlZddlZddlZddlmZddlmZGd�de�Zd
d�Z	d
d�Z
d
d	�Zy)a-
Sphinx directive integration
============================

We usually need to document the life-cycle of functions and classes:
when they are created, modified or deprecated.

To do that, `Sphinx <http://www.sphinx-doc.org>`_ has a set
of `Paragraph-level markups <http://www.sphinx-doc.org/en/stable/markup/para.html>`_:

- ``versionadded``: to document the version of the project which added the described feature to the library,
- ``versionchanged``: to document changes of a feature,
- ``deprecated``: to document a deprecated feature.

The purpose of this module is to defined decorators which adds this Sphinx directives
to the docstring of your function and classes.

Of course, the ``@deprecated`` decorator will emit a deprecation warning
when the function/method is called or the class is constructed.
�N)�ClassicAdapter)�
deprecatedc�B��eZdZdZdddedf�fd�	Z�fd�Z�fd�Z�xZS)�
SphinxAdaptera
    Sphinx adapter -- *for advanced usage only*

    This adapter override the :class:`~deprecated.classic.ClassicAdapter`
    in order to add the Sphinx directives to the end of the function/class docstring.
    Such a directive is a `Paragraph-level markup <http://www.sphinx-doc.org/en/stable/markup/para.html>`_

    - The directive can be one of "versionadded", "versionchanged" or "deprecated".
    - The version number is added if provided.
    - The reason message is obviously added in the directive block if not empty.
    �N�Fc�j��|std��||_||_tt|�||||��y)a�
        Construct a wrapper adapter.

        :type  directive: str
        :param directive:
            Sphinx directive: can be one of "versionadded", "versionchanged" or "deprecated".

        :type  reason: str
        :param reason:
            Reason message which documents the deprecation in your library (can be omitted).

        :type  version: str
        :param version:
            Version of your project which deprecates this feature.
            If you follow the `Semantic Versioning <https://semver.org/>`_,
            the version number has the format "MAJOR.MINOR.PATCH".

        :type  action: str
        :param action:
            A warning filter used to activate or not the deprecation warning.
            Can be one of "error", "ignore", "always", "default", "module", or "once".
            If ``None`` or empty, the the global filtering mechanism is used.
            See: `The Warnings Filter`_ in the Python documentation.

        :type  category: type
        :param category:
            The warning category to use for the deprecation warning.
            By default, the category class is :class:`~DeprecationWarning`,
            you can inherit this class to define your own deprecation warning category.

        :type  line_length: int
        :param line_length:
            Max line length of the directive text. If non nul, a long text is wrapped in several lines.
        z3'version' argument is required in Sphinx directives)�reason�version�action�categoryN)�
ValueError�	directive�line_length�superr�__init__)�selfrr
rrr
r�	__class__s       ��3/usr/lib/python3/dist-packages/deprecated/sphinx.pyrzSphinxAdapter.__init__,s>���V��R�S�S�"���&���
�m�T�+�6�7�SY�dl�+�m�c	���|jrdnd}|j|j|j��g}|jdkDr|jdz
nd}t	j
|j�j�}|j�D]L}|r7|jt	j||dd��j���<|jd��N|jxsd}|jd	�
�xsdg}t|�dkDr't	j
dj|dd��nd}|d
|z}|r+tj dd|tj"��dz}nd}|djd�|D��z
}||_|jdvr|St$t&|�S|�S)z�
        Add the Sphinx directive to your class or function.

        :param wrapped: Wrapped class or function.

        :return: the decorated class or function.
        z.. {directive}:: {version}z.. {directive}::)rr�iz   )�width�initial_indent�subsequent_indentrT)�keepends�Nrz\n+$��flagsz

�
c3�>K�|]}dj|����y�w)z{}
N)�format)�.0�lines  r�	<genexpr>z)SphinxAdapter.__call__.<locals>.<genexpr>�s����G�T�V�]�]�4�0�G�s�>�versionadded�versionchanged)rr"rr�textwrap�dedentr
�strip�
splitlines�extend�fill�append�__doc__�len�join�re�sub�DOTALLrr�__call__)
r�wrapped�fmt�	div_linesrr
�	paragraph�	docstring�linesrs
         �rr5zSphinxAdapter.__call__^s����/3�l�l�*�@R���Z�Z�$�.�.�$�,�,�Z�O�P�	�(,�(8�(8�1�(<�� � �1�$�'��������-�3�3�5���*�*�,�	%�I��� � ��M�M�!�#�',�*/�	�
!�j�l�
�� � ��$�	%��O�O�)�r�	��$�$�d�$�3�;��t��;>�u�:��>�H�O�O�B�G�G�E�!�"�I�$6�7�r�	��!�H�y�(�	�����w��I�R�Y�Y�G�&�P�I��I�	�R�W�W�G�Y�G�G�G�	�#����>�>�?�?��N��]�D�2�7�;�;rc�~��tt|�||�}tjdd|tj
��}|S)a�
        Get the deprecation warning message (without Sphinx cross-referencing syntax) for the user.

        :param wrapped: Wrapped class or function.

        :param instance: The object to which the wrapped function was bound when it was called.

        :return: The warning message.

        .. versionadded:: 1.2.12
           Strip Sphinx cross-referencing syntax from warning message.

        z*(?: : [a-zA-Z]+ )? : [a-zA-Z]+ : (`[^`]*`)z\1r)rr�get_deprecated_msgr2r3�X)rr6�instance�msgrs    �rr=z SphinxAdapter.get_deprecated_msg�s;����M�4�;�G�X�N���f�f�B�E�3�VX�VZ�VZ�[���
r)	�__name__�
__module__�__qualname__r/�DeprecationWarningrr5r=�
__classcell__)rs@rrrs0���
����#��0n�d-<�^�rrc�$�td|||��}|S)a2
    This decorator can be used to insert a "versionadded" directive
    in your function/class docstring in order to documents the
    version of the project which adds this new functionality in your library.

    :param str reason:
        Reason message which documents the addition in your library (can be omitted).

    :param str version:
        Version of your project which adds this feature.
        If you follow the `Semantic Versioning <https://semver.org/>`_,
        the version number has the format "MAJOR.MINOR.PATCH", and,
        in the case of a new functionality, the "PATCH" component should be "0".

    :type  line_length: int
    :param line_length:
        Max line length of the directive text. If non nul, a long text is wrapped in several lines.

    :return: the decorated function.
    r&�r
rr�r�r
rr�adapters    rr&r&�s!��*�����	�G��Nrc�$�td|||��}|S)a�
    This decorator can be used to insert a "versionchanged" directive
    in your function/class docstring in order to documents the
    version of the project which modifies this functionality in your library.

    :param str reason:
        Reason message which documents the modification in your library (can be omitted).

    :param str version:
        Version of your project which modifies this feature.
        If you follow the `Semantic Versioning <https://semver.org/>`_,
        the version number has the format "MAJOR.MINOR.PATCH".

    :type  line_length: int
    :param line_length:
        Max line length of the directive text. If non nul, a long text is wrapped in several lines.

    :return: the decorated function.
    r'rGrHrIs    rr'r'�s!��(�����	�G��Nrc��|jdd�}|jdt�}||d<||d<||d<td||d�|��S)	ax
    This decorator can be used to insert a "deprecated" directive
    in your function/class docstring in order to documents the
    version of the project which deprecates this functionality in your library.

    :param str reason:
        Reason message which documents the deprecation in your library (can be omitted).

    :param str version:
        Version of your project which deprecates this feature.
        If you follow the `Semantic Versioning <https://semver.org/>`_,
        the version number has the format "MAJOR.MINOR.PATCH".

    :type  line_length: int
    :param line_length:
        Max line length of the directive text. If non nul, a long text is wrapped in several lines.

    Keyword arguments can be:

    -   "action":
        A warning filter used to activate or not the deprecation warning.
        Can be one of "error", "ignore", "always", "default", "module", or "once".
        If ``None``, empty or missing, the the global filtering mechanism is used.

    -   "category":
        The warning category to use for the deprecation warning.
        By default, the category class is :class:`~DeprecationWarning`,
        you can inherit this class to define your own deprecation warning category.

    :return: a decorator used to deprecate a function.

    .. versionchanged:: 1.2.13
       Change the signature of the decorator to reflect the valid use cases.
    rr�adapter_clsr
rr)rrM�)�popr�_classic_deprecated)r
rr�kwargsrrMs      rrr�sX��F�
�
�;��5�I��*�*�]�M�:�K��F�8���F�9��'�F�=���V���V�v�V�Vr)rrr)r/r2r(�wrapt�deprecated.classicrrrPrr&r'rNrr�<module>rTs:���(
���-�@�A�N�A�H�<�:(Wr

Youez - 2016 - github.com/yon3zu
LinuXploit