Viewing File: /opt/alt/python35/lib/python3.5/site-packages/pip/_vendor/retrying.pyc

ó
“tÆ_c@s•ddlZddlmZddlZddlZddlZdZd„Zdefd„ƒYZ	defd„ƒYZ
d	efd
„ƒYZdS(iÿÿÿÿN(tsixiÿÿÿ?csStˆƒdkr9tˆdƒr9d„}|ˆdƒS‡‡fd†}|SdS(sÆ
    Decorator function that instantiates the Retrying object
    @param *dargs: positional arguments passed to Retrying object
    @param **dkw: keyword arguments passed to the Retrying object
    iics"tjˆƒ‡fd†ƒ}|S(Ncstƒjˆ||ŽS(N(tRetryingtcall(targstkw(tf(sE/opt/alt/python35/lib/python3.5/site-packages/pip/_vendor/retrying.pyt	wrapped_f$s(Rtwraps(RR((RsE/opt/alt/python35/lib/python3.5/site-packages/pip/_vendor/retrying.pytwrap_simple"scs(tjˆƒ‡‡‡fd†ƒ}|S(NcstˆˆŽjˆ||ŽS(N(RR(RR(tdargstdkwR(sE/opt/alt/python35/lib/python3.5/site-packages/pip/_vendor/retrying.pyR/s(RR(RR(R	R
(RsE/opt/alt/python35/lib/python3.5/site-packages/pip/_vendor/retrying.pytwrap-s$N(tlentcallable(R	R
RR((R	R
sE/opt/alt/python35/lib/python3.5/site-packages/pip/_vendor/retrying.pytretrys
"	RcBs§eZdddddddddddddedddd„Zd„Zd„Zd„Zd„Zd„Z	d„Z
d„Zd„Zd	„Z
d
„Zd„ZRS(
csé|dkrdn||_|dkr-dn||_|dkrHdn||_|dkrcdn||_|dkr~dn||_|dkr™dn||_|	dkr´dn|	|_|
dkrÏdn|
|_|dkrêt	n||_
|dkrdn||_g‰|dk	r3ˆj|j
ƒn|dk	rRˆj|jƒn|dk	rj||_n3|dkr‹‡fd†|_nt||ƒ|_d„g‰|dk	rȈj|jƒn|dk	sà|dk	róˆj|jƒn|dk	s|	dk	rˆj|jƒn|
dk	s6|dk	rIˆj|jƒn|dk	ra||_n3|dkr‚‡fd†|_nt||ƒ|_|dkr¯|j|_n	||_|
dkrÓ|j|_n	|
|_||_dS(	Niidièiicst‡‡fd†ˆDƒƒS(Nc3s|]}|ˆˆƒVqdS(N((t.0R(tattemptstdelay(sE/opt/alt/python35/lib/python3.5/site-packages/pip/_vendor/retrying.pys	<genexpr>as(tany(RR(t
stop_funcs(RRsE/opt/alt/python35/lib/python3.5/site-packages/pip/_vendor/retrying.pyt<lambda>asc_sdS(Ni((Rtkwargs((sE/opt/alt/python35/lib/python3.5/site-packages/pip/_vendor/retrying.pyRhscst‡‡fd†ˆDƒƒS(Nc3s|]}|ˆˆƒVqdS(N((RR(RR(sE/opt/alt/python35/lib/python3.5/site-packages/pip/_vendor/retrying.pys	<genexpr>ys(tmax(RR(t
wait_funcs(RRsE/opt/alt/python35/lib/python3.5/site-packages/pip/_vendor/retrying.pyRys(tNonet_stop_max_attempt_numbert_stop_max_delayt_wait_fixedt_wait_random_mint_wait_random_maxt_wait_incrementing_startt_wait_incrementing_incrementt_wait_exponential_multipliertMAX_WAITt_wait_exponential_maxt_wait_jitter_maxtappendtstop_after_attempttstop_after_delaytstoptgetattrtfixed_sleeptrandom_sleeptincrementing_sleeptexponential_sleeptwaitt
always_rejectt_retry_on_exceptiontnever_rejectt_retry_on_resultt_wrap_exception(tselfR'R-tstop_max_attempt_numbertstop_max_delayt
wait_fixedtwait_random_mintwait_random_maxtwait_incrementing_starttwait_incrementing_incrementtwait_exponential_multipliertwait_exponential_maxtretry_on_exceptiontretry_on_resulttwrap_exceptiont	stop_funct	wait_functwait_jitter_max((RRsE/opt/alt/python35/lib/python3.5/site-packages/pip/_vendor/retrying.pyt__init__:sR		cCs
||jkS(s;Stop after the previous attempt >= stop_max_attempt_number.(R(R3tprevious_attempt_numbertdelay_since_first_attempt_ms((sE/opt/alt/python35/lib/python3.5/site-packages/pip/_vendor/retrying.pyR%scCs
||jkS(s=Stop after the time from the first attempt >= stop_max_delay.(R(R3RDRE((sE/opt/alt/python35/lib/python3.5/site-packages/pip/_vendor/retrying.pyR&‘scCsdS(s#Don't sleep at all before retrying.i((R3RDRE((sE/opt/alt/python35/lib/python3.5/site-packages/pip/_vendor/retrying.pytno_sleep•scCs|jS(s0Sleep a fixed amount of time between each retry.(R(R3RDRE((sE/opt/alt/python35/lib/python3.5/site-packages/pip/_vendor/retrying.pyR)™scCstj|j|jƒS(sISleep a random amount of time between wait_random_min and wait_random_max(trandomtrandintRR(R3RDRE((sE/opt/alt/python35/lib/python3.5/site-packages/pip/_vendor/retrying.pyR*scCs1|j|j|d}|dkr-d}n|S(s¥
        Sleep an incremental amount of time after each attempt, starting at
        wait_incrementing_start and incrementing by wait_incrementing_increment
        ii(RR(R3RDREtresult((sE/opt/alt/python35/lib/python3.5/site-packages/pip/_vendor/retrying.pyR+¡s	cCsKd|}|j|}||jkr2|j}n|dkrGd}n|S(Nii(R R"(R3RDREtexpRI((sE/opt/alt/python35/lib/python3.5/site-packages/pip/_vendor/retrying.pyR,«s

	cCstS(N(tFalse(R3RI((sE/opt/alt/python35/lib/python3.5/site-packages/pip/_vendor/retrying.pyR0´scCstS(N(tTrue(R3RI((sE/opt/alt/python35/lib/python3.5/site-packages/pip/_vendor/retrying.pyR.·scCsFt}|jr,||j|jdƒO}n||j|jƒO}|S(Ni(RKt
has_exceptionR/tvalueR1(R3tattempttreject((sE/opt/alt/python35/lib/python3.5/site-packages/pip/_vendor/retrying.pyt
should_rejectºs
	cOs[tttjƒdƒƒ}d}x2trVyt|||Ž|tƒ}Wn%tjƒ}t||tƒ}nX|j|ƒs‘|j	|j
ƒStttjƒdƒƒ|}|j||ƒrô|j
rå|jrå|j	ƒ‚qIt
|ƒ‚nU|j||ƒ}	|jr8tjƒ|j}
|	td|
ƒ}	ntj|	dƒ|d7}q%WdS(Nièiig@@(tinttroundttimeRLtAttemptRKtsystexc_infoRQtgetR2R'RMt
RetryErrorR-R#RGRtsleep(R3tfnRRt
start_timetattempt_numberROttbRERZtjitter((sE/opt/alt/python35/lib/python3.5/site-packages/pip/_vendor/retrying.pyRÃs*	 	N(t__name__t
__module__RRKRCR%R&RFR)R*R+R,R0R.RQR(((sE/opt/alt/python35/lib/python3.5/site-packages/pip/_vendor/retrying.pyR8s0F						
						RUcBs,eZdZd„Zed„Zd„ZRS(s¾
    An Attempt encapsulates a call to a target function that may end as a
    normal return value from the function or an Exception depending on what
    occurred during the execution.
    cCs||_||_||_dS(N(RNR]RM(R3RNR]RM((sE/opt/alt/python35/lib/python3.5/site-packages/pip/_vendor/retrying.pyRCès		cCsT|jrI|rt|ƒ‚qPtj|jd|jd|jdƒn|jSdS(sÈ
        Return the return value of this Attempt instance or raise an Exception.
        If wrap_exception is true, this Attempt is wrapped inside of a
        RetryError before being raised.
        iiiN(RMRYRtreraiseRN(R3R?((sE/opt/alt/python35/lib/python3.5/site-packages/pip/_vendor/retrying.pyRXís
	+cCsO|jr5dj|jdjtj|jdƒƒƒSdj|j|jƒSdS(NsAttempts: {0}, Error:
{1}tisAttempts: {0}, Value: {1}(RMtformatR]tjoint	tracebackt	format_tbRN(R3((sE/opt/alt/python35/lib/python3.5/site-packages/pip/_vendor/retrying.pyt__repr__ûs	,(R`Rat__doc__RCRKRXRh(((sE/opt/alt/python35/lib/python3.5/site-packages/pip/_vendor/retrying.pyRUás	RYcBs eZdZd„Zd„ZRS(sU
    A RetryError encapsulates the last Attempt instance right before giving up.
    cCs
||_dS(N(tlast_attempt(R3Rj((sE/opt/alt/python35/lib/python3.5/site-packages/pip/_vendor/retrying.pyRCscCsdj|jƒS(NsRetryError[{0}](RdRj(R3((sE/opt/alt/python35/lib/python3.5/site-packages/pip/_vendor/retrying.pyt__str__
s(R`RaRiRCRk(((sE/opt/alt/python35/lib/python3.5/site-packages/pip/_vendor/retrying.pyRYs	(
RGtpip._vendorRRVRTRfR!RtobjectRRUt	ExceptionRY(((sE/opt/alt/python35/lib/python3.5/site-packages/pip/_vendor/retrying.pyt<module>s	©!
Back to Directory File Manager