o ƚRe @sddlZddlZejrddlZddlmZGdddejZGdddeZGdddeZ Gd d d eZ e Z Gd d d eZ Gd ddeZ GdddeZdS)N)RetryCallStatec@s<eZdZdZejdddefddZdd d Zdd d Z dS) stop_basez(Abstract base class for stop strategies. retry_staterreturncCsdSNselfrrr/builddir/build/BUILDROOT/alt-python310-pip-21.3.1-3.el8.x86_64/opt/alt/python310/lib/python3.10/site-packages/pip/_vendor/tenacity/stop.py__call__szstop_base.__call__otherstop_allcC t||Sr)r r r rrr __and__  zstop_base.__and__stop_anycCrr)rrrrr __or__#rzstop_base.__or__N)r rrr )r rrr) __name__ __module__ __qualname____doc__abcabstractmethodboolr rrrrrr rs  rc@4eZdZdZdeddfddZdddefd d ZdS) rz+Stop if any of the stop condition is valid.stopsrNcG ||_dSrrr rrrr __init__*rzstop_any.__init__rrctfdd|jDS)Nc3|]}|VqdSrr.0xrrr .z$stop_any.__call__..)anyrrrr&r r -zstop_any.__call__rrrrrr rr rrrr r'rc@r) r z*Stop if all the stop conditions are valid.rrNcGrrrrrrr r 4rzstop_all.__init__rrcr!)Nc3r"rrr#r&rr r'8r(z$stop_all.__call__..)allrrrr&r r 7r*zstop_all.__call__r+rrrr r 1r,r c@s"eZdZdZdddefddZdS) _stop_neverz Never stop.rrrcCsdS)NFrrrrr r >sz_stop_never.__call__N)rrrrrr rrrr r.;sr.c@s,eZdZdZd ddZdd defd d ZdS) stop_when_event_setz!Stop when the given event is set.eventthreading.EventrNcCrr)r0)r r0rrr r Hrzstop_when_event_set.__init__rrcCs |jSr)r0is_setrrrr r Krzstop_when_event_set.__call__)r0r1rN)rrrrr rr rrrr r/Es r/c@r) stop_after_attemptz.Stop when the previous attempt >= max_attempt.max_attempt_numberrNcCrr)r4)r r4rrr r Rrzstop_after_attempt.__init__rrcC |j|jkSr)attempt_numberr4rrrr r U zstop_after_attempt.__call__)rrrrintr rr rrrr r3Or,r3c@r) stop_after_delayz3Stop when the time from the first attempt >= limit. max_delayrNcCrr)r:)r r:rrr r \rzstop_after_delay.__init__rrcCr5r)seconds_since_startr:rrrr r _r7zstop_after_delay.__call__)rrrrfloatr rr rrrr r9Yr,r9)rtyping TYPE_CHECKING threadingpip._vendor.tenacityrABCrrr r. stop_neverr/r3r9rrrr s