| Server IP : 127.0.0.1 / Your IP : 216.73.216.109 Web Server : Apache/2.4.54 (Win64) OpenSSL/1.1.1q PHP/8.1.10 System : Windows NT DESKTOP-E5T4RUN 10.0 build 19045 (Windows 10) AMD64 User : SERVERWEB ( 0) PHP Version : 8.1.10 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : C:/cygwin64/lib/python3.9/site-packages/sphinx/ext/napoleon/__pycache__/ |
Upload File : |
a
�ab�� � @ s� d Z ddlZddlZddlZddlmZ ddlmZmZm Z m
Z
mZmZm
Z
ddlmZ ddlmZ ddlmZ ddlmZmZ dd lmZ dd
lmZ ddlmZ e�e�Z e�!d�Z"e�!d
�Z#e�!d�Z$e�!d�Z%e�!d�Z&e�!d�Z'e�!d�Z(e�!d�Z)e�!d�Z*e�!d�Z+e�!d�Z,dZ-i fe.e e.e.f e.d�dd�Z/G dd� d�Z0e
e. e
e. d�dd�Z1e.e
e. d �d!d"�Z2d+e.e.e.d#�d$d%�Z3di fe.e.e4e.d&�d'd(�Z5G d)d*� d*e0�Z6dS ),z�
sphinx.ext.napoleon.docstring
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Classes for docstring parsing and formatting.
:copyright: Copyright 2007-2022 by the Sphinx team, see AUTHORS.
:license: BSD, see LICENSE for details.
� N)�partial)�Any�Callable�Dict�List�Tuple�Type�Union)�Sphinx��Config)�modify_iter)�_�__)�logging)�stringify_annotation)�get_type_hintsz
\.\. \S+::z^(\s|\w)+:\s*$z(.+?)\(\s*(.*[^\s]+)\s*\)z^[=\-`:\'"~^_*+#<>]{2,}\s*$z(?<!:):(?!:)z>((?::(?:[a-zA-Z0-9]+[\-_+:.])*[a-zA-Z0-9]+:`.+?`)|(?:``.+?``))z5(?:(?::(?:[a-zA-Z0-9]+[\-_+:.])*[a-zA-Z0-9]+:)?`.+?`)z^(\*|\+|\-)(\s+\S|\s*$)zP^(?P<paren>\()?(\d+|#|[ivxlcdm]+|[IVXLCDM]+|[a-zA-Z])(?(paren)\)|\.)(\s+\S|\s*$)z_(,\sor\s|\sor\s|\sof\s|:\s|\sto\s|,\sand\s|\sand\s|,\s|[{]|[}]|"(?:\\"|[^"])*"|'(?:\\'|[^'])*')z^default[^_0-9A-Za-z].*$)�None�True�False�Ellipsis)�_type�translations�returnc C s( | |v r|| S | dkrdS d| S | S )z0Convert type specification to reference in reST.r z:obj:`None`�:class:`%s`� )r r r r �A/usr/lib/python3.9/site-packages/sphinx/ext/napoleon/docstring.py�_convert_type_spec9 s r c
@ s e Zd ZdZe�dej�Zd�ee e
e f eee e e
e
dd�dd�Ze d�d d
�Ze
e d�dd�Zd�ee
e d�dd�Ze
e d�dd�Ze
e d�dd�Zd�eeee e e
e f d�dd�Zd�eeee
ee e e
e f d�dd�Zee e
e f d�dd�Zd�ee
ee e e
e f d�d d!�Ze
e d�d"d#�Ze d�d$d%�Ze
e d�d&d'�Ze
e d�d(d)�Zd�e
e ee
e d*�d+d,�Ze e d-�d.d/�Z e
e e
e d0�d1d2�Z!e e
e e
e d3�d4d5�Z"d�e e
e e e
e d6�d7d8�Z#d�e
ee e e
e f e e e
e d;�d<d=�Z$e e e
e e
e d>�d?d@�Z%e e
ee e e
e f e
e dA�dBdC�Z&d�eedE�dFdG�Z'e edH�dIdJ�Z(e
e edK�dLdM�Z)e
e edK�dNdO�Z*d�e
e ee
e dQ�dRdS�Z+d�e eedT�dUdV�Z,e
e edK�dWdX�Z-ed�dYdZ�Z.ed�d[d\�Z/dd�d]d^�Z0dd�d_d`�Z1e e e
e da�dbdc�Z2e
e d�ddde�Z3e e
e df�dgdh�Z4e e
e df�didj�Z5e e
e df�dkdl�Z6e e
e df�dmdn�Z7e e
e df�dodp�Z8e e
e df�dqdr�Z9e ee
e ds�dtdu�Z:e e
e df�dvdw�Z;e e
e df�dxdy�Z<e e
e df�dzd{�Z=e e
e df�d|d}�Z>e e
e df�d~d�Z?e e
e df�d�d��Z@e e
e df�d�d��ZAe e
e df�d�d��ZBe e
e df�d�d��ZCe e
e df�d�d��ZDe e
e df�d�d��ZEe e
e df�d�d��ZFe ee e e f dH�d�d��ZGe eHe d��d�d��ZIe
e e
e dK�d�d��ZJe e d��d�d��ZKdS )��GoogleDocstringaV Convert Google style docstrings to reStructuredText.
Parameters
----------
docstring : :obj:`str` or :obj:`list` of :obj:`str`
The docstring to parse, given either as a string or split into
individual lines.
config: :obj:`sphinx.ext.napoleon.Config` or :obj:`sphinx.config.Config`
The configuration settings to use. If not given, defaults to the
config object on `app`; or if `app` is not given defaults to the
a new :class:`sphinx.ext.napoleon.Config` object.
Other Parameters
----------------
app : :class:`sphinx.application.Sphinx`, optional
Application object representing the Sphinx process.
what : :obj:`str`, optional
A string specifying the type of the object to which the docstring
belongs. Valid values: "module", "class", "exception", "function",
"method", "attribute".
name : :obj:`str`, optional
The fully qualified name of the object.
obj : module, class, exception, function, method, or attribute
The object to which the docstring belongs.
options : :class:`sphinx.ext.autodoc.Options`, optional
The options given to the directive: an object with attributes
inherited_members, undoc_members, show_inheritance and noindex that
are True if the flag option of same name was given to the auto
directive.
Example
-------
>>> from sphinx.ext.napoleon import Config
>>> config = Config(napoleon_use_param=True, napoleon_use_rtype=True)
>>> docstring = '''One line summary.
...
... Extended description.
...
... Args:
... arg1(int): Description of `arg1`
... arg2(str): Description of `arg2`
... Returns:
... str: Description of return value.
... '''
>>> print(GoogleDocstring(docstring, config))
One line summary.
<BLANKLINE>
Extended description.
<BLANKLINE>
:param arg1: Description of `arg1`
:type arg1: int
:param arg2: Description of `arg2`
:type arg2: str
<BLANKLINE>
:returns: Description of return value.
:rtype: str
<BLANKLINE>
zX^\s*((?::(?P<role>\S+):)?`(?P<name>~?[a-zA-Z0-9_.-]+)`| (?P<name2>~?[a-zA-Z0-9_.-]+))\s*N� �� docstring�config�app�what�name�obj�optionsr c
# C s� || _ || _| j s4ddlm} | jr,| jjn|� | _ |sjt�|�rHd}n"t�|�rXd}nt|�rfd}nd}|| _ || _
|| _|| _t
|t�r�|�� } n|} t| dd� d �| _g | _d
| _d| _t| d�s�g | _t| d��s�| j| jt| jd
�| jt| jd�t| jd�t| jd�| j| jt| jd�t| jd�| j| j| jt| jd�| j| j| j| j | j | j!| j!| j"| j"| j#| j$t| jd�t| jd�t| jd�t| jd�| j%| j%| j&| j&d�"| _'| �(� | �)� d S )Nr r �class�module�function�objectc S s | � � S �N)�rstrip)�sr r r �<lambda>� � z*GoogleDocstring.__init__.<locals>.<lambda>)�modifierF�_directive_sections� _sections� attention�caution�danger�error�hint� important�note�tip�todo�warning)"�argsZ argumentsr4 Z
attributesr5 r6 r7 �example�examplesr8 r9 zkeyword argszkeyword arguments�methodsr: Znoteszother parameters�
parametersZreceiveZreceivesr �returns�raiseZraisesZ
referenceszsee alsor; r<