§
    öyIfx+  ã                  óò   — d Z ddlmZ ddlmZmZ ddlmZ ddlZddlm	Z	 ddl
mZ ddlmZ dd	lmZ dd
lmZmZmZ ddlmZ ddlmZ ej        ej        e	j        e	j        ej        fZ G d„ de¦  «        ZdS )z+Checker mixin for deprecated functionality.é    )Úannotations)Ú	ContainerÚIterable)ÚchainN)Únodes)ÚInstance)Úutils)ÚBaseChecker)Úget_import_nameÚ	infer_allÚ
safe_infer)Ú	INFERENCE)ÚMessageDefinitionTuplec                  ó@  — e Zd ZU dZddddddifiZded	<   d
ddddgddœfiZded<   dddddgddœfiZded<   dddddgddœfiZded<   dddd d!gddœfiZ	ded"<   d#d$d%d&d'gddœfiZ
ded(<    ej        d¦  «        dNd-„¦   «         Z ej        ddd¦  «        dOd/„¦   «         Z ej        dd¦  «        dPd1„¦   «         ZdQd3„Z ej        d%¦  «        dRd5„¦   «         Z ej        dd¦  «        dSd7„¦   «         ZdTd9„ZdUd=„ZdQd>„ZdVd@„ZdQdA„ZdNdB„ZdWdE„ZdXdH„ZdYdK„ZdOdL„ZdMS )ZÚDeprecatedMixinz‰A mixin implementing logic for checking deprecated symbols.

    A class implementing mixin must define "deprecated-method" Message.
    ÚW4906zUsing deprecated attribute %rúdeprecated-attributezHThe attribute is marked as deprecated and will be removed in the future.ÚsharedTz!dict[str, MessageDefinitionTuple]ÚDEPRECATED_ATTRIBUTE_MESSAGEÚW4901zDeprecated module %rúdeprecated-modulez*A module marked as deprecated is imported.)ÚW0402zold-deprecated-module)Ú	old_namesr   ÚDEPRECATED_MODULE_MESSAGEÚW4902zUsing deprecated method %s()údeprecated-methodzEThe method is marked as deprecated and will be removed in the future.)ÚW1505zold-deprecated-methodÚDEPRECATED_METHOD_MESSAGEÚW4903z+Using deprecated argument %s of method %s()údeprecated-argumentzGThe argument is marked as deprecated and will be removed in the future.)ÚW1511zold-deprecated-argumentÚDEPRECATED_ARGUMENT_MESSAGEÚW4904z&Using deprecated class %s of module %súdeprecated-classzDThe class is marked as deprecated and will be removed in the future.)ÚW1512zold-deprecated-classÚDEPRECATED_CLASS_MESSAGEÚW4905zUsing deprecated decorator %s()údeprecated-decoratorzHThe decorator is marked as deprecated and will be removed in the future.)ÚW1513zold-deprecated-decoratorÚDEPRECATED_DECORATOR_MESSAGEÚnodeúastroid.AttributeÚreturnÚNonec                ó0   — |                       |¦  «         dS )z3Called when an `astroid.Attribute` node is visited.N)Úcheck_deprecated_attribute)Úselfr+   s     úN/var/www/piapp/venv/lib/python3.11/site-packages/pylint/checkers/deprecated.pyÚvisit_attributezDeprecatedMixin.visit_attribute[   s   € ð 	×'Ò'¨Ñ-Ô-Ð-Ð-Ð-ó    ú
nodes.Callc                óŠ   — |                       |¦  «         t          |j        ¦  «        D ]}|                      ||¦  «         ŒdS )z2Called when a :class:`nodes.Call` node is visited.N)Úcheck_deprecated_class_in_callr   ÚfuncÚcheck_deprecated_method)r1   r+   Úinferreds      r2   Ú
visit_callzDeprecatedMixin.visit_call`   sT   € ð 	×+Ò+¨DÑ1Ô1Ð1Ý! $¤)Ñ,Ô,ð 	9ð 	9ˆHà×(Ò(¨¨xÑ8Ô8Ð8Ð8ð	9ð 	9r4   únodes.Importc                óÄ   — d„ |j         D ¦   «         D ]M}|                      ||¦  «         d|v r1|                     dd¦  «        \  }}|                      |||f¦  «         ŒNdS )z+Triggered when an import statement is seen.c              3  ó    K  — | ]	\  }}|V — Œ
d S ©N© ©Ú.0ÚnameÚ_s      r2   ú	<genexpr>z/DeprecatedMixin.visit_import.<locals>.<genexpr>r   s&   è è € Ð4Ð4™g˜d A�TÐ4Ð4Ð4Ð4Ð4Ð4r4   ú.é   N)ÚnamesÚcheck_deprecated_moduleÚsplitÚcheck_deprecated_class)r1   r+   rC   Úmod_nameÚ
class_names        r2   Úvisit_importzDeprecatedMixin.visit_importl   sƒ   € ð 5Ð4¨¬Ð4Ñ4Ô4ð 	Kð 	KˆDØ×(Ò(¨¨tÑ4Ô4Ð4Ø�dˆ{ˆ{à'+§z¢z°#°qÑ'9Ô'9Ñ$�˜*Ø×+Ò+¨D°(¸Z¸MÑJÔJÐJøð	Kð 	Kr4   úIterable[str]c                ó   — dS )z�Callback returning the deprecated decorators.

        Returns:
            collections.abc.Container of deprecated decorator names.
        r@   r@   ©r1   s    r2   Údeprecated_decoratorsz%DeprecatedMixin.deprecated_decoratorsy   ó	   € ð ˆrr4   únodes.Decoratorsc                ó€  — t          |                     ¦   «         ¦  «        }|sdS t          |d         t          j        ¦  «        rt          |d         j        ¦  «        }nt          |d         ¦  «        }|r|                     ¦   «         nd}||                      ¦   «         v r|  	                    d||¬¦  «         dS dS )z-Triggered when a decorator statement is seen.Nr   r(   ©r+   Úargs)
ÚlistÚget_childrenÚ
isinstancer   ÚCallr   r8   ÚqnamerR   Úadd_message)r1   r+   ÚchildrenÚinfr\   s        r2   Úvisit_decoratorsz DeprecatedMixin.visit_decorators�   sÀ   € õ ˜×)Ò)Ñ+Ô+Ñ,Ô,ˆØð 	ØˆFÝ�h˜q”k¥5¤:Ñ.Ô.ð 	*Ý˜X aœ[Ô-Ñ.Ô.ˆCˆCå˜X aœ[Ñ)Ô)ˆCØ"Ð,�—	’	‘”�¨ˆØ�D×.Ò.Ñ0Ô0Ð0Ð0Ø×ÒÐ3¸$ÀUÐÑKÔKÐKÐKÐKð 1Ð0r4   únodes.ImportFromc                ó°   — |j         }t          ||¦  «        }|                      ||¦  «         d„ |j        D ¦   «         }|                      |||¦  «         dS )z(Triggered when a from statement is seen.c              3  ó    K  — | ]	\  }}|V — Œ
d S r?   r@   rA   s      r2   rE   z3DeprecatedMixin.visit_importfrom.<locals>.<genexpr>˜   s&   è è € Ð6Ð6¡  a�tÐ6Ð6Ð6Ð6Ð6Ð6r4   N)Úmodnamer   rI   rH   rK   )r1   r+   ÚbasenameÚclass_namess       r2   Úvisit_importfromz DeprecatedMixin.visit_importfrom�   sc   € ð ”<ˆÝ" 4¨Ñ2Ô2ˆØ×$Ò$ T¨8Ñ4Ô4Ð4Ø6Ð6¨4¬:Ð6Ñ6Ô6ˆØ×#Ò# D¨(°KÑ@Ô@Ð@Ð@Ð@r4   úContainer[str]c                ó   — dS )zšCallback returning the deprecated methods/functions.

        Returns:
            collections.abc.Container of deprecated function/method names.
        r@   r@   rQ   s    r2   Údeprecated_methodsz"DeprecatedMixin.deprecated_methods›   rS   r4   ÚmethodÚstrú Iterable[tuple[int | None, str]]c                ó   — dS )aP  Callback returning the deprecated arguments of method/function.

        Args:
            method (str): name of function/method checked for deprecated arguments

        Returns:
            collections.abc.Iterable in form:
                ((POSITION1, PARAM1), (POSITION2: PARAM2) ...)
            where
                * POSITIONX - position of deprecated argument PARAMX in function definition.
                  If argument is keyword-only, POSITIONX should be None.
                * PARAMX - name of the deprecated argument.
            E.g. suppose function:

            .. code-block:: python
                def bar(arg1, arg2, arg3, arg4, arg5='spam')

            with deprecated arguments `arg2` and `arg4`. `deprecated_arguments` should return:

            .. code-block:: python
                ((1, 'arg2'), (3, 'arg4'))
        r@   r@   )r1   rk   s     r2   Údeprecated_argumentsz$DeprecatedMixin.deprecated_arguments£   s	   € ð0 ˆrr4   c                ó   — dS )z‡Callback returning the deprecated modules.

        Returns:
            collections.abc.Container of deprecated module names.
        r@   r@   rQ   s    r2   Údeprecated_modulesz"DeprecatedMixin.deprecated_modules½   rS   r4   Úmodulec                ó   — dS )zçCallback returning the deprecated classes of module.

        Args:
            module (str): name of module checked for deprecated classes

        Returns:
            collections.abc.Container of deprecated class names.
        r@   r@   )r1   rr   s     r2   Údeprecated_classesz"DeprecatedMixin.deprecated_classesÅ   s	   € ð ˆrr4   c                ó   — dS )z-Callback returning the deprecated attributes.r@   r@   rQ   s    r2   Údeprecated_attributesz%DeprecatedMixin.deprecated_attributesÑ   s   € àˆrr4   c                ó^  — t          |j        ¦  «        }t          |t          j        t
          t          j        f¦  «        sdS d                     |                     ¦   «         |j	        f¦  «        }|  
                    ¦   «         D ]'}||k    r|                      d||ft          ¬¦  «         Œ(dS )z&Checks if the attribute is deprecated.NrF   r   )r+   rW   Ú
confidence)r   ÚexprrZ   r   ÚClassDefr   ÚModuleÚjoinr\   Úattrnamerv   r]   r   )r1   r+   Úinferred_exprÚattribute_qnameÚdeprecated_names        r2   r0   z*DeprecatedMixin.check_deprecated_attributeÕ   s´   € å" 4¤9Ñ-Ô-ˆÝ˜-­%¬.½(ÅEÄLÐ)QÑRÔRð 	ØˆFØŸ(š( M×$7Ò$7Ñ$9Ô$9¸4¼=Ð#IÑJÔJˆØ#×9Ò9Ñ;Ô;ð 	ð 	ˆOØ /Ò1Ð1Ø× Ò Ø*ØØ)Ð+Ý(ð	 !ñ ô ð øð	ð 	r4   Úmod_pathú
str | Nonec                ó¤   — |                       ¦   «         D ]:}||k    s|r0|                     |dz   ¦  «        r|                      d||¬¦  «         Œ;dS )z#Checks if the module is deprecated.rF   r   rV   N)rq   Ú
startswithr]   )r1   r+   r�   rL   s       r2   rI   z'DeprecatedMixin.check_deprecated_moduleä   sp   € à×/Ò/Ñ1Ô1ð 	Pð 	PˆHØ˜8Ò#Ð# xÐ#°H×4GÒ4GÈÐSVÉÑ4WÔ4WÐ#Ø× Ò Ð!4¸4ÀhÐ ÑOÔOÐOøð	Pð 	Pr4   r:   únodes.NodeNGc                óš  ‡ — t          |t          ¦  «        sdS t          |j        t          j        ¦  «        r|j        j        }n.t          |j        t          j        ¦  «        r|j        j        }ndS |                     ¦   «         |h}t          ˆ fd„|D ¦   «         ¦  «        r‰  
                    d||f¬¦  «         dS t          |j        ¦  «        }|j        rd„ |j        D ¦   «         ni }ˆ fd„|D ¦   «         }t          |Ž D ]F\  }}	|	|v r‰  
                    d||	|f¬¦  «         Œ$|� ||k     r‰  
                    d||	|f¬¦  «         ŒGdS )z�Executes the checker for the given node.

        This method should be called from the checker implementing this mixin.
        Nc              3  óD   •K  — | ]}|‰                      ¦   «         v V — Œd S r?   )rj   )rB   rC   r1   s     €r2   rE   z:DeprecatedMixin.check_deprecated_method.<locals>.<genexpr>ý   s4   øè è € ÐDÐD°Tˆt�t×.Ò.Ñ0Ô0Ð0ÐDÐDÐDÐDÐDÐDr4   r   rV   c                ó   — h | ]	}|j         ’Œ
S r@   )Úarg)rB   Úkws     r2   ú	<setcomp>z:DeprecatedMixin.check_deprecated_method.<locals>.<setcomp>  s   € Ð1Ð1Ð1˜R�"”&Ð1Ð1Ð1r4   c              3  óB   •K  — | ]}‰                      |¦  «        V — Œd S r?   )ro   )rB   Úqnr1   s     €r2   rE   z:DeprecatedMixin.check_deprecated_method.<locals>.<genexpr>  s1   øè è € ÐOÐOÀ" × 9Ò 9¸"Ñ =Ô =ÐOÐOÐOÐOÐOÐOr4   r    )rZ   ÚACCEPTABLE_NODESr8   r   Ú	Attributer}   ÚNamerC   r\   Úanyr]   ÚlenrW   Úkeywordsr   )
r1   r+   r:   Ú	func_nameÚqnamesÚnum_of_argsÚkwargsro   ÚpositionÚarg_names
   `         r2   r9   z'DeprecatedMixin.check_deprecated_methodê   s¥  ø€ õ ˜(Õ$4Ñ5Ô5ð 	ØˆFå�d”i¥¤Ñ1Ô1ð 	Øœ	Ô*ˆIˆIÝ˜œ	¥5¤:Ñ.Ô.ð 	Øœ	œˆIˆIð ˆFà—.’.Ñ"Ô" IÐ.ˆÝÐDÐDÐDÐD¸VÐDÑDÔDÑDÔDð 	Ø×ÒÐ0°tÀ9À,ÐÑOÔOÐOØˆFÝ˜$œ)‘n”nˆØ59´]ÐJÐ1Ð1 4¤=Ð1Ñ1Ô1Ð1ÈˆØOÐOÐOÐOÈÐOÑOÔOÐÝ"'Ð)=Ð">ð 
	ð 
	ÑˆH�hØ˜6Ð!Ð!à× Ò Ø)°¸HÀiÐ;Pð !ñ ô ð ð ð Ð%¨(°[Ò*@Ð*@à× Ò Ø)°¸HÀiÐ;Pð !ñ ô ð øð
	ð 
	r4   rL   rf   c                ór   — |D ]3}||                       |¦  «        v r|                      d|||f¬¦  «         Œ4dS )z"Checks if the class is deprecated.r$   rV   N)rt   r]   )r1   r+   rL   rf   rM   s        r2   rK   z&DeprecatedMixin.check_deprecated_class  s`   € ð
 &ð 	ð 	ˆJØ˜T×4Ò4°XÑ>Ô>Ð>Ð>Ø× Ò Ø&¨T¸ÀXÐ8Nð !ñ ô ð øð	ð 	r4   c                óþ   — t          |j        t          j        ¦  «        r[t          |j        j        t          j        ¦  «        r9|j        j        j        }|j        j        }|                      |||f¦  «         dS dS dS )z$Checks if call the deprecated class.N)	rZ   r8   r   r�   ry   r�   rC   r}   rK   )r1   r+   rL   rM   s       r2   r7   z.DeprecatedMixin.check_deprecated_class_in_call  sˆ   € õ �d”i¥¤Ñ1Ô1ð 	GµjØŒIŒN�EœJñ7
ô 7
ð 	Gð ”y”~Ô*ˆHØœÔ+ˆJØ×'Ò'¨¨h¸¸ÑFÔFÐFÐFÐFð	Gð 	Gð 	Gð 	Gr4   N)r+   r,   r-   r.   )r+   r5   r-   r.   )r+   r<   r-   r.   )r-   rO   )r+   rT   r-   r.   )r+   ra   r-   r.   )r-   rh   )rk   rl   r-   rm   )rr   rl   r-   rO   )r+   r<   r�   r‚   r-   r.   )r+   r5   r:   r…   r-   r.   )r+   r…   rL   rl   rf   rO   r-   r.   )Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   Ú__annotations__r   r   r"   r&   r*   r	   Úonly_required_for_messagesr3   r;   rN   rR   r`   rg   rj   ro   rq   rt   rv   r0   rI   r9   rK   r7   r@   r4   r2   r   r      sŠ  € € € € € € ðð ð 	Ø+Ø"ØVØ�tÐð	
ðGÐ ð ð ð ñ ð 	Ø"ØØ8Ø=Ð>È$ÐOÐOð	
ðDÐð ð ð ñ ð 	Ø*ØØSØ=Ð>È$ÐOÐOð	
ðDÐð ð ð ñ ð 	Ø9Ø!ØUØ?Ð@ÈDÐQÐQð	
ðFÐð ð ð ñ ð 	Ø4ØØRØ<Ð=ÈÐNÐNð	
ðCÐð ð ð ñ ð 	Ø-Ø"ØVØ@ÐAÈTÐRÐRð	
ðGÐ ð ð ð ñ ð &€UÔ%Ð&<Ñ=Ô=ð.ð .ð .ñ >Ô=ð.ð &€UÔ%ØØØñô ð
9ð 9ð 9ñô ð
9ð &€UÔ%ØØñô ðKð Kð Kñ	ô ðKðð ð ð ð &€UÔ%Ð&<Ñ=Ô=ðLð Lð Lñ >Ô=ðLð &€UÔ%ØØñô ðAð Að Añ	ô ðAðð ð ð ðð ð ð ð4ð ð ð ð
ð 
ð 
ð 
ðð ð ð ðð ð ð ðPð Pð Pð Pð#ð #ð #ð #ðJ	ð 	ð 	ð 	ðGð Gð Gð Gð Gð Gr4   r   )rŸ   Ú
__future__r   Úcollections.abcr   r   Ú	itertoolsr   Úastroidr   Úastroid.basesr   Úpylint.checkersr	   Úpylint.checkers.base_checkerr
   Úpylint.checkers.utilsr   r   r   Úpylint.interfacesr   Úpylint.typingr   ÚBoundMethodÚUnboundMethodÚFunctionDefrz   r�   rŽ   r   r@   r4   r2   ú<module>r¯      sK  ðð
 2Ð 1à "Ð "Ð "Ð "Ð "Ð "à /Ð /Ð /Ð /Ð /Ð /Ð /Ð /Ø Ð Ð Ð Ð Ð à €€€Ø Ð Ð Ð Ð Ð Ø "Ð "Ð "Ð "Ð "Ð "à !Ð !Ð !Ð !Ð !Ð !Ø 4Ð 4Ð 4Ð 4Ð 4Ð 4Ø HÐ HÐ HÐ HÐ HÐ HÐ HÐ HÐ HÐ HØ 'Ð 'Ð 'Ð 'Ð 'Ð 'Ø 0Ð 0Ð 0Ð 0Ð 0Ð 0ð ÔØÔØ	ÔØ	„NØÔðÐ ðCGð CGð CGð CGð CG�kñ CGô CGð CGð CGð CGr4   