File "events.cpython-34.pyc"

Full Path: /home/attunedd/public_html/byp/izo/con7ext_sym404/rintoar.txt/opt/alt/python34/lib64/python3.4/asyncio/__pycache__/events.cpython-34.pyc
File size: 23.62 KB
MIME-type: text/x-bytecode.python
Charset: 8 bit


j fyS@sdZddddddddd	d
ddgZd
dlZd
dlZd
dlZd
dlZd
dlZd
dlZd
dlZd
dl	Z	d
dl
mZddZddZ
dddZddZGdddZGdddeZGdddZGdddZGdddZGdddeZdaejZd d!Zd"dZd#dZd$dZd%d	Zd&d
Zd'dZd(dZ dS))z!Event loop and event loop policy.AbstractEventLoopPolicyAbstractEventLoopAbstractServerHandleTimerHandleget_event_loop_policyset_event_loop_policyget_event_loopset_event_loopnew_event_loopget_child_watcherset_child_watcherN)compatcCstjrtj|}nt|dr6|j}ntj|r^|j}|j|j	fSt
|tjr}t
|jStjrt
|tjrt
|jSdS)N__wrapped__)rZPY34inspectZunwraphasattrrZ
isfunction__code__co_filenameco_firstlineno
isinstance	functoolspartial_get_function_sourcefunc
partialmethod)rcoder3/opt/alt/python34/lib64/python3.4/asyncio/events.pyrs		

rcCsKtj|}t|dkrG|jdrG|ddd}n|S)zoFormat function arguments.

    Special case for a single parameter: ('hello',) is formatted as ('hello').
    z,)N))reprlibreprlenendswith)argsZ	args_reprrrr_format_args&s!r'cCst|tjrG|dk	r1t||}nt|j|j|St|drht|d}n-t|drt|d}nt	|}|dk	r|t|7}n|r||7}n|S)N__qualname____name__)
rrrr'_format_callbackrr&rgetattrr#)rr&suffix	func_reprrrrr+2s
r+cCs6t||}t|}|r2|d|7}n|S)Nz	 at %s:%s)r+r)rr&r.sourcerrr_format_callback_sourceEs
r0c@sXeZdZdZdZd	d
ZddZd
dZddZddZ	dS)rz1Object returned by callback registration methods.	_callback_args
_cancelled_loop_source_traceback_repr__weakref__cCst|tstd||_||_||_d|_d|_|jjrvt	j
tjd|_
n	d|_
dS)NzA Handle is not a callbackFr)rrAssertionErrorr4r1r2r3r6	get_debug	traceback
extract_stacksys	_getframer5)selfcallbackr&looprrr__init__Ss					zHandle.__init__cCs|jjg}|jr(|jdn|jdk	rV|jt|j|jn|jr|jd}|jd|d|dfn|S)NZ	cancelledrzcreated at %s:%sr
)	__class__r*r3appendr1r0r2r5)r>infoZframerrr
_repr_info_s		
"zHandle._repr_infocCs3|jdk	r|jS|j}ddj|S)Nz<%s> )r6rFjoin)r>rErrr__repr__jszHandle.__repr__cCsL|jsHd|_|jjr3t||_nd|_d|_ndS)NT)r3r4r9r#r6r1r2)r>rrrcancelps			z
Handle.cancelcCsy|j|jWntk
r}zmt|j|j}dj|}i|d6|d6|d6}|jr|j|d<n|jj|WYdd}~XnXd}dS)NzException in callback {}messageZ	exceptionhandleZsource_traceback)r1r2	Exceptionr0formatr5r4call_exception_handler)r>exccbmsgcontextrrr_run{s
	#zHandle._runN)z	_callbackz_argsz
_cancelledz_loopz_source_tracebackz_reprz__weakref__)
r*
__module__r)__doc__	__slots__rArFrIrJrTrrrrrMscseZdZdZddgZfddZfddZdd	Zd
dZdd
Z	ddZ
ddZddZddZ
fddZS)rz7Object returned by timed callback registration methods.
_scheduled_whencsT|dk	sttj||||jr>|jd=n||_d|_dS)NrFrB)r8superrAr5rYrX)r>whenr?r&r@)rCrrrAs	
	zTimerHandle.__init__cs?tj}|jrdnd}|j|d|j|S)Nrrzwhen=%s)rZrFr3insertrY)r>rEpos)rCrrrFszTimerHandle._repr_infocCs
t|jS)N)hashrY)r>rrr__hash__szTimerHandle.__hash__cCs|j|jkS)N)rY)r>otherrrr__lt__szTimerHandle.__lt__cCs#|j|jkrdS|j|S)NT)rY__eq__)r>r`rrr__le__szTimerHandle.__le__cCs|j|jkS)N)rY)r>r`rrr__gt__szTimerHandle.__gt__cCs#|j|jkrdS|j|S)NT)rYrb)r>r`rrr__ge__szTimerHandle.__ge__cCsYt|trU|j|jkoT|j|jkoT|j|jkoT|j|jkStS)N)rrrYr1r2r3NotImplemented)r>r`rrrrbszTimerHandle.__eq__cCs$|j|}|tkrtS|S)N)rbrf)r>r`Zequalrrr__ne__szTimerHandle.__ne__cs-|js|jj|ntjdS)N)r3r4_timer_handle_cancelledrZrJ)r>)rCrrrJs	zTimerHandle.cancel)r*rUr)rVrWrArFr_rarcrdrerbrgrJrr)rCrrsc@s.eZdZdZddZddZdS)rz,Abstract server returned by create_server().cCstS)z5Stop serving.  This leaves existing connections open.)rf)r>rrrcloseszAbstractServer.closecCstS)z*Coroutine to wait until service is closed.)rf)r>rrrwait_closedszAbstractServer.wait_closedN)r*rUr)rVrirjrrrrrsc@s%eZdZdZddZddZddZdd	Zd
dZdd
Z	ddZ
ddZddZddZ
ddZddZddZddZddZd d!d"d!d#d!d$d!d%d&Zd!d'd(Zd)d)d*d)d d!d#d!d$d!d+d)d,d)d-d)d.d/Zd)d)d ejd$ejd+d)d0d1d*d)d2d)d3d)d4d5Zd*d)d+d)d-d)d6d7Zd+d)d0d1d*d)d8d9Zd)d)d d!d#d!d$d!d2d)d3d)d:d)d+d)d;d<Zd=d>Zd?d@ZdAej dBej dCej dDdEZ!dAej dBej dCej dFdGZ"dHdIZ#dJdKZ$dLdMZ%dNdOZ&dPdQZ'dRdSZ(dTdUZ)dVdWZ*dXdYZ+dZd[Z,d\d]Z-d^d_Z.d`daZ/dbdcZ0dddeZ1dfdgZ2dhdiZ3d)S)jrzAbstract event loop.cCs
tdS)z*Run the event loop until stop() is called.N)NotImplementedError)r>rrrrun_foreverszAbstractEventLoop.run_forevercCs
tdS)zpRun the event loop until a Future is done.

        Return the Future's result, or raise its exception.
        N)rk)r>Zfuturerrrrun_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)rk)r>rrrstopszAbstractEventLoop.stopcCs
tdS)z3Return whether the event loop is currently running.N)rk)r>rrr
is_runningszAbstractEventLoop.is_runningcCs
tdS)z*Returns True if the event loop was closed.N)rk)r>rrr	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)rk)r>rrrris	zAbstractEventLoop.closecCs
tdS)z3Notification that a TimerHandle has been cancelled.N)rk)r>rLrrrrhsz)AbstractEventLoop._timer_handle_cancelledcGs|jd||S)Nr
)
call_later)r>r?r&rrr	call_soonszAbstractEventLoop.call_sooncGs
tdS)N)rk)r>Zdelayr?r&rrrrqszAbstractEventLoop.call_latercGs
tdS)N)rk)r>r[r?r&rrrcall_atszAbstractEventLoop.call_atcCs
tdS)N)rk)r>rrrtime
szAbstractEventLoop.timecCs
tdS)N)rk)r>Zcororrrcreate_taskszAbstractEventLoop.create_taskcGs
tdS)N)rk)r>r?r&rrrcall_soon_threadsafesz&AbstractEventLoop.call_soon_threadsafecGs
tdS)N)rk)r>executorrr&rrrrun_in_executorsz!AbstractEventLoop.run_in_executorcCs
tdS)N)rk)r>rwrrrset_default_executorsz&AbstractEventLoop.set_default_executorfamilyr
typeprotoflagscCs
tdS)N)rk)r>hostportrzr{r|r}rrrgetaddrinfoszAbstractEventLoop.getaddrinfocCs
tdS)N)rk)r>Zsockaddrr}rrrgetnameinfo"szAbstractEventLoop.getnameinfoNsslsock
local_addrserver_hostnamecCs
tdS)N)rk)r>protocol_factoryr~rrrzr|r}rrrrrrcreate_connection%sz#AbstractEventLoop.create_connectionbacklogd
reuse_address
reuse_portcCs
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)rk)r>rr~rrzr}rrrrrrrr
create_server*s'zAbstractEventLoop.create_servercCs
tdS)N)rk)r>rpathrrrrrrcreate_unix_connectionSsz(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)rk)r>rrrrrrrrcreate_unix_serverXsz$AbstractEventLoop.create_unix_serverallow_broadcastcCs
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)rk)r>rrZremote_addrrzr|r}rrrrrrrcreate_datagram_endpointms!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)rk)r>rpiperrrconnect_read_pipesz#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)rk)r>rrrrrconnect_write_pipesz$AbstractEventLoop.connect_write_pipestdinstdoutstderrcKs
tdS)N)rk)r>rcmdrrrkwargsrrrsubprocess_shellsz"AbstractEventLoop.subprocess_shellcOs
tdS)N)rk)r>rrrrr&rrrrsubprocess_execsz!AbstractEventLoop.subprocess_execcGs
tdS)N)rk)r>fdr?r&rrr
add_readerszAbstractEventLoop.add_readercCs
tdS)N)rk)r>rrrr
remove_readerszAbstractEventLoop.remove_readercGs
tdS)N)rk)r>rr?r&rrr
add_writerszAbstractEventLoop.add_writercCs
tdS)N)rk)r>rrrr
remove_writerszAbstractEventLoop.remove_writercCs
tdS)N)rk)r>rnbytesrrr	sock_recvszAbstractEventLoop.sock_recvcCs
tdS)N)rk)r>rdatarrrsock_sendallszAbstractEventLoop.sock_sendallcCs
tdS)N)rk)r>rZaddressrrrsock_connectszAbstractEventLoop.sock_connectcCs
tdS)N)rk)r>rrrrsock_acceptszAbstractEventLoop.sock_acceptcGs
tdS)N)rk)r>sigr?r&rrradd_signal_handlersz$AbstractEventLoop.add_signal_handlercCs
tdS)N)rk)r>rrrrremove_signal_handlersz'AbstractEventLoop.remove_signal_handlercCs
tdS)N)rk)r>Zfactoryrrrset_task_factorysz"AbstractEventLoop.set_task_factorycCs
tdS)N)rk)r>rrrget_task_factorysz"AbstractEventLoop.get_task_factorycCs
tdS)N)rk)r>Zhandlerrrrset_exception_handlersz'AbstractEventLoop.set_exception_handlercCs
tdS)N)rk)r>rSrrrdefault_exception_handlersz+AbstractEventLoop.default_exception_handlercCs
tdS)N)rk)r>rSrrrrOsz(AbstractEventLoop.call_exception_handlercCs
tdS)N)rk)r>rrrr9szAbstractEventLoop.get_debugcCs
tdS)N)rk)r>Zenabledrrr	set_debugszAbstractEventLoop.set_debug)4r*rUr)rVrlrmrnrorprirhrrrqrsrtrurvrxryrrrsocketZ	AF_UNSPECZ
AI_PASSIVErrrrrr
subprocessPIPErrrrrrrrrrrrrrrrrOr9rrrrrrsr
$		&	!

	c@sReZdZdZddZddZddZdd	Zd
dZd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)rk)r>rrrrsz&AbstractEventLoopPolicy.get_event_loopcCs
tdS)z3Set the event loop for the current context to loop.N)rk)r>r@rrrr	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)rk)r>rrrr

sz&AbstractEventLoopPolicy.new_event_loopcCs
tdS)z$Get the watcher for child processes.N)rk)r>rrrrsz)AbstractEventLoopPolicy.get_child_watchercCs
tdS)z$Set the watcher for child processes.N)rk)r>watcherrrrrsz)AbstractEventLoopPolicy.set_child_watcherN)	r*rUr)rVrr	r
rrrrrrrs
c@seeZdZdZdZGdddejZddZddZ	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*rUr)r4_set_calledrrrr_Local*srcCs|j|_dS)N)r_local)r>rrrrA.sz#BaseDefaultEventLoopPolicy.__init__cCs|jjdkrM|jjrMttjtjrM|j|jn|jjdkr{t	dtjj
n|jjS)zSGet the event loop.

        This may be None or an instance of EventLoop.
        Nz,There is no current event loop in thread %r.)rr4rr	threadingZcurrent_threadZ_MainThreadr	r
RuntimeErrorname)r>rrrr1s
z)BaseDefaultEventLoopPolicy.get_event_loopcCs=d|j_|dks-t|ts-t||j_dS)zSet the event loop.TN)rrrrr8r4)r>r@rrrr	?s!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)r>rrrr
Esz)BaseDefaultEventLoopPolicy.new_event_loop)r*rUr)rVrrZlocalrrArr	r
rrrrrsrc	Cs9t-tdkr/ddlm}|anWdQXdS)Nr)DefaultEventLoopPolicy)_lock_event_loop_policyr(r)rrrr_init_event_loop_policyXsrcCstdkrtntS)z"Get the current event loop policy.N)rrrrrrr`s
cCs+|dks!t|ts!t|adS)zZSet the current event loop policy.

    If policy is None, the default policy is restored.N)rrr8r)Zpolicyrrrrgs!cCs
tjS)z?Equivalent to calling get_event_loop_policy().get_event_loop().)rrrrrrrpscCstj|dS)zCEquivalent to calling get_event_loop_policy().set_event_loop(loop).N)rr	)r@rrrr	uscCs
tjS)z?Equivalent to calling get_event_loop_policy().new_event_loop().)rr
rrrrr
zscCs
tjS)zBEquivalent to calling get_event_loop_policy().get_child_watcher().)rrrrrrrscCstj|S)zMEquivalent to calling
    get_event_loop_policy().set_child_watcher(watcher).)rr)rrrrrs)!rV__all__rrr"rrr<rr:Zasynciorrr'r+r0rrrrrrrZLockrrrrrr	r
rrrrrr<module>sH	?8*"7