§
    ãŽ’jœ  ã            	       ó€  — d Z ddlZddlZddlZddlZddlmZ ddlm	Z	m
Z
 dej        dej        fd„Zdej        dej        e         fd	„Zdej        defd
„Zdej        dej        ej        eej        e         ej        e         f                  fd„Z G d„ dej        ¦  «        Zdej        eef         de	ddfd„ZdS )zbAttribute docstrings parsing.

.. seealso:: https://peps.python.org/pep-0257/#what-is-a-docstring
é    N)Ú
ModuleTypeé   )Ú	DocstringÚDocstringParamÚnodeÚreturnc                 ó"   — t          | d¦  «        S )z<Return the constant's value if the given node is a constant.Úvalue)Úgetattr©r   s    úFC:\Projects\DSCons\.venv\Lib\site-packages\docstring_parser\attrdoc.pyÚast_get_constant_valuer      s   € å�4˜Ñ!Ô!Ð!ó    c                 ó  — t          t          d¦  «        rt          j        | ¦  «        S t          | t          j        ¦  «        rt          t          | ¦  «        ¦  «        S t          | t          j        ¦  «        r| j        S dS )z0Convert the AST node to source code as a string.ÚunparseN)	ÚhasattrÚastr   Ú
isinstanceÚConstantÚstrr   ÚNameÚidr   s    r   Úast_unparser      so   € å�s�IÑÔð !ÝŒ{˜4Ñ Ô Ð å�$�œÑ%Ô%ð 1ÝÕ)¨$Ñ/Ô/Ñ0Ô0Ð0Ý�$�œÑ!Ô!ð ØŒwˆØˆ4r   c                 óÂ   — t          | t          j        ¦  «        oEt          | j        t          j        ¦  «        o&t          t          | j        ¦  «        t          ¦  «        S )z2Return True if the given node is a literal string.)r   r   ÚExprr
   r   r   r   r   s    r   Úast_is_literal_strr       sM   € õ 	�4�œÑ"Ô"ð 	@Ý�t”z¥3¤<Ñ0Ô0ð	@åÕ-¨d¬jÑ9Ô9½3Ñ?Ô?ðr   c                 ó�  — t          | t          j        t          j        f¦  «        rŸt          | t          j        ¦  «        r| j        d         n| j        }t          |t          j        ¦  «        rWd}t          | t          j        ¦  «        rt          | j        ¦  «        }d}| j	        rt          | j	        ¦  «        }|j
        ||fS dS )z@Return name, type and default if the given node is an attribute.r   N)r   r   ÚAssignÚ	AnnAssignÚtargetsÚtargetr   r   Ú
annotationr
   r   )r   r!   Útype_strÚdefaults       r   Úast_get_attributer%   )   s´   € õ �$�œ¥S¤]Ð3Ñ4Ô4ð 0å)¨$µ´
Ñ;Ô;ÐLˆDŒL˜ŒOˆOÀÄð 	õ �f�cœhÑ'Ô'ð 	0ØˆHÝ˜$¥¤Ñ.Ô.ð 8Ý& t¤Ñ7Ô7�ØˆGØŒzð 2Ý% d¤jÑ1Ô1�Ø”9˜h¨Ð/Ð/Øˆ4r   c            
       óœ   — e Zd ZdZdZdZd„ Zdej        dej	        e
ej        e
ej        e
         ej        e
         f         f         fd„ZdS )ÚAttributeDocstringsz6An ast.NodeVisitor that collects attribute docstrings.Nc                 ó(  — | j         r9t          |¦  «        r*| j         \  }}}t          |j        ¦  «        ||f| j        |<   t          |¦  «        | _         t          |t          j        t          j	        f¦  «        r|  
                    |¦  «         d S d S ©N)Ú	prev_attrr   r   r
   Ú	attr_docsr%   r   r   ÚClassDefÚModuleÚgeneric_visit)Úselfr   Ú	attr_nameÚ	attr_typeÚattr_defaults        r   ÚvisitzAttributeDocstrings.visitB   s›   € ØŒ>ð 	Õ0°Ñ6Ô6ð 	Ø15´Ñ.ˆI�y ,å& t¤zÑ2Ô2ØØð)ˆDŒN˜9Ñ%õ
 +¨4Ñ0Ô0ˆŒÝ�d�Sœ\­3¬:Ð6Ñ7Ô7ð 	%Ø×Ò˜tÑ$Ô$Ð$Ð$Ð$ð	%ð 	%r   Ú	componentr   c                 óÖ  — i | _         d| _        	 t          j        t	          j        |¦  «        ¦  «        }t          j        |¦  «        }t	          j        |¦  «        r|  	                    |¦  «         npt          |t          j        ¦  «        rEt          |j        d         t          j        ¦  «        r |  	                    |j        d         ¦  «         n# t          $ r Y nw xY w| j         S )zãGet attribute docstrings from the given component.

        :param component: component to process (class or module)
        :returns: for each attribute docstring, a tuple with (description,
            type, default)
        Nr   )r+   r*   ÚtextwrapÚdedentÚinspectÚ	getsourcer   ÚparseÚismoduler3   r   r-   Úbodyr,   ÚOSError)r/   r4   ÚsourceÚtrees       r   Úget_attr_docsz!AttributeDocstrings.get_attr_docsN   sã   € ð ˆŒØˆŒð	)Ý”_¥WÔ%6°yÑ%AÔ%AÑBÔBˆFõ ”9˜VÑ$Ô$ˆDÝÔ 	Ñ*Ô*ð )Ø—
’
˜4Ñ Ô Ð Ð Ý˜D¥#¤*Ñ-Ô-ð )µ*Ø”	˜!”�cœlñ3ô 3ð )ð —
’
˜4œ9 Qœ<Ñ(Ô(Ð(øøõ ð 	ð 	ð 	ØˆDð	øøøð Œ~Ðs   �&C Ã
C!Ã C!)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r+   r*   r3   ÚTÚAnyÚDictr   ÚTupleÚOptionalr@   © r   r   r'   r'   <   s   € € € € € Ø@Ð@à€IØ€Ið
%ð 
%ð 
%ðØœðà	
Œ��Q”W˜S !¤*¨S¤/°1´:¸c´?ÐBÔCÐCÔ	Dðð ð ð ð ð r   r'   ÚobjÚ	docstringc           	      ó*  — t          d„ |j        D ¦   «         ¦  «        }t          ¦   «                              | ¦  «                             ¦   «         D ]@\  }\  }}}||vr3t          d|g||||du|¬¦  «        }|j                             |¦  «         ŒAdS )zûAdd attribute docstrings found in the object's source code.

    :param obj: object from which to parse attribute docstrings
    :param docstring: Docstring object where found attributes are added
    :returns: list with names of added attributes
    c              3   ó$   K  — | ]}|j         V — Œd S r)   )Úarg_name)Ú.0Úps     r   ú	<genexpr>z+add_attribute_docstrings.<locals>.<genexpr>q   s$   è è € Ð6Ð6 �”Ð6Ð6Ð6Ð6Ð6Ð6r   Ú	attributeN)ÚargsÚdescriptionrO   Ú	type_nameÚis_optionalr$   )ÚsetÚparamsr'   r@   Úitemsr   ÚmetaÚappend)rK   rL   rY   rO   rU   rV   r$   Úparams           r   Úadd_attribute_docstringsr^   h   s¾   € õ Ð6Ð6 YÔ%5Ð6Ñ6Ô6Ñ6Ô6€FåÑÔ×+Ò+¨CÑ0Ô0×6Ò6Ñ8Ô8ð)ð )Ñ3ˆÑ3�; 	¨7ð ˜6Ð!Ð!Ý"Ø! 8Ð,Ø'Ø!Ø#Ø#¨4Ð/Øðñ ô ˆEð ŒN×!Ò! %Ñ(Ô(Ð(øð)ð )r   )rD   r   r8   r6   ÚtypingrE   Útypesr   Úcommonr   r   ÚASTrF   r   rI   r   r   Úboolr   rH   r%   ÚNodeVisitorr'   ÚUnionÚtyper^   rJ   r   r   ú<module>rg      sŒ  ððð ð
 €
€
€
Ø €€€Ø €€€Ø Ð Ð Ð Ø Ð Ð Ð Ð Ð à -Ð -Ð -Ð -Ð -Ð -Ð -Ð -ð" ¤ð "¨Q¬Uð "ð "ð "ð "ð
	�c”gð 	 !¤*¨S¤/ð 	ð 	ð 	ð 	ð˜SœWð ¨ð ð ð ð ðØ
Œ'ðà„Z�”˜˜QœZ¨œ_¨a¬j¸¬oÐ=Ô>Ô?ðð ð ð ð&)ð )ð )ð )ð )˜#œ/ñ )ô )ð )ðX)Ø	
Œ��zÐ!Ô	"ð)Ø/8ð)à	ð)ð )ð )ð )ð )ð )r   