Ë
    R(h  ã                   ó`  — d dl Z d dlZd dlmZ ej                  r
d dlZd dlmZ  G d„ de j                  «      Zej                  eej                  dgef   f   Z G d„ de«      Z G d	„ d
e«      Z G d„ de«      Z e«       Z G d„ de«      Z G d„ de«      Z G d„ de«      Z G d„ de«      Zy)é    N)Ú_utils)ÚRetryCallStatec                   óN   — e Zd ZdZej
                  dddefd„«       Zd	d„Zd
d„Z	y)Ú	stop_basez(Abstract base class for stop strategies.Úretry_stater   Úreturnc                  ó   — y ©N© ©Úselfr   s     úK/var/www/skyplay_api_hub/venv/lib/python3.12/site-packages/tenacity/stop.pyÚ__call__zstop_base.__call__   s   € àó    c                 ó   — t        | |«      S r
   )Ústop_all©r   Úothers     r   Ú__and__zstop_base.__and__"   ó   € Ü˜˜eÓ$Ð$r   c                 ó   — t        | |«      S r
   )Ústop_anyr   s     r   Ú__or__zstop_base.__or__%   r   r   N)r   r   r   r   )r   r   r   r   )
Ú__name__Ú
__module__Ú__qualname__Ú__doc__ÚabcÚabstractmethodÚboolr   r   r   r   r   r   r   r      s6   „ Ù2à×ÑðÐ$4ð ¸ò ó ðó%ô%r   r   r   c                   ó0   — e Zd ZdZdeddfd„Zdddefd„Zy)	r   z+Stop if any of the stop condition is valid.Ústopsr   Nc                 ó   — || _         y r
   ©r"   ©r   r"   s     r   Ú__init__zstop_any.__init__/   ó	   € Øˆ�
r   r   r   c                 ó@   ‡— t        ˆfd„| j                  D «       «      S )Nc              3   ó.   •K  — | ]  } |‰«      –— Œ y ­wr
   r   ©Ú.0Úxr   s     €r   ú	<genexpr>z$stop_any.__call__.<locals>.<genexpr>3   ó   øè ø€ Ò6 a‘1�[—>Ñ6ùó   ƒ)Úanyr"   r   s    `r   r   zstop_any.__call__2   ó   ø€ ÜÓ6¨4¯:©:Ô6Ó6Ð6r   ©r   r   r   r   r   r&   r    r   r   r   r   r   r   ,   s,   „ Ù5ð˜yð ¨Tó ð7Ð$4ð 7¸ô 7r   r   c                   ó0   — e Zd ZdZdeddfd„Zdddefd„Zy)	r   z*Stop if all the stop conditions are valid.r"   r   Nc                 ó   — || _         y r
   r$   r%   s     r   r&   zstop_all.__init__9   r'   r   r   r   c                 ó@   ‡— t        ˆfd„| j                  D «       «      S )Nc              3   ó.   •K  — | ]  } |‰«      –— Œ y ­wr
   r   r*   s     €r   r-   z$stop_all.__call__.<locals>.<genexpr>=   r.   r/   )Úallr"   r   s    `r   r   zstop_all.__call__<   r1   r   r2   r   r   r   r   r   6   s,   „ Ù4ð˜yð ¨Tó ð7Ð$4ð 7¸ô 7r   r   c                   ó    — e Zd ZdZdddefd„Zy)Ú_stop_neverzNever stop.r   r   r   c                  ó   — y)NFr   r   s     r   r   z_stop_never.__call__C   s   € Ør   N)r   r   r   r   r    r   r   r   r   r9   r9   @   s   „ ÙðÐ$4ð ¸ô r   r9   c                   ó(   — e Zd ZdZdd„Zdddefd„Zy)	Ústop_when_event_setz!Stop when the given event is set.r   Nc                 ó   — || _         y r
   )Úevent)r   r>   s     r   r&   zstop_when_event_set.__init__M   r'   r   r   r   c                 ó6   — | j                   j                  «       S r
   )r>   Úis_setr   s     r   r   zstop_when_event_set.__call__P   s   € Ø�z‰z× Ñ Ó"Ð"r   )r>   zthreading.Eventr   N)r   r   r   r   r&   r    r   r   r   r   r<   r<   J   s   „ Ù+óð#Ð$4ð #¸ô #r   r<   c                   ó0   — e Zd ZdZdeddfd„Zdddefd„Zy)	Ústop_after_attemptz.Stop when the previous attempt >= max_attempt.Úmax_attempt_numberr   Nc                 ó   — || _         y r
   )rC   )r   rC   s     r   r&   zstop_after_attempt.__init__W   s
   € Ø"4ˆÕr   r   r   c                 ó4   — |j                   | j                  k\  S r
   )Úattempt_numberrC   r   s     r   r   zstop_after_attempt.__call__Z   s   € Ø×)Ñ)¨T×-DÑ-DÑDÐDr   )r   r   r   r   Úintr&   r    r   r   r   r   rB   rB   T   s/   „ Ù8ð5¨3ð 5°4ó 5ðEÐ$4ð E¸ô Er   rB   c                   óD   — e Zd ZdZdej
                  ddfd„Zdddefd„Zy)	Ústop_after_delayaS  
    Stop when the time from the first attempt >= limit.

    Note: `max_delay` will be exceeded, so when used with a `wait`, the actual total delay will be greater
    than `max_delay` by some of the final sleep period before `max_delay` is exceeded.

    If you need stricter timing with waits, consider `stop_before_delay` instead.
    Ú	max_delayr   Nc                 ó8   — t        j                  |«      | _        y r
   ©r   Ú
to_secondsrJ   ©r   rJ   s     r   r&   zstop_after_delay.__init__h   ó   € Ü×*Ñ*¨9Ó5ˆ�r   r   r   c                 ób   — |j                   €t        d«      ‚|j                   | j                  k\  S ©Nz4__call__() called but seconds_since_start is not set)Úseconds_since_startÚRuntimeErrorrJ   r   s     r   r   zstop_after_delay.__call__k   s/   € Ø×*Ñ*Ð2ÜÐUÓVÐVØ×.Ñ.°$·.±.Ñ@Ð@r   ©	r   r   r   r   r   Útime_unit_typer&   r    r   r   r   r   rI   rI   ^   s7   „ ñð6 &×"7Ñ"7ð 6¸Dó 6ðAÐ$4ð A¸ô Ar   rI   c                   óD   — e Zd ZdZdej
                  ddfd„Zdddefd„Zy)	Ústop_before_delaya  
    Stop right before the next attempt would take place after the time from the first attempt >= limit.

    Most useful when you are using with a `wait` function like wait_random_exponential, but need to make
    sure that the max_delay is not exceeded.
    rJ   r   Nc                 ó8   — t        j                  |«      | _        y r
   rL   rN   s     r   r&   zstop_before_delay.__init__y   rO   r   r   r   c                 ó|   — |j                   €t        d«      ‚|j                   |j                  z   | j                  k\  S rQ   )rR   rS   Úupcoming_sleeprJ   r   s     r   r   zstop_before_delay.__call__|   s?   € Ø×*Ñ*Ð2ÜÐUÓVÐVà×+Ñ+¨k×.HÑ.HÑHØ�~‰~ñð	
r   rT   r   r   r   rW   rW   q   s4   „ ñð6 &×"7Ñ"7ð 6¸Dó 6ð
Ð$4ð 
¸ô 
r   rW   )r   ÚtypingÚtenacityr   ÚTYPE_CHECKINGÚ	threadingr   ÚABCr   ÚUnionÚCallabler    Ú	StopBaseTr   r   r9   Ú
stop_neverr<   rB   rI   rW   r   r   r   ú<module>rd      s·   ðó  Û å à	×ÒÛå'ô%�—‘ô %ð �L‰L˜ F§O¡OÐ5EÐ4FÈÐ4LÑ$MÐMÑN€	ô7ˆyô 7ô7ˆyô 7ô�)ô ñ ‹]€
ô#˜)ô #ôE˜ô EôA�yô Aô&
˜	õ 
r   