
    Y	gz                     p   d Z ddlZddlZddlmZmZmZmZ ddl	m
Z
 ddlmZmZmZmZ ej                   eej"                  eej$                  eej&                  eiZej*                  fdededefd	Zej*                  fd
ej0                  dedefdZej*                  ej4                  dfdededededef
dZy)zThe main parsing routine.    N)epydocgooglenumpydocrest)add_attribute_docstrings)	DocstringDocstringStyle
ParseErrorRenderingStyletextstylereturnc                 4   |t         j                  k7  rt        |   j                  |       S d}g }t        j	                         D ]%  }	 |j                  |       }|j                  |       ' |s|t        |d d      d   S # t        $ r}|}Y d}~Nd}~ww xY w)zParse the docstring into its components.

    :param text: docstring text to parse
    :param style: docstring style
    :returns: parsed docstring representation
    Nc                 ,    t        | j                        S )N)lenmeta)ds    X/var/www/html/hubwallet-dev/venv/lib/python3.12/site-packages/docstring_parser/parser.py<lambda>zparse.<locals>.<lambda>.   s    c!&&k     T)keyreverser   )r	   AUTO
_STYLE_MAPparsevaluesappendr
   sorted)r   r   excretsmoduleretexs          r   r   r      s     ###% &&t,,!%CD##% 	,,t$C KK 	$14@CC  	C	s   B	BBBobjc                     t        | j                  |      }t        j                  |       st        j                  |       rt        | |       |S )aQ  Parse the object's docstring(s) into its components.

    The object can be anything that has a ``__doc__`` attribute. In contrast to
    the ``parse`` function, ``parse_from_object`` is able to parse attribute
    docstrings which are defined in the source code instead of ``__doc__``.

    Currently only attribute docstrings defined at class and module levels are
    supported. Attribute docstrings defined in ``__init__`` methods are not
    supported.

    When given a class, only the attribute docstrings of that class are parsed,
    not its inherited classes. This is a design decision. Separate calls to
    this function should be performed to get attribute docstrings of parent
    classes.

    :param obj: object from which to parse the docstring(s)
    :param style: docstring style
    :returns: parsed docstring representation
    )r   )r   __doc__inspectisclassismoduler   )r$   r   	docstrings      r   parse_from_objectr+   1   s=    . ckk/Isw//4 i0r   z    r*   rendering_styleindentc                 z    t         |t        j                  k(  r| j                  n|   }|j	                  | ||      S )a  Render a parsed docstring into docstring text.

    :param docstring: parsed docstring representation
    :param style: docstring style to render
    :param indent: the characters used as indentation in the docstring string
    :returns: docstring text
    )r,   r-   )r   r	   r   r   compose)r*   r   r,   r-   r!   s        r   r/   r/   P   sC      N$7$77	UF >>?6   r   )r&   r'   typingTdocstring_parserr   r   r   r   docstring_parser.attrdocr   docstring_parser.commonr   r	   r
   r   RESTGOOGLENUMPYDOCEPYDOCr   r   strr   Anyr+   COMPACTr/    r   r   <module>r=      s       ; ; =  6X6	
 .<-@-@ D DN DY D8 +//	
 B +//&4&<&<	 $ 	
 	r   