PNG  IHDR;IDATxܻn0K )(pA 7LeG{ §㻢|ذaÆ 6lذaÆ 6lذaÆ 6lom$^yذag5bÆ 6lذaÆ 6lذa{ 6lذaÆ `}HFkm,mӪôô! x|'ܢ˟;E:9&ᶒ}{v]n&6 h_tڠ͵-ҫZ;Z$.Pkž)!o>}leQfJTu іچ\X=8Rن4`Vwl>nG^is"ms$ui?wbs[m6K4O.4%/bC%t Mז -lG6mrz2s%9s@-k9=)kB5\+͂Zsٲ Rn~GRC wIcIn7jJhۛNCS|j08yiHKֶۛkɈ+;SzL/F*\Ԕ#"5m2[S=gnaPeғL lذaÆ 6l^ḵaÆ 6lذaÆ 6lذa; _ذaÆ 6lذaÆ 6lذaÆ RIENDB`  oYTY@s dZddddddddd d d d d dgZddlZddlZddlZddlZddlZddlZddlZddl Z ddl Z ddl m Z ddZ ddZdddZddZGdddZGdddeZGdddZGdddZGdddZGd d!d!eZdae jZGd"d#d#e jZeZd$dZd%d Zd&d'Zd(dZ d)dZ!d*dZ"d+d Z#d,d Z$d-d Z%d.d Z&dS)/z!Event loop and event loop policy.AbstractEventLoopPolicyAbstractEventLoopAbstractServerHandle TimerHandleget_event_loop_policyset_event_loop_policyget_event_loopset_event_loopnew_event_loopget_child_watcherset_child_watcher_set_running_loop_get_running_loopN)compatcCstjrtj|}nt|dr3|j}tj|r[|j}|j|j fSt |t j rzt |jStjrt |t jrt |jSdS)N __wrapped__)rZPY34inspectZunwraphasattrrZ isfunction__code__ co_filenameco_firstlineno isinstance functoolspartial_get_function_sourcefunc partialmethod)rcoder%/opt/python35/lib/python3.5/events.pyrs     rcCsag}|r&|jdd|D|rL|jdd|jDddj|dS)zFormat function arguments and keyword arguments. Special case for a single parameter: ('hello',) is formatted as ('hello'). css|]}tj|VqdS)N)reprlibrepr).0argrrr 0sz*_format_args_and_kwargs..css0|]&\}}dj|tj|VqdS)z{}={}N)formatr r!)r"kvrrrr$2s(z, ))extenditemsjoin)argskwargsr+rrr_format_args_and_kwargs(sr/cCst|tjrAt|||}t|j|j|j|St|drbt |d}n-t|drt |d}n t |}|t||7}|r||7}|S)N __qualname____name__) rrrr/_format_callbackrr-keywordsrgetattrr!)rr-r.suffix func_reprrrrr37s  r3cCs6t||d}t|}|r2|d|7}|S)Nz at %s:%s)r3r)rr-r7sourcerrr_format_callback_sourceHs  r9c@sXeZdZdZdZd d Zd d Zd dZddZddZ dS)rz1Object returned by callback registration methods. _callback_args _cancelled_loop_source_traceback_repr __weakref__cCsg||_||_||_d|_d|_|jjrZtjtj d|_ n d|_ dS)NF) r=r:r;r<r? get_debug traceback extract_stacksys _getframer>)selfcallbackr-looprrr__init__Vs     zHandle.__init__cCs|jjg}|jr%|jd|jdk rP|jt|j|j|jr|jd}|jd|d|df|S)N cancelledrAzcreated at %s:%sr) __class__r2r<appendr:r9r;r>)rGinfoframerrr _repr_infoas    zHandle._repr_infocCs3|jdk r|jS|j}ddj|S)Nz<%s> )r?rQr,)rGrOrrr__repr__ls zHandle.__repr__cCsF|jsBd|_|jjr0t||_d|_d|_dS)NT)r<r=rBr!r?r:r;)rGrrrcancelrs    z Handle.cancelcCsy|j|jWntk r}zgt|j|j}dj|}d|d|d|i}|jr{|j|d<|jj|WYdd}~XnXd}dS)NzException in callback {}message exceptionhandleZsource_traceback)r:r; Exceptionr9r%r>r=call_exception_handler)rGexccbmsgcontextrrr_run}s   #z Handle._runN)r:r;r<r=r>r?r@) r2 __module__r1__doc__ __slots__rJrQrSrTr^rrrrrPs   cseZdZdZddgZfddZfddZdd Zd d Zd d Z ddZ ddZ ddZ ddZ fddZS)rz7Object returned by timed callback registration methods. _scheduled_whencsQ|dk sttj||||jr;|jd=||_d|_dS)NrAFrL)AssertionErrorsuperrJr>rcrb)rGwhenrHr-rI)rMrrrJs    zTimerHandle.__init__cs?tj}|jrdnd}|j|d|j|S)NrAzwhen=%s)rerQr<insertrc)rGrOpos)rMrrrQszTimerHandle._repr_infocCs t|jS)N)hashrc)rGrrr__hash__szTimerHandle.__hash__cCs|j|jkS)N)rc)rGotherrrr__lt__szTimerHandle.__lt__cCs#|j|jkrdS|j|S)NT)rc__eq__)rGrlrrr__le__szTimerHandle.__le__cCs|j|jkS)N)rc)rGrlrrr__gt__szTimerHandle.__gt__cCs#|j|jkrdS|j|S)NT)rcrn)rGrlrrr__ge__szTimerHandle.__ge__cCsYt|trU|j|jkoT|j|jkoT|j|jkoT|j|jkStS)N)rrrcr:r;r<NotImplemented)rGrlrrrrns zTimerHandle.__eq__cCs$|j|}|tkrtS| S)N)rnrr)rGrlZequalrrr__ne__szTimerHandle.__ne__cs*|js|jj|tjdS)N)r<r=_timer_handle_cancelledrerT)rG)rMrrrTs zTimerHandle.cancel)r2r_r1r`rarJrQrkrmrorprqrnrsrTrr)rMrrs         c@s.eZdZdZddZddZdS)rz,Abstract server returned by create_server().cCstS)z5Stop serving. This leaves existing connections open.)rr)rGrrrcloseszAbstractServer.closecCstS)z*Coroutine to wait until service is closed.)rr)rGrrr wait_closedszAbstractServer.wait_closedN)r2r_r1r`rurvrrrrrs  c@sIeZdZdZddZddZddZdd Zd d Zd d Z ddZ ddZ ddZ ddZ ddZddZddZddZddZd d!Zd"d#Zd$d%d&d%d'd%d(d%d)d*Zd%d+d,Zd-d-d.d-d$d%d'd%d(d%d/d-d0d-d1d-d2d3Zd-d-d$ejd(ejd/d-d4d5d.d-d6d-d7d-d8d9Zd.d-d/d-d1d-d:d;Zd/d-d4d5d.d-d<d=Zd-d-d$d%d'd%d(d%d6d-d7d-d>d-d/d-d?d@ZdAdBZdCdDZ dEe!j"dFe!j"dGe!j"dHdIZ#dEe!j"dFe!j"dGe!j"dJdKZ$dLdMZ%dNdOZ&dPdQZ'dRdSZ(dTdUZ)dVdWZ*dXdYZ+dZd[Z,d\d]Z-d^d_Z.d`daZ/dbdcZ0dddeZ1dfdgZ2dhdiZ3djdkZ4dldmZ5dndoZ6d-S)przAbstract event loop.cCs tdS)z*Run the event loop until stop() is called.N)NotImplementedError)rGrrr run_foreverszAbstractEventLoop.run_forevercCs tdS)zpRun the event loop until a Future is done. Return the Future's result, or raise its exception. N)rw)rGfuturerrrrun_until_completesz$AbstractEventLoop.run_until_completecCs tdS)zStop the event loop as soon as reasonable. Exactly how soon that is may depend on the implementation, but no more I/O callbacks should be scheduled. N)rw)rGrrrstopszAbstractEventLoop.stopcCs tdS)z3Return whether the event loop is currently running.N)rw)rGrrr is_runningszAbstractEventLoop.is_runningcCs tdS)z*Returns True if the event loop was closed.N)rw)rGrrr is_closedszAbstractEventLoop.is_closedcCs tdS)zClose the loop. The loop should not be running. This is idempotent and irreversible. No other methods should be called after this one. N)rw)rGrrrrus zAbstractEventLoop.closecCs tdS)z,Shutdown all active asynchronous generators.N)rw)rGrrrshutdown_asyncgenssz$AbstractEventLoop.shutdown_asyncgenscCs tdS)z3Notification that a TimerHandle has been cancelled.N)rw)rGrWrrrrtsz)AbstractEventLoop._timer_handle_cancelledcGs|jd||S)Nr) call_later)rGrHr-rrr call_soonszAbstractEventLoop.call_sooncGs tdS)N)rw)rGdelayrHr-rrrr szAbstractEventLoop.call_latercGs tdS)N)rw)rGrfrHr-rrrcall_at szAbstractEventLoop.call_atcCs tdS)N)rw)rGrrrtimeszAbstractEventLoop.timecCs tdS)N)rw)rGrrr create_futureszAbstractEventLoop.create_futurecCs tdS)N)rw)rGcororrr create_taskszAbstractEventLoop.create_taskcGs tdS)N)rw)rGrHr-rrrcall_soon_threadsafesz&AbstractEventLoop.call_soon_threadsafecGs tdS)N)rw)rGexecutorrr-rrrrun_in_executor sz!AbstractEventLoop.run_in_executorcCs tdS)N)rw)rGrrrrset_default_executor#sz&AbstractEventLoop.set_default_executorfamilyrtypeprotoflagscCs tdS)N)rw)rGhostportrrrrrrr getaddrinfo(szAbstractEventLoop.getaddrinfocCs tdS)N)rw)rGZsockaddrrrrr getnameinfo+szAbstractEventLoop.getnameinfoNsslsock local_addrserver_hostnamec Cs tdS)N)rw) rGprotocol_factoryrrrrrrrrrrrrcreate_connection.sz#AbstractEventLoop.create_connectionbacklogd reuse_address reuse_portc Cs tdS)aA coroutine which creates a TCP server bound to host and port. The return value is a Server object which can be used to stop the service. If host is an empty string or None all interfaces are assumed and a list of multiple sockets will be returned (most likely one for IPv4 and another one for IPv6). The host parameter can also be a sequence (e.g. list) of hosts to bind to. family can be set to either AF_INET or AF_INET6 to force the socket to use IPv4 or IPv6. If not set it will be determined from host (defaults to AF_UNSPEC). flags is a bitmask for getaddrinfo(). sock can optionally be specified in order to use a preexisting socket object. backlog is the maximum number of queued connections passed to listen() (defaults to 100). ssl can be set to an SSLContext to enable SSL over the accepted connections. reuse_address tells the kernel to reuse a local socket in TIME_WAIT state, without waiting for its natural timeout to expire. If not specified will automatically be set to True on UNIX. reuse_port tells the kernel to allow this endpoint to be bound to the same port as other existing endpoints are bound to, so long as they all set this flag when being created. This option is not supported on Windows. N)rw) rGrrrrrrrrrrrrr create_server3s'zAbstractEventLoop.create_servercCs tdS)N)rw)rGrpathrrrrrrcreate_unix_connection\sz(AbstractEventLoop.create_unix_connectioncCs tdS)a#A coroutine which creates a UNIX Domain Socket server. The return value is a Server object, which can be used to stop the service. path is a str, representing a file systsem path to bind the server socket to. sock can optionally be specified in order to use a preexisting socket object. backlog is the maximum number of queued connections passed to listen() (defaults to 100). ssl can be set to an SSLContext to enable SSL over the accepted connections. N)rw)rGrrrrrrrrcreate_unix_serverasz$AbstractEventLoop.create_unix_serverallow_broadcastc Cs tdS)aA coroutine which creates a datagram endpoint. This method will try to establish the endpoint in the background. When successful, the coroutine returns a (transport, protocol) pair. protocol_factory must be a callable returning a protocol instance. socket family AF_INET or socket.AF_INET6 depending on host (or family if specified), socket type SOCK_DGRAM. reuse_address tells the kernel to reuse a local socket in TIME_WAIT state, without waiting for its natural timeout to expire. If not specified it will automatically be set to True on UNIX. reuse_port tells the kernel to allow this endpoint to be bound to the same port as other existing endpoints are bound to, so long as they all set this flag when being created. This option is not supported on Windows and some UNIX's. If the :py:data:`~socket.SO_REUSEPORT` constant is not defined then this capability is unsupported. allow_broadcast tells the kernel to allow this endpoint to send messages to the broadcast address. sock can optionally be specified in order to use a preexisting socket object. N)rw) rGrrZ remote_addrrrrrrrrrrrcreate_datagram_endpointvs!z*AbstractEventLoop.create_datagram_endpointcCs tdS)aRegister read pipe in event loop. Set the pipe to non-blocking mode. protocol_factory should instantiate object with Protocol interface. pipe is a file-like object. Return pair (transport, protocol), where transport supports the ReadTransport interface.N)rw)rGrpiperrrconnect_read_pipes z#AbstractEventLoop.connect_read_pipecCs tdS)aRegister write pipe in event loop. protocol_factory should instantiate object with BaseProtocol interface. Pipe is file-like object already switched to nonblocking. Return pair (transport, protocol), where transport support WriteTransport interface.N)rw)rGrrrrrconnect_write_pipes z$AbstractEventLoop.connect_write_pipestdinstdoutstderrcKs tdS)N)rw)rGrcmdrrrr.rrrsubprocess_shellsz"AbstractEventLoop.subprocess_shellcOs tdS)N)rw)rGrrrrr-r.rrrsubprocess_execsz!AbstractEventLoop.subprocess_execcGs tdS)N)rw)rGfdrHr-rrr add_readerszAbstractEventLoop.add_readercCs tdS)N)rw)rGrrrr remove_readerszAbstractEventLoop.remove_readercGs tdS)N)rw)rGrrHr-rrr add_writerszAbstractEventLoop.add_writercCs tdS)N)rw)rGrrrr remove_writerszAbstractEventLoop.remove_writercCs tdS)N)rw)rGrnbytesrrr sock_recvszAbstractEventLoop.sock_recvcCs tdS)N)rw)rGrdatarrr sock_sendallszAbstractEventLoop.sock_sendallcCs tdS)N)rw)rGraddressrrr sock_connectszAbstractEventLoop.sock_connectcCs tdS)N)rw)rGrrrr sock_acceptszAbstractEventLoop.sock_acceptcGs tdS)N)rw)rGsigrHr-rrradd_signal_handlersz$AbstractEventLoop.add_signal_handlercCs tdS)N)rw)rGrrrrremove_signal_handlersz'AbstractEventLoop.remove_signal_handlercCs tdS)N)rw)rGfactoryrrrset_task_factorysz"AbstractEventLoop.set_task_factorycCs tdS)N)rw)rGrrrget_task_factorysz"AbstractEventLoop.get_task_factorycCs tdS)N)rw)rGrrrget_exception_handlersz'AbstractEventLoop.get_exception_handlercCs tdS)N)rw)rGhandlerrrrset_exception_handlersz'AbstractEventLoop.set_exception_handlercCs tdS)N)rw)rGr]rrrdefault_exception_handlersz+AbstractEventLoop.default_exception_handlercCs tdS)N)rw)rGr]rrrrYsz(AbstractEventLoop.call_exception_handlercCs tdS)N)rw)rGrrrrBszAbstractEventLoop.get_debugcCs tdS)N)rw)rGZenabledrrr set_debugszAbstractEventLoop.set_debug)7r2r_r1r`rxrzr{r|r}rur~rtrrrrrrrrrrrrsocket AF_UNSPEC AI_PASSIVErrrrrr subprocessPIPErrrrrrrrrrrrrrrrrrYrBrrrrrrsx                 $  &   !                   c@sReZdZdZddZddZddZdd Zd d Zd S) rz-Abstract policy for accessing the event loop.cCs tdS)a:Get the event loop for the current context. Returns an event loop object implementing the BaseEventLoop interface, or raises an exception in case no event loop has been set for the current context and the current policy does not specify to create one. It should never return None.N)rw)rGrrrrsz&AbstractEventLoopPolicy.get_event_loopcCs tdS)z3Set the event loop for the current context to loop.N)rw)rGrIrrrr sz&AbstractEventLoopPolicy.set_event_loopcCs tdS)zCreate and return a new event loop object according to this policy's rules. If there's need to set this loop as the event loop for the current context, set_event_loop must be called explicitly.N)rw)rGrrrr sz&AbstractEventLoopPolicy.new_event_loopcCs tdS)z$Get the watcher for child processes.N)rw)rGrrrr sz)AbstractEventLoopPolicy.get_child_watchercCs tdS)z$Set the watcher for child processes.N)rw)rGwatcherrrrr "sz)AbstractEventLoopPolicy.set_child_watcherN) r2r_r1r`rr r r r rrrrrs    c@seeZdZdZdZGdddejZddZddZ d d Z d d Z dS) BaseDefaultEventLoopPolicyaDefault policy implementation for accessing the event loop. In this policy, each thread has its own event loop. However, we only automatically create an event loop by default for the main thread; other threads by default have no event loop. Other policies may have different rules (e.g. a single global event loop, or automatically creating an event loop per thread, or using some other notion of context to which an event loop is associated). Nc@seZdZdZdZdS)z!BaseDefaultEventLoopPolicy._LocalNF)r2r_r1r= _set_calledrrrr_Local6s rcCs|j|_dS)N)r_local)rGrrrrJ:sz#BaseDefaultEventLoopPolicy.__init__cCs|jjdkrJ|jj rJttjtjrJ|j|j|jjdkrut dtjj |jjS)zSGet the event loop. This may be None or an instance of EventLoop. Nz,There is no current event loop in thread %r.) rr=rr threadingcurrent_thread _MainThreadr r RuntimeErrorname)rGrrrr=s z)BaseDefaultEventLoopPolicy.get_event_loopcCs=d|j_|dks-t|ts-t||j_dS)zSet the event loop.TN)rrrrrdr=)rGrIrrrr Ks !z)BaseDefaultEventLoopPolicy.set_event_loopcCs |jS)zvCreate a new event loop. You must call set_event_loop() to make this the current event loop. ) _loop_factory)rGrrrr Qsz)BaseDefaultEventLoopPolicy.new_event_loop) r2r_r1r`rrlocalrrJrr r rrrrr's    rc@seZdZdZdZdS) _RunningLoopN)r2r_r1r=_pidrrrrres rcCs2tj}|dk r.tjtjkr.|SdS)zReturn the running event loop or None. This is a low-level function intended to be used by event loops. This function is thread-specific. N) _running_loopr=rosgetpid)Z running_looprrrrms !cCstjt_|t_dS)zSet the running event loop. This is a low-level function intended to be used by event loops. This function is thread-specific. N)rrrrr=)rIrrrr xsc Cs7t*tdkr,ddlm}|aWdQRXdS)NrA)DefaultEventLoopPolicy)_lock_event_loop_policyr0r)rrrr_init_event_loop_policys rcCstdkrttS)z"Get the current event loop policy.N)rrrrrrrs cCs+|dks!t|ts!t|adS)zZSet the current event loop policy. If policy is None, the default policy is restored.N)rrrdr)Zpolicyrrrrs!cCs&t}|dk r|StjS)aGReturn an asyncio event loop. When called from a coroutine or a callback (e.g. scheduled with call_soon or similar API), this function will always return the running event loop. If there is no running event loop set, the function will return the result of `get_event_loop_policy().get_event_loop()` call. N)rrr)Z current_looprrrrs  cCstj|dS)zCEquivalent to calling get_event_loop_policy().set_event_loop(loop).N)rr )rIrrrr scCs tjS)z?Equivalent to calling get_event_loop_policy().new_event_loop().)rr rrrrr scCs tjS)zBEquivalent to calling get_event_loop_policy().get_child_watcher().)rr rrrrr scCstj|S)zMEquivalent to calling get_event_loop_policy().set_child_watcher(watcher).)rr )rrrrr s)'r`__all__rrrr rrrErrCZasynciorrr/r3r9rrrrrrrLockrrrrrr rrrrr r r r rrrrsT              >8 4"7