§
    Ài6  ã                   ól   — d Z ddlZddlZddlZ	 ddlZn# e$ r ddlZY nw xY w G d„ de¦  «        ZeZ	dS )aà  
Parameters deprecation
======================

.. _Tantale's Blog: https://tantale.github.io/
.. _Deprecated Parameters: https://tantale.github.io/articles/deprecated_params/

This module introduces a :class:`deprecated_params` decorator to specify that one (or more)
parameter(s) are deprecated: when the user executes a function with a deprecated parameter,
he will see a warning message in the console.

The decorator is customizable, the user can specify the deprecated parameter names
and associate to each of them a message providing the reason of the deprecation.
As with the :func:`~deprecated.classic.deprecated` decorator, the user can specify
a version number (using the *version* parameter) and also define the warning message category
(a subclass of :class:`Warning`) and when to display the messages (using the *action* parameter).

The complete study concerning the implementation of this decorator is available on the `Tantale's blog`_,
on the `Deprecated Parameters`_ page.
é    Nc                   ó8   — e Zd ZdZdefd„Zd	d„Zd„ Zd„ Zd„ Z	dS )
ÚDeprecatedParamszg
    Decorator used to decorate a function which at least one
    of the parameters is deprecated.
    Ú c                 óP   — i | _         || _        |                      ||¬¦  «         d S )N)Úreason)ÚmessagesÚcategoryÚpopulate_messages)ÚselfÚparamr   r	   s       úV/home/mmwave/public_html/mmwave/venv/lib/python3.11/site-packages/deprecated/params.pyÚ__init__zDeprecatedParams.__init__'   s/   € ØˆŒØ ˆŒØ×Ò˜u¨VÐÑ4Ô4Ð4Ð4Ð4ó    c                 óø   — t          |t          ¦  «        r| j                             |¦  «         d S t          |t          ¦  «        r&d}|p|                     |¬¦  «        }|| j        |<   d S t          |¦  «        ‚)Nz!'{param}' parameter is deprecated)r   )Ú
isinstanceÚdictr   ÚupdateÚstrÚformatÚ	TypeError)r   r   r   Úfmts       r   r
   z"DeprecatedParams.populate_messages,   s   € Ý�e�TÑ"Ô"ð 	#ØŒM× Ò  Ñ'Ô'Ð'Ð'Ð'Ý˜�sÑ#Ô#ð 	#Ø5ˆCØÐ6˜sŸzšz°˜zÑ6Ô6ˆFØ#)ˆDŒM˜%Ñ Ð Ð å˜EÑ"Ô"Ð"r   c                 ór   ‡ —  |j         |i |¤Ž}t          j        |j        fi |j        ¤Ž}ˆ fd„|D ¦   «         S )Nc                 ó&   •— g | ]}|‰j         v ¯|‘ŒS © ©r   ©Ú.0r   r   s     €r   ú
<listcomp>z1DeprecatedParams.check_params.<locals>.<listcomp>9   s%   ø€ ÐCÐCÐC˜%¨E°T´]Ð,BÐ,B�Ð,BÐ,BÐ,Br   )ÚbindÚcollectionsÚOrderedDictÚ	argumentsÚkwargs)r   Ú	signatureÚargsr#   ÚbindingÚbounds   `     r   Úcheck_paramszDeprecatedParams.check_params6   sP   ø€ Ø �)”. $Ð1¨&Ð1Ð1ˆÝÔ'¨Ô(9ÐLÐL¸W¼^ÐLÐLˆØCÐCÐCÐC 5ÐCÑCÔCÐCr   c                 óH   — |D ]}t          j        || j        d¬¦  «         Œd S )Né   )r	   Ú
stacklevel)ÚwarningsÚwarnr	   )r   r   Úmessages      r   Úwarn_messageszDeprecatedParams.warn_messages;   s;   € àð 	Ið 	IˆGÝŒM˜'¨D¬MÀaÐHÑHÔHÐHÐHð	Ið 	Ir   c                 óv   ‡ ‡‡— t          j        ‰¦  «        Št          j        ‰¦  «        ˆˆ ˆfd„¦   «         }|S )Nc                  óx   •—  ‰j         ‰g| ¢R i |¤Ž}‰                     ˆfd„|D ¦   «         ¦  «          ‰| i |¤ŽS )Nc                 ó*   •— g | ]}‰j         |         ‘ŒS r   r   r   s     €r   r   z>DeprecatedParams.__call__.<locals>.wrapper.<locals>.<listcomp>G   s    ø€ ÐQÐQÐQ¸ ¤¨eÔ 4ÐQÐQÐQr   )r(   r/   )r%   r#   Úinvalid_paramsÚfr   r$   s      €€€r   Úwrapperz*DeprecatedParams.__call__.<locals>.wrapperD   sc   ø€ à.˜TÔ.¨yÐJ¸4ÐJÐJÐJÀ6ÐJÐJˆNØ×ÒÐQÐQÐQÐQÀ.ÐQÑQÔQÑRÔRÐRØ�1�dÐ%˜fÐ%Ð%Ð%r   )Úinspectr$   Ú	functoolsÚwraps)r   r4   r5   r$   s   `` @r   Ú__call__zDeprecatedParams.__call__@   sT   øøø€ åÔ% aÑ(Ô(ˆ	å	Œ˜Ñ	Ô	ð	&ð 	&ð 	&ð 	&ð 	&ð 	&ñ 
Ô	ð	&ð
 ˆr   N)r   )
Ú__name__Ú
__module__Ú__qualname__Ú__doc__ÚDeprecationWarningr   r
   r(   r/   r9   r   r   r   r   r   !   s�   € € € € € ðð ð
 &(Ð2Dð 5ð 5ð 5ð 5ð
#ð #ð #ð #ðDð Dð Dð
Ið Ið Ið

ð 
ð 
ð 
ð 
r   r   )
r=   r    r7   r,   Úinspect2r6   ÚImportErrorÚobjectr   Údeprecated_paramsr   r   r   ú<module>rC      s§   ððð ð( Ð Ð Ð Ø Ð Ð Ð Ø €€€ðàÐÐÐÐøØð ð ð Ø€N€N€N€N€Nðøøøð)ð )ð )ð )ð )�vñ )ô )ð )ð\ %Ð Ð Ð s   � •	! !