File "tasks.cpython-35.opt-2.pyc"

Full Path: /home/attunedd/public_html/byp/izo/con7ext_sym404/rintoar.txt/opt/alt/python35/lib64/python3.5/asyncio/__pycache__/tasks.cpython-35.opt-2.pyc
File size: 14.08 KB
MIME-type: text/x-bytecode.python
Charset: 8 bit



]g
@s=dddddddddd	d
ddg
Zd
dlZd
dlZd
dlZd
dlZd
dlZd
dlZd
dlZddl	m
Z
ddl	mZddl	mZddl	m
Z
ddlmZGddde
jZej
jZej
jZej
jZedddddeddZddZeddddZeddZddddddZedddd dZddd!d"Zeed<de_[ddd#dZed$d%ZGd&d'd'e
jZddd(d)d*d	Z ddd+d
Z!d,dZ"dS)-TaskFIRST_COMPLETEDFIRST_EXCEPTION
ALL_COMPLETEDwaitwait_foras_completedsleepasyncgathershield
ensure_futurerun_coroutine_threadsafeN)compat)
coroutines)events)futures)	coroutinecseZdZejZiZdZedddZ	edddZ
ddfdd	Zej
r{d
dZfdd
ZddddZddddddZddZdfddZddZS)rTNcCs(|dkrtj}|jj|S)N)rget_event_loop_current_tasksget)clsloopr*/opt/alt/python35/lib64/python3.5/tasks.pycurrent_task/szTask.current_taskcs2dkrtjfdd|jDS)Ncs%h|]}|jkr|qSr)_loop).0t)rrr	<setcomp>Cs	z!Task.all_tasks.<locals>.<setcomp>)rr
_all_tasks)rrr)rr	all_tasks;szTask.all_tasksrcsktjd||jr&|jd=||_d|_d|_|jj|j|j	j
j|dS)NrrF)super__init___source_traceback_coro_fut_waiter_must_cancelr	call_soon_step	__class__r!add)selfcoror)r,rrr%Es	
			z
Task.__init__cCsg|jtjkrS|jrSd|ddi}|jrC|j|d<|jj|tjj|dS)Ntaskmessagez%Task was destroyed but it is pending!Zsource_traceback)	_staterZ_PENDING_log_destroy_pendingr&rZcall_exception_handlerFuture__del__)r.contextrrrr5Ts	
zTask.__del__csrtj}|jr"d|d<tj|j}|jdd||jdk	rn|jdd|j|S)NZ
cancellingrrz	coro=<%s>zwait_for=%r)r$
_repr_infor)rZ_format_coroutiner'insertr()r.infor/)r,rrr8_s	
zTask._repr_infolimitcCs
g}y|jj}Wntk
r6|jj}YnX|dk	rxI|dk	r|dk	ru|dkrkP|d8}|j||j}qFW|jnj|jdk	r|jj}xL|dk	r|dk	r|dkrP|d8}|j|j	|j
}qW|S)Nrr)r'cr_frameAttributeErrorgi_frameappendf_backreverse
_exception
__traceback__tb_frametb_next)r.r;Zframesftbrrr	get_stackms0






zTask.get_stackfilecCs]g}t}x|jd|D]}|j}|j}|j}|j}	||krr|j|tj|tj	|||j
}
|j|||	|
fq"W|j}|st
d|d|n7|dk	rt
d|d|nt
d|d|tj|d||dk	rYx3tj|j|D]}
t
|
d|ddq9WdS)Nr;zNo stack for %rrIz)Traceback for %r (most recent call last):z%Stack for %r (most recent call last):end)setrHf_linenof_codeco_filenameco_namer-	linecache
checkcachegetline	f_globalsr?rBprint	traceback
print_listformat_exception_onlyr,)r.r;rIextracted_listZcheckedrFlinenocofilenamenamelineexcrrrprint_stacks0						

	


zTask.print_stackcCsHd|_|jrdS|jdk	r;|jjr;dSd|_dS)NFT)Z_log_tracebackdoner(cancelr))r.rrrrbs		zTask.cancelcs|jr0t|tjs'tj}d|_|j}d|_||jj|j<zy1|dkry|j	d}n|j
|}Wntk
r}z=|jrd|_|jtjn|j
|jWYdd}~Xntjk
r	tjYntk
r:}z|j|WYdd}~Xntk
rn}z|j|WYdd}~XnXt|dd}|dk	ru|j|jk	r|jj|jtdj||q|rJ||kr|jj|jtdj|qrd|_|j|j||_|jrr|jjrrd|_q|jj|jtdj||n|dkr|jj|jn_tj|r|jj|jtdj||n%|jj|jtdj|Wd|jjj|jd}XdS)NF_asyncio_future_blockingz6Task {!r} got Future {!r} attached to a different loopz!Task cannot await on itself: {!r}z;yield was used instead of yield from in task {!r} with {!r}zGyield was used instead of yield from for generator in task {!r} with {}zTask got bad yield: {!r})r)
isinstancerCancelledErrorr'r(r,rrsendthrow
StopIteration
set_exception
set_resultvaluer$rb	Exception
BaseExceptiongetattrr*r+RuntimeErrorformatrcadd_done_callback_wakeupinspectZisgeneratorpop)r.r_r/resultblocking)r,rrr+s~						"
								z
Task._stepcCsWy|jWn2tk
rB}z|j|WYdd}~XnX|jd}dS)N)rurlr+)r.futurer_rrrrr4s 
zTask._wakeup)__name__
__module____qualname__weakrefWeakSetr!rr3classmethodrr"r%rZPY34r5r8rHr`rbr+rrrr)r,rrs 
		/#!Trtimeoutreturn_whenc#stj|stj|r7tdt|j|sItd|tt	t
fkrstdj|dkrtj
fddt|D}t|||EdHS)Nz expect a list of futures, not %sz#Set of coroutines/Futures is empty.zInvalid return_when value: {}cs"h|]}t|dqS)r)r)rrF)rrrr gs	zwait.<locals>.<setcomp>)risfutureriscoroutine	TypeErrortyperx
ValueErrorrrrrprrrL_wait)fsrr~rr)rrrLscGs|js|jddS)N)rarj)waiterargsrrr_release_waiterlsrccs
|dkrtj}|dkr-|EdHS|j}|j|t|}tjt|}t|d|}|j|z|y
|EdHWn/t	j
k
r|j||jYnX|j
r|jS|j||jt	jWd|jXdS)Nr)rr
create_future
call_laterr	functoolspartialrrqrreremove_done_callbackrbraruTimeoutError)futr~rrtimeout_handlecbrrrrqs,	






c#s|jd|dk	r3|j|tt|fdd}x|D]}|j|qaWz
EdHWddk	rjXtt}}xD|D]<}|j||jr|j	|q|j	|qW||fS)Ncsd8dksMtksMtkr||jr||jdk	r|dk	rcjjs|jddS)Nrr)rr	cancelled	exceptionrbrarj)rF)counterrrrrr_on_completions

z_wait.<locals>._on_completion)
rrrlenrqrbrLrrar-)rr~rrrrFrapendingr)rrrrrrs&



rc#sLtj|stj|r7tdt|jdk	rIn	tjfddt	|Dddl
m}|ddfdd}fd	d
tfdd}xD]}|j
qWr#|dk	r#j||x"ttD]}|Vq6WdS)
Nz expect a list of futures, not %scs"h|]}t|dqS)r)r)rrF)rrrr s	zas_completed.<locals>.<setcomp>r)Queuercs9x(D] }|jjdqWjdS)N)r
put_nowaitclear)rF)rratodorr_on_timeouts

z!as_completed.<locals>._on_timeoutcsEs
dSj|j|rAdk	rAjdS)N)removerrb)rF)rarrrrrs

z$as_completed.<locals>._on_completionc3s0jEdH}|dkr&tj|jS)N)rrrru)rF)rarr
_wait_for_ones	z#as_completed.<locals>._wait_for_one)rrrrrrrxrrrLqueuesrrrqrranger)rrr~rrrrF_r)rrarrrrrs 
c
csv|dkrdV|S|dkr-tj}|j}|jj|tj||}z
|EdHSWd|jXdS)Nr)rrrrrrZ_set_result_unless_cancelledrb)delayrurrwhrrrrs
cCs&tjdtddt|d|S)Nz;asyncio.async() function is deprecated, use ensure_future()
stacklevelr7r)warningswarnDeprecationWarningr)coro_or_futurerrrrasync_s	rcCstj|r:|dk	r6||jk	r6td|Stj|r|dkratj}|j|}|j	r|j	d=|St
jrtj
|rtt|d|StddS)Nz$loop argument must agree with Futurerrz:An asyncio.Future, a coroutine or an awaitable is requiredr#)rrrrrrrrZcreate_taskr&rZPY35rsZisawaitabler_wrap_awaitabler)rrr0rrrr+s	
ccs|jEdHS)N)	__await__)Z	awaitablerrrrBsrcs4eZdZddfddZddZS)_GatheringFuturerNcs tjd|||_dS)Nr)r$r%	_children)r.childrenr)r,rrr%Tsz_GatheringFuture.__init__cCs@|jrdSd}x#|jD]}|jr d}q W|S)NFT)rarrb)r.retZchildrrrrbXs
z_GatheringFuture.cancel)rxryrzr%rbrr)r,rrLsrreturn_exceptionsFcs|s;|dkrtj}|jjgSixt|D]}tj|st|d|}|dkr|j}d|_	n9|}|dkr|j}n|j|k	rt
d||<qNWfdd|D}t|t|d|ddgfdd}x3t
|D]%\}}|jtj||qRWS)	NrFz)futures are tied to different event loopscsg|]}|qSrr)rarg)
arg_to_futrr
<listcomp>s	zgather.<locals>.<listcomp>rcsjr&|js"|jdS|jrXtj}sj|dSn>|jdk	r|j}sj|dSn	|j}||<d7krjdS)Nr)	rarrrrerirB_resultrj)irres)	nchildren	nfinishedouterresultsrrr_done_callbacks&


	

zgather.<locals>._done_callback)rrrrjrLrrrrr3rrr	enumeraterqrr)rrZcoros_or_futuresrrrrrr)rrrrrrrr
bs8
	
csZt|d|}|jr"|S|j}|jfdd}|j|S)Nrcs~jr&|js"|jdS|jr?jn;|j}|dk	rgj|nj|jdS)N)rrrbrirjru)innerr_)rrrrs

zshield.<locals>._done_callback)rrarrrq)rrrrr)rrrs	
csStjstdtjjfdd}j|S)NzA coroutine object is requiredcshy tjtdWnAtk
rc}z!jrNj|WYdd}~XnXdS)Nr)rZ
_chain_futurerrlset_running_or_notify_cancelri)r_)r/rwrrrcallbacks 
z*run_coroutine_threadsafe.<locals>.callback)rrr
concurrentrr4Zcall_soon_threadsafe)r/rrr)r/rwrrr
s
)#__all__concurrent.futuresrrrsrQrVrr{rKrrrrrr4rrrrrrrrrrrglobalsrxrrrr
rr
rrrr<module>sN	0--8
	
T5