o
    wvXj�  ã                   @   s†   d Z ddlmZmZmZ ddlZddlmZ ddlm	Z	m
Z
 dZdZdZ			dd
d„Z		ddd„Z		ddd„ZG dd„ deƒZdS )zDeprecation utilities.é    )Úabsolute_importÚprint_functionÚunicode_literalsN©Úwraps)ÚCDeprecationWarningÚCPendingDeprecationWarning)ÚCallableÚPropertyÚwarnz‚
    {description} is scheduled for deprecation in     version {deprecation} and removal in version v{removal}.     {alternative}
zc
    {description} is deprecated and scheduled for removal in
    version {removal}. {alternative}
é   c                 C   sR   | |||dœ}|durt tjdi |¤Žƒ}n
ttjdi |¤Žƒ}tj||d� dS )zWarn of (pending) deprecation.)ÚdescriptionÚdeprecationÚremovalÚalternativeN)Ú
stacklevel© )r   ÚPENDING_DEPRECATION_FMTÚformatr   ÚDEPRECATION_FMTÚwarningsr   )r   r   r   r   r   ÚctxÚwr   r   úT/var/www/html/myproject/venv/lib/python3.10/site-packages/celery/utils/deprecated.pyr      s   þr   c                    ó   ‡ ‡‡‡fdd„}|S )a  Decorator for deprecated functions.

    A deprecation warning will be emitted when the function is called.

    Arguments:
        deprecation (str): Version that marks first deprecation, if this
            argument isn't set a ``PendingDeprecationWarning`` will be
            emitted instead.
        removal (str): Future version when this feature will be removed.
        alternative (str): Instructions for an alternative solution (if any).
        description (str): Description of what's being deprecated.
    c                    s    t ˆ ƒ‡‡‡‡ ‡fdd„ƒ}|S )Nc                     s4   ddl m} tˆp|ˆƒˆˆˆ dd� ˆ| i |¤ŽS )Né   )Úqualnameé   )r   r   r   r   r   )Úimportsr   r   )ÚargsÚkwargsr   )r   r   r   Úfunr   r   r   Ú__inner7   s   üz)Callable.<locals>._inner.<locals>.__innerr   )r!   r"   ©r   r   r   r   ©r!   r   Ú_inner5   s   zCallable.<locals>._innerr   ©r   r   r   r   r%   r   r#   r   r	   '   s   r	   c                    r   )z$Decorator for deprecated properties.c                    s   t | ˆˆˆ ˆp	| jd�S )N)r   r   r   r   )Ú_deprecated_propertyÚ__name__r$   r#   r   r   r%   G   s   
þzProperty.<locals>._innerr   r&   r   r#   r   r
   D   s   r
   c                   @   s@   e Zd Zddd„Zddd„Zdd„ Zdd	„ Zd
d„ Zdd„ ZdS )r'   Nc                 K   sF   || _ || _|| _|j|j|j| _| _| _|| _| j dd¡ d S )Nr   r   )Ú_deprecated_property__getÚ_deprecated_property__setÚ_deprecated_property__delr(   Ú
__module__Ú__doc__Ú	depreinfoÚ
setdefault)ÚselfÚfgetÚfsetÚfdelÚdocr.   r   r   r   Ú__init__P   s   ÿz_deprecated_property.__init__c                 C   s&   |d u r| S t di | j¤Ž |  |¡S )Nr   )r   r.   r)   )r0   ÚobjÚtyper   r   r   Ú__get__Z   s   
z_deprecated_property.__get__c                 C   s>   |d u r| S | j d u rtdƒ‚tdi | j¤Ž |   ||¡ d S )Nzcannot set attributer   )r*   ÚAttributeErrorr   r.   )r0   r6   Úvaluer   r   r   Ú__set__`   s   
z_deprecated_property.__set__c                 C   s<   |d u r| S | j d u rtdƒ‚tdi | j¤Ž |   |¡ d S )Nzcannot delete attributer   )r+   r9   r   r.   )r0   r6   r   r   r   Ú
__delete__h   s   
z_deprecated_property.__delete__c                 C   s   | j | j|| jfi | j¤ŽS ©N)Ú	__class__r)   r+   r.   )r0   r2   r   r   r   Úsetterp   ó   z_deprecated_property.setterc                 C   s   | j | j| j|fi | j¤ŽS r=   )r>   r)   r*   r.   )r0   r3   r   r   r   Údeleters   r@   z_deprecated_property.deleter©NNNNr=   )	r(   r,   Ú__qualname__r5   r8   r;   r<   r?   rA   r   r   r   r   r'   N   s    


r'   )NNNNr   rB   )r-   Ú
__future__r   r   r   r   Ú
vine.utilsr   Úcelery.exceptionsr   r   Ú__all__r   r   r   r	   r
   Úobjectr'   r   r   r   r   Ú<module>   s$   
ÿ
ÿ
ÿ
