o
    wvXj  ã                   @   sÐ   d Z ddlmZmZ dZg d¢Zeeeede	eƒƒƒƒZ
e
d Zdd„ ZG dd	„ d	eƒZd
ZdZdZdZdZdZdZdZdZeeeehƒZeeeeeehƒZeeeehƒZeeehƒZeeeeeeeehƒZdS )aº  Built-in task states.

.. _states:

States
------

See :ref:`task-states`.

.. _statesets:

Sets
----

.. state:: READY_STATES

READY_STATES
~~~~~~~~~~~~

Set of states meaning the task result is ready (has been executed).

.. state:: UNREADY_STATES

UNREADY_STATES
~~~~~~~~~~~~~~

Set of states meaning the task result is not ready (hasn't been executed).

.. state:: EXCEPTION_STATES

EXCEPTION_STATES
~~~~~~~~~~~~~~~~

Set of states meaning the task returned an exception.

.. state:: PROPAGATE_STATES

PROPAGATE_STATES
~~~~~~~~~~~~~~~~

Set of exception states that should propagate exceptions to the user.

.. state:: ALL_STATES

ALL_STATES
~~~~~~~~~~

Set of all possible states.

Misc
----

é    )Úabsolute_importÚunicode_literals)ÚPENDINGÚRECEIVEDÚSTARTEDÚSUCCESSÚFAILUREÚREVOKEDÚRETRYÚIGNOREDÚREADY_STATESÚUNREADY_STATESÚEXCEPTION_STATESÚPROPAGATE_STATESÚ
precedenceÚstate)	r   r   Nr	   r   r   ÚREJECTEDr
   r   Nc                 C   s"   zt |  W S  ty   t Y S w )zRGet the precedence index for state.

    Lower index means higher precedence.
    )ÚPRECEDENCE_LOOKUPÚKeyErrorÚNONE_PRECEDENCE)r   © r   úJ/var/www/html/myproject/venv/lib/python3.10/site-packages/celery/states.pyr   S   s
   
ÿr   c                   @   s0   e Zd ZdZdd„ Zdd„ Zdd„ Zdd	„ Zd
S )r   a  Task state.

    State is a subclass of :class:`str`, implementing comparison
    methods adhering to state precedence rules::

        >>> from celery.states import state, PENDING, SUCCESS

        >>> state(PENDING) < state(SUCCESS)
        True

    Any custom state is considered to be lower than :state:`FAILURE` and
    :state:`SUCCESS`, but higher than any of the other built-in states::

        >>> state('PROGRESS') > state(STARTED)
        True

        >>> state('PROGRESS') > state('SUCCESS')
        False
    c                 C   s   t | ƒt |ƒk S ©N©r   ©ÚselfÚotherr   r   r   Ú__gt__s   ó   zstate.__gt__c                 C   s   t | ƒt |ƒkS r   r   r   r   r   r   Ú__ge__v   r   zstate.__ge__c                 C   s   t | ƒt |ƒkS r   r   r   r   r   r   Ú__lt__y   r   zstate.__lt__c                 C   s   t | ƒt |ƒkS r   r   r   r   r   r   Ú__le__|   r   zstate.__le__N)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r   r    r!   r   r   r   r   r   ^   s    r   r   r   r   r   r   r	   r   r
   r   )r%   Ú
__future__r   r   Ú__all__Ú
PRECEDENCEÚdictÚzipÚrangeÚlenr   r   r   Ústrr   r   r   r   r   r   r	   r   r
   r   Ú	frozensetr   r   r   r   Ú
ALL_STATESr   r   r   r   Ú<module>   s0   5	#
ÿ