%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /usr/local/lib/python3.8/asyncio/__pycache__/
Upload File :
Create Path :
Current File : //usr/local/lib/python3.8/asyncio/__pycache__/events.cpython-38.pyc

U

pa4f@s|dZdZddlZddlZddlZddlZddlZddlZddlm	Z	ddlm
Z
GdddZGd	d
d
eZGdddZ
Gd
ddZGdddZGdddeZdaeZGdddejZeZddZddZddZddZddZdd Zd!d"Zd#d$Zd%d&Zd'd(Z d)d*Z!eZ"eZ#eZ$eZ%zdd+l&mZmZmZmZWne'k
rfYnXeZ(eZ)eZ*eZ+dS),z!Event loop and event loop policy.)AbstractEventLoopPolicyAbstractEventLoopAbstractServerHandleTimerHandleget_event_loop_policyset_event_loop_policyget_event_loopset_event_loopnew_event_loopget_child_watcherset_child_watcher_set_running_loopget_running_loop_get_running_loopN)format_helpers)
exceptionsc@sFeZdZdZdZdddZddZdd	Zd
dZdd
Z	ddZ
dS)rz1Object returned by callback registration methods.)	_callback_args
_cancelled_loop_source_traceback_repr__weakref___contextNcCs\|dkrt}||_||_||_||_d|_d|_|jrRt	
td|_
nd|_
dS)NFr)contextvarsZcopy_contextrrrrrr	get_debugr
extract_stacksys	_getframer)selfcallbackargsloopcontextr&*/usr/local/lib/python3.8/asyncio/events.py__init__ s
zHandle.__init__cCsl|jjg}|jr|d|jdk	r:|t|j|j|jrh|jd}|d|dd|d|S)N	cancelledzcreated at r:r)		__class____name__rappendrr_format_callback_sourcerr)r!infoframer&r&r'
_repr_info/s



zHandle._repr_infocCs(|jdk	r|jS|}dd|S)Nz<{}> )rr2formatjoin)r!r0r&r&r'__repr__;s
zHandle.__repr__cCs0|js,d|_|jr t||_d|_d|_dSNT)rrrreprrrrr!r&r&r'cancelAs

z
Handle.cancelcCs|jSN)rr9r&r&r'r)LszHandle.cancelledc
Csz|jj|jf|jWn|ttfk
r4Yndtk
r}zFt|j|j}d|}|||d}|j	rz|j	|d<|j
|W5d}~XYnXd}dS)NzException in callback )message	exceptionhandleZsource_traceback)rrunrr
SystemExitKeyboardInterrupt
BaseExceptionrr/rrcall_exception_handler)r!exccbmsgr%r&r&r'_runOs$

zHandle._run)N)r-
__module____qualname____doc__	__slots__r(r2r6r:r)rGr&r&r&r'rs
rcseZdZdZddgZdfdd	ZfddZd	d
ZddZd
dZ	ddZ
ddZddZddZ
fddZddZZS)rz7Object returned by timed callback registration methods.
_scheduled_whenNcs<|dk	stt|||||jr,|jd=||_d|_dS)Nr*F)AssertionErrorsuperr(rrMrL)r!whenr"r#r$r%r,r&r'r(hszTimerHandle.__init__cs0t}|jrdnd}||d|j|S)Nrzwhen=)rOr2rinsertrM)r!r0posrQr&r'r2ps
zTimerHandle._repr_infocCs
t|jSr;)hashrMr9r&r&r'__hash__vszTimerHandle.__hash__cCs|j|jkSr;rMr!otherr&r&r'__lt__yszTimerHandle.__lt__cCs|j|jkrdS||Sr7rM__eq__rXr&r&r'__le__|szTimerHandle.__le__cCs|j|jkSr;rWrXr&r&r'__gt__szTimerHandle.__gt__cCs|j|jkrdS||Sr7r[rXr&r&r'__ge__szTimerHandle.__ge__cCs>t|tr:|j|jko8|j|jko8|j|jko8|j|jkStSr;)
isinstancerrMrrrNotImplementedrXr&r&r'r\s



zTimerHandle.__eq__cCs||}|tkrtS|Sr;)r\ra)r!rYZequalr&r&r'__ne__s
zTimerHandle.__ne__cs |js|j|tdSr;)rr_timer_handle_cancelledrOr:r9rQr&r'r:szTimerHandle.cancelcCs|jS)zReturn a scheduled callback time.

        The time is an absolute timestamp, using the same time
        reference as loop.time().
        rWr9r&r&r'rPszTimerHandle.when)N)r-rHrIrJrKr(r2rVrZr]r^r_r\rbr:rP
__classcell__r&r&rQr'rcsrc@sPeZdZdZddZddZddZdd	Zd
dZdd
Z	ddZ
ddZdS)rz,Abstract server returned by create_server().cCstdS)z5Stop serving.  This leaves existing connections open.NNotImplementedErrorr9r&r&r'closeszAbstractServer.closecCstdS)z4Get the event loop the Server object is attached to.Nrer9r&r&r'get_loopszAbstractServer.get_loopcCstdS)z3Return True if the server is accepting connections.Nrer9r&r&r'
is_servingszAbstractServer.is_servingcstdS)zStart accepting connections.

        This method is idempotent, so it can be called when
        the server is already being serving.
        Nrer9r&r&r'
start_servingszAbstractServer.start_servingcstdS)zStart accepting connections until the coroutine is cancelled.

        The server is closed when the coroutine is cancelled.
        Nrer9r&r&r'
serve_foreverszAbstractServer.serve_forevercstdS)z*Coroutine to wait until service is closed.Nrer9r&r&r'wait_closedszAbstractServer.wait_closedcs|Sr;r&r9r&r&r'
__aenter__szAbstractServer.__aenter__cs||IdHdSr;)rgrl)r!rDr&r&r'	__aexit__szAbstractServer.__aexit__N)r-rHrIrJrgrhrirjrkrlrmrnr&r&r&r'rsrc@sVeZdZdZddZddZddZdd	Zd
dZdd
Z	ddZ
ddZddZddZ
ddZddZddZddddZd d!Zd"d#Zd$d%Zd&d&d&d&d'd(d)Zdud*d+Zdvdd&d&d&ddddddd,
d-d.Zdwejejdd/ddddd0d1	d2d3Zdxd0d4d5d6Zd7ddd8d9d:Zdyddddd;d<d=Zdzdd/ddd0d>d?d@Zd{d&d&d&dddddAdBdCZ dDdEZ!dFdGZ"e#j$e#j$e#j$dHdIdJZ%e#j$e#j$e#j$dHdKdLZ&dMdNZ'dOdPZ(dQdRZ)dSdTZ*dUdVZ+dWdXZ,dYdZZ-d[d\Z.d]d^Z/d|dd4d_d`Z0dadbZ1dcddZ2dedfZ3dgdhZ4didjZ5dkdlZ6dmdnZ7dodpZ8dqdrZ9dsdtZ:dS)}rzAbstract event loop.cCstdS)z*Run the event loop until stop() is called.Nrer9r&r&r'run_foreverszAbstractEventLoop.run_forevercCstdS)zpRun the event loop until a Future is done.

        Return the Future's result, or raise its exception.
        Nre)r!futurer&r&r'run_until_completesz$AbstractEventLoop.run_until_completecCstdS)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.
        Nrer9r&r&r'stopszAbstractEventLoop.stopcCstdS)z3Return whether the event loop is currently running.Nrer9r&r&r'
is_runningszAbstractEventLoop.is_runningcCstdS)z*Returns True if the event loop was closed.Nrer9r&r&r'	is_closedszAbstractEventLoop.is_closedcCstdS)zClose the loop.

        The loop should not be running.

        This is idempotent and irreversible.

        No other methods should be called after this one.
        Nrer9r&r&r'rgs	zAbstractEventLoop.closecstdS)z,Shutdown all active asynchronous generators.Nrer9r&r&r'shutdown_asyncgenssz$AbstractEventLoop.shutdown_asyncgenscCstdS)z3Notification that a TimerHandle has been cancelled.Nre)r!r>r&r&r'rcsz)AbstractEventLoop._timer_handle_cancelledcGs|jd|f|S)Nr)
call_laterr!r"r#r&r&r'	call_soonszAbstractEventLoop.call_sooncGstdSr;re)r!delayr"r#r&r&r'rvszAbstractEventLoop.call_latercGstdSr;re)r!rPr"r#r&r&r'call_atszAbstractEventLoop.call_atcCstdSr;rer9r&r&r'timeszAbstractEventLoop.timecCstdSr;rer9r&r&r'
create_futureszAbstractEventLoop.create_futureN)namecCstdSr;re)r!coror}r&r&r'create_taskszAbstractEventLoop.create_taskcGstdSr;rerwr&r&r'call_soon_threadsafesz&AbstractEventLoop.call_soon_threadsafecGstdSr;re)r!executorfuncr#r&r&r'run_in_executorsz!AbstractEventLoop.run_in_executorcCstdSr;re)r!rr&r&r'set_default_executorsz&AbstractEventLoop.set_default_executorr)familytypeprotoflagscstdSr;re)r!hostportrrrrr&r&r'getaddrinfo#szAbstractEventLoop.getaddrinfocstdSr;re)r!Zsockaddrrr&r&r'getnameinfo'szAbstractEventLoop.getnameinfo)
sslrrrsock
local_addrserver_hostnamessl_handshake_timeouthappy_eyeballs_delay
interleavec
stdSr;re)r!protocol_factoryrrrrrrrrrrrrr&r&r'create_connection*sz#AbstractEventLoop.create_connectiondT)	rrrbacklogr
reuse_address
reuse_portrrjc	
stdS)adA 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.

        ssl_handshake_timeout is the time in seconds that an SSL server
        will wait for completion of the SSL handshake before aborting the
        connection. Default is 60s.

        start_serving set to True (default) causes the created server
        to start accepting connections immediately.  When set to False,
        the user should await Server.start_serving() or Server.serve_forever()
        to make the server to start accepting connections.
        Nre)
r!rrrrrrrrrrrrjr&r&r'
create_server3s3zAbstractEventLoop.create_server)fallbackcstdS)zRSend a file through a transport.

        Return an amount of sent bytes.
        Nre)r!	transportfileoffsetcountrr&r&r'sendfilehszAbstractEventLoop.sendfileF)server_siderrcstdS)z|Upgrade a transport to TLS.

        Return a new transport that *protocol* should start using
        immediately.
        Nre)r!rprotocolZ
sslcontextrrrr&r&r'	start_tlsps	zAbstractEventLoop.start_tls)rrrrcstdSr;re)r!rpathrrrrr&r&r'create_unix_connection{sz(AbstractEventLoop.create_unix_connection)rrrrrjcstdS)aA 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.

        ssl_handshake_timeout is the time in seconds that an SSL server
        will wait for the SSL handshake to complete (defaults to 60s).

        start_serving set to True (default) causes the created server
        to start accepting connections immediately.  When set to False,
        the user should await Server.start_serving() or Server.serve_forever()
        to make the server to start accepting connections.
        Nre)r!rrrrrrrjr&r&r'create_unix_serversz$AbstractEventLoop.create_unix_server)rrrrrallow_broadcastrcstdS)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, socket.AF_INET6 or socket.AF_UNIX 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.
        Nre)r!rrZremote_addrrrrrrrrr&r&r'create_datagram_endpoints!z*AbstractEventLoop.create_datagram_endpointcstdS)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.Nrer!rpiper&r&r'connect_read_pipesz#AbstractEventLoop.connect_read_pipecstdS)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.Nrerr&r&r'connect_write_pipesz$AbstractEventLoop.connect_write_pipe)stdinstdoutstderrcstdSr;re)r!rcmdrrrkwargsr&r&r'subprocess_shellsz"AbstractEventLoop.subprocess_shellcstdSr;re)r!rrrrr#rr&r&r'subprocess_execsz!AbstractEventLoop.subprocess_execcGstdSr;rer!fdr"r#r&r&r'
add_readerszAbstractEventLoop.add_readercCstdSr;rer!rr&r&r'
remove_readerszAbstractEventLoop.remove_readercGstdSr;rerr&r&r'
add_writerszAbstractEventLoop.add_writercCstdSr;rerr&r&r'
remove_writerszAbstractEventLoop.remove_writercstdSr;re)r!rnbytesr&r&r'	sock_recvszAbstractEventLoop.sock_recvcstdSr;re)r!rbufr&r&r'sock_recv_intosz AbstractEventLoop.sock_recv_intocstdSr;re)r!rdatar&r&r'sock_sendallszAbstractEventLoop.sock_sendallcstdSr;re)r!raddressr&r&r'sock_connectszAbstractEventLoop.sock_connectcstdSr;re)r!rr&r&r'sock_acceptszAbstractEventLoop.sock_acceptcstdSr;re)r!rrrrrr&r&r'
sock_sendfileszAbstractEventLoop.sock_sendfilecGstdSr;re)r!sigr"r#r&r&r'add_signal_handlersz$AbstractEventLoop.add_signal_handlercCstdSr;re)r!rr&r&r'remove_signal_handlersz'AbstractEventLoop.remove_signal_handlercCstdSr;re)r!factoryr&r&r'set_task_factorysz"AbstractEventLoop.set_task_factorycCstdSr;rer9r&r&r'get_task_factory"sz"AbstractEventLoop.get_task_factorycCstdSr;rer9r&r&r'get_exception_handler'sz'AbstractEventLoop.get_exception_handlercCstdSr;re)r!handlerr&r&r'set_exception_handler*sz'AbstractEventLoop.set_exception_handlercCstdSr;rer!r%r&r&r'default_exception_handler-sz+AbstractEventLoop.default_exception_handlercCstdSr;rerr&r&r'rC0sz(AbstractEventLoop.call_exception_handlercCstdSr;rer9r&r&r'r5szAbstractEventLoop.get_debugcCstdSr;re)r!Zenabledr&r&r'	set_debug8szAbstractEventLoop.set_debug)r)NN)NN)rN)N)N)NN)rN);r-rHrIrJrorqrrrsrtrgrurcrxrvrzr{r|rrrrrrrsocket	AF_UNSPEC
AI_PASSIVErrrrrrrr
subprocessPIPErrrrrrrrrrrrrrrrrrrrCrrr&r&r&r'rs

5	!%
rc@s8eZdZdZddZddZddZdd	Zd
dZdS)
rz-Abstract policy for accessing the event loop.cCstdS)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.Nrer9r&r&r'r?sz&AbstractEventLoopPolicy.get_event_loopcCstdS)z3Set the event loop for the current context to loop.Nrer!r$r&r&r'r	Isz&AbstractEventLoopPolicy.set_event_loopcCstdS)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.Nrer9r&r&r'r
Msz&AbstractEventLoopPolicy.new_event_loopcCstdS)z$Get the watcher for child processes.Nrer9r&r&r'rUsz)AbstractEventLoopPolicy.get_child_watchercCstdS)z$Set the watcher for child processes.Nre)r!watcherr&r&r'rYsz)AbstractEventLoopPolicy.set_child_watcherN)	r-rHrIrJrr	r
rrr&r&r&r'r<s
rc@sFeZdZdZdZGdddejZddZddZ	d	d
Z
ddZdS)
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)r-rHrIr_set_calledr&r&r&r'_LocalmsrcCs||_dSr;)r_localr9r&r&r'r(qsz#BaseDefaultEventLoopPolicy.__init__cCsX|jjdkr2|jjs2tttjr2|||jjdkrPt	dtj
|jjS)zvGet the event loop for the current context.

        Returns an instance of EventLoop or raises an exception.
        Nz,There is no current event loop in thread %r.)rrrr`	threadingcurrent_thread_MainThreadr	r
RuntimeErrorr}r9r&r&r'rtsz)BaseDefaultEventLoopPolicy.get_event_loopcCs*d|j_|dkst|tst||j_dS)zSet the event loop.TN)rrr`rrNrrr&r&r'r	sz)BaseDefaultEventLoopPolicy.set_event_loopcCs|S)zvCreate a new event loop.

        You must call set_event_loop() to make this the current event
        loop.
        )
_loop_factoryr9r&r&r'r
sz)BaseDefaultEventLoopPolicy.new_event_loop)r-rHrIrJrrlocalrr(rr	r
r&r&r&r'r^src@seZdZdZdS)_RunningLoop)NNN)r-rHrIloop_pidr&r&r&r'rsrcCst}|dkrtd|S)zrReturn the running event loop.  Raise a RuntimeError if there is none.

    This function is thread-specific.
    Nzno running event loop)rrr$r&r&r'rsrcCs&tj\}}|dk	r"|tkr"|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_looprosgetpid)Zrunning_looppidr&r&r'rs
rcCs|tft_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)rrrrrr&r&r'r
sr
c	Cs.t tdkr ddlm}|aW5QRXdS)NrDefaultEventLoopPolicy)_lock_event_loop_policyrrr&r&r'_init_event_loop_policysrcCstdkrttS)z"Get the current event loop policy.N)rrr&r&r&r'rsrcCs|dkst|tst|adS)zZSet the current event loop policy.

    If policy is None, the default policy is restored.N)r`rrNr)Zpolicyr&r&r'rsrcCst}|dk	r|StS)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_loopr&r&r'rs
rcCst|dS)zCEquivalent to calling get_event_loop_policy().set_event_loop(loop).N)rr	rr&r&r'r	sr	cCs
tS)z?Equivalent to calling get_event_loop_policy().new_event_loop().)rr
r&r&r&r'r
sr
cCs
tS)zBEquivalent to calling get_event_loop_policy().get_child_watcher().)rrr&r&r&r'rsrcCst|S)zMEquivalent to calling
    get_event_loop_policy().set_child_watcher(watcher).)rr)rr&r&r'rsr)rr
rr),rJ__all__rrrrrrrrrrrrrrrrLockrrrrrrr
rrrrr	r
rrZ_py__get_running_loopZ_py__set_running_loopZ_py_get_running_loopZ_py_get_event_loopZ_asyncioImportErrorZ_c__get_running_loopZ_c__set_running_loopZ_c_get_running_loopZ_c_get_event_loopr&r&r&r'<module>sXJ@*q"9
	

Zerion Mini Shell 1.0