Repository URL to install this package:
Version:
0.1.6-1 ▾
|
odigos
/
etc
/
odigos-vmagent
/
instrumentations
/
python
/
deprecated
/
__pycache__
/
sphinx.cpython-311.pyc
|
---|
§ åbge+ ã óf d Z ddlZddlZddlmZ ddlmZ G d de¦ « Zdd Zdd Z ddZdS ) 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 óD e Zd ZdZdddeddf fd Z fdZ fdZ 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. Ú Nr éF c ó |st d¦ « || _ || _ t t | ¦ « |||||¬¦ « dS )aV 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: Literal["default", "error", "ignore", "always", "module", "once"] :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 global filtering mechanism is used. See: `The Warnings Filter`_ in the Python documentation. :type category: Type[Warning] :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 extra_stacklevel: int :param extra_stacklevel: Number of additional stack levels to consider instrumentation rather than user code. With the default value of 0, the warning refers to where the class was instantiated or the function was called. :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. .. versionchanged:: 1.2.15 Add the *extra_stacklevel* parameter. z3'version' argument is required in Sphinx directives)ÚreasonÚversionÚactionÚcategoryÚextra_stacklevelN)Ú ValueErrorÚ directiveÚline_lengthÚsuperr Ú__init__) Úselfr r r r r r r Ú __class__s ú8/tmp/pip-target-vp8_xwat/lib/python/deprecated/sphinx.pyr zSphinxAdapter.__init__* sj ø ðj ð TåÐRÑSÔSÐSØ"Ø&ÔÝ mTÑ"Ô"×+Ò+Ø 7°6ÀHÐ_oð ,ñ ô ð ð ð ó c ó¦ | j rdnd}| | j | j ¬¦ « g}| j dk r | j dz nd}t j | j ¦ « ¦ « }| ¦ « D ]W}|r>| t j ||dd¬¦ « ¦ « ¦ « B| d¦ « X|j pd}| d ¦ « pdg}t |¦ « d k r/t j d |d d ¦ « ¦ « nd}|d |z }|r&t j d d|t j ¬¦ « dz }nd}|d d |D ¦ « ¦ « z }||_ | j dv r|S t% t&