ok

Mini Shell

Direktori : /proc/thread-self/root/opt/alt/python34/lib64/python3.4/asyncio/__pycache__/
Upload File :
Current File : //proc/thread-self/root/opt/alt/python34/lib64/python3.4/asyncio/__pycache__/events.cpython-34.pyc

�
j fyS�@s�dZddddddddd	d
ddgZd
dlZd
dlZd
dlZd
dlZd
dlZd
dlZd
dlZd
dl	Z	d
dl
mZdd�Zdd�Z
ddd�Zdd�ZGdd�d�ZGdd�de�ZGdd�d�ZGdd�d�ZGdd�d�ZGdd�de�Zdaej�Zd d!�Zd"d�Zd#d�Zd$d�Zd%d	�Zd&d
�Zd'd�Zd(d�Z dS))z!Event loop and event loop policy.�AbstractEventLoopPolicy�AbstractEventLoop�AbstractServer�Handle�TimerHandle�get_event_loop_policy�set_event_loop_policy�get_event_loop�set_event_loop�new_event_loop�get_child_watcher�set_child_watcher�N)�compatcCs�tjrtj|�}nt|d�r6|j}ntj|�r^|j}|j|j	fSt
|tj�r}t
|j�Stjr�t
|tj�r�t
|j�SdS)N�__wrapped__)rZPY34�inspectZunwrap�hasattrrZ
isfunction�__code__�co_filename�co_firstlineno�
isinstance�	functools�partial�_get_function_source�func�
partialmethod)r�code�r�3/opt/alt/python34/lib64/python3.4/asyncio/events.pyrs		

rcCsKtj|�}t|�dkrG|jd�rG|dd�d}n|S)zoFormat function arguments.

    Special case for a single parameter: ('hello',) is formatted as ('hello').
    �z,)N��)���)�reprlib�repr�len�endswith)�argsZ	args_reprrrr�_format_args&s!r'�cCs�t|tj�rG|dk	r1t|�|}nt|j|j|�St|d�rht|d�}n-t|d�r�t|d�}nt	|�}|dk	r�|t|�7}n|r�||7}n|S)N�__qualname__�__name__)
rrrr'�_format_callbackrr&r�getattrr#)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
d�Zdd�Zdd�Z	dS)rz1Object returned by callback registration methods.�	_callback�_args�
_cancelled�_loop�_source_traceback�_repr�__weakref__cCs�t|t�std��||_||_||_d|_d|_|jj�rvt	j
tjd��|_
n	d|_
dS)NzA Handle is not a callbackFr)rr�AssertionErrorr4r1r2r3r6�	get_debug�	traceback�
extract_stack�sys�	_getframer5)�self�callbackr&�looprrr�__init__Ss					zHandle.__init__cCs�|jjg}|jr(|jd�n|jdk	rV|jt|j|j��n|jr�|jd}|jd|d|df�n|S)NZ	cancelledrzcreated at %s:%sr
���)�	__class__r*r3�appendr1r0r2r5)r>�infoZframerrr�
_repr_info_s		
"zHandle._repr_infocCs3|jdk	r|jS|j�}ddj|�S)Nz<%s>� )r6rF�join)r>rErrr�__repr__jszHandle.__repr__cCsL|jsHd|_|jj�r3t|�|_nd|_d|_ndS)NT)r3r4r9r#r6r1r2)r>rrr�cancelps			z
Handle.cancelcCs�y|j|j�Wn�tk
r�}zmt|j|j�}dj|�}i|d6|d6|d6}|jr�|j|d<n|jj|�WYdd}~XnXd}dS)NzException in callback {}�messageZ	exception�handleZsource_traceback)r1r2�	Exceptionr0�formatr5r4�call_exception_handler)r>�exc�cb�msg�contextrrr�_run{s
	#zHandle._runN)z	_callbackz_argsz
_cancelledz_loopz_source_tracebackz_reprz__weakref__)
r*�
__module__r)�__doc__�	__slots__rArFrIrJrTrrrrrMscs�eZdZdZddgZ�fdd�Z�fdd�Zdd	�Zd
d�Zdd
�Z	dd�Z
dd�Zdd�Zdd�Z
�fdd�Z�S)rz7Object returned by timed callback registration methods.�
_scheduled�_whencsT|dk	st�t�j|||�|jr>|jd=n||_d|_dS)NrFrB)r8�superrAr5rYrX)r>�whenr?r&r@)rCrrrA�s	
	zTimerHandle.__init__cs?t�j�}|jrdnd}|j|d|j�|S)Nrrzwhen=%s)rZrFr3�insertrY)r>rE�pos)rCrrrF�szTimerHandle._repr_infocCs
t|j�S)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|t�rU|j|jkoT|j|jkoT|j|jkoT|j|jkStS)N)rrrYr1r2r3�NotImplemented)r>r`rrrrb�szTimerHandle.__eq__cCs$|j|�}|tkrtS|S)N)rbrf)r>r`Zequalrrr�__ne__�szTimerHandle.__ne__cs-|js|jj|�nt�j�dS)N)r3r4�_timer_handle_cancelledrZrJ)r>)rCrrrJ�s	zTimerHandle.cancel)r*rUr)rVrWrArFr_rarcrdrerbrgrJrr)rCrr�sc@s.eZdZdZdd�Zdd�ZdS)rz,Abstract server returned by create_server().cCstS)z5Stop serving.  This leaves existing connections open.)rf)r>rrr�close�szAbstractServer.closecCstS)z*Coroutine to wait until service is closed.)rf)r>rrr�wait_closed�szAbstractServer.wait_closedN)r*rUr)rVrirjrrrrr�sc@s%eZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zdd�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)d,d)d-d)d.d/�Zd)d)d ejd$ejd+d)d0d1d*d)d2d)d3d)d4d5�Zd*d)d+d)d-d)d6d7�Zd+d)d0d1d*d)d8d9�Zd)d)d d!d#d!d$d!d2d)d3d)d:d)d+d)d;d<�Zd=d>�Zd?d@�ZdAej dBej dCej dDdE�Z!dAej dBej dCej dFdG�Z"dHdI�Z#dJdK�Z$dLdM�Z%dNdO�Z&dPdQ�Z'dRdS�Z(dTdU�Z)dVdW�Z*dXdY�Z+dZd[�Z,d\d]�Z-d^d_�Z.d`da�Z/dbdc�Z0ddde�Z1dfdg�Z2dhdi�Z3d)S)jrzAbstract event loop.cCs
t�dS)z*Run the event loop until stop() is called.N)�NotImplementedError)r>rrr�run_forever�szAbstractEventLoop.run_forevercCs
t�dS)zpRun the event loop until a Future is done.

        Return the Future's result, or raise its exception.
        N)rk)r>Zfuturerrr�run_until_complete�sz$AbstractEventLoop.run_until_completecCs
t�dS)z�Stop 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>rrr�stop�szAbstractEventLoop.stopcCs
t�dS)z3Return whether the event loop is currently running.N)rk)r>rrr�
is_running�szAbstractEventLoop.is_runningcCs
t�dS)z*Returns True if the event loop was closed.N)rk)r>rrr�	is_closed�szAbstractEventLoop.is_closedcCs
t�dS)z�Close 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>rrrri�s	zAbstractEventLoop.closecCs
t�dS)z3Notification that a TimerHandle has been cancelled.N)rk)r>rLrrrrh�sz)AbstractEventLoop._timer_handle_cancelledcGs|jd||�S)Nr
)�
call_later)r>r?r&rrr�	call_soonszAbstractEventLoop.call_sooncGs
t�dS)N)rk)r>Zdelayr?r&rrrrqszAbstractEventLoop.call_latercGs
t�dS)N)rk)r>r[r?r&rrr�call_atszAbstractEventLoop.call_atcCs
t�dS)N)rk)r>rrr�time
szAbstractEventLoop.timecCs
t�dS)N)rk)r>Zcororrr�create_taskszAbstractEventLoop.create_taskcGs
t�dS)N)rk)r>r?r&rrr�call_soon_threadsafesz&AbstractEventLoop.call_soon_threadsafecGs
t�dS)N)rk)r>�executorrr&rrr�run_in_executorsz!AbstractEventLoop.run_in_executorcCs
t�dS)N)rk)r>rwrrr�set_default_executorsz&AbstractEventLoop.set_default_executor�familyr
�type�proto�flagscCs
t�dS)N)rk)r>�host�portrzr{r|r}rrr�getaddrinfoszAbstractEventLoop.getaddrinfocCs
t�dS)N)rk)r>Zsockaddrr}rrr�getnameinfo"szAbstractEventLoop.getnameinfoN�ssl�sock�
local_addr�server_hostnamecCs
t�dS)N)rk)r>�protocol_factoryr~rr�rzr|r}r�r�r�rrr�create_connection%sz#AbstractEventLoop.create_connection�backlog�d�
reuse_address�
reuse_portcCs
t�dS)a�A 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>r�r~rrzr}r�r�r�r�r�rrr�
create_server*s'zAbstractEventLoop.create_servercCs
t�dS)N)rk)r>r��pathr�r�r�rrr�create_unix_connectionSsz(AbstractEventLoop.create_unix_connectioncCs
t�dS)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>r�r�r�r�r�rrr�create_unix_serverXsz$AbstractEventLoop.create_unix_server�allow_broadcastcCs
t�dS)a�A 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>r�r�Zremote_addrrzr|r}r�r�r�r�rrr�create_datagram_endpointms!z*AbstractEventLoop.create_datagram_endpointcCs
t�dS)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>r��piperrr�connect_read_pipe�sz#AbstractEventLoop.connect_read_pipecCs
t�dS)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>r�r�rrr�connect_write_pipe�sz$AbstractEventLoop.connect_write_pipe�stdin�stdout�stderrcKs
t�dS)N)rk)r>r��cmdr�r�r��kwargsrrr�subprocess_shell�sz"AbstractEventLoop.subprocess_shellcOs
t�dS)N)rk)r>r�r�r�r�r&r�rrr�subprocess_exec�sz!AbstractEventLoop.subprocess_execcGs
t�dS)N)rk)r>�fdr?r&rrr�
add_reader�szAbstractEventLoop.add_readercCs
t�dS)N)rk)r>r�rrr�
remove_reader�szAbstractEventLoop.remove_readercGs
t�dS)N)rk)r>r�r?r&rrr�
add_writer�szAbstractEventLoop.add_writercCs
t�dS)N)rk)r>r�rrr�
remove_writer�szAbstractEventLoop.remove_writercCs
t�dS)N)rk)r>r��nbytesrrr�	sock_recv�szAbstractEventLoop.sock_recvcCs
t�dS)N)rk)r>r��datarrr�sock_sendall�szAbstractEventLoop.sock_sendallcCs
t�dS)N)rk)r>r�Zaddressrrr�sock_connect�szAbstractEventLoop.sock_connectcCs
t�dS)N)rk)r>r�rrr�sock_accept�szAbstractEventLoop.sock_acceptcGs
t�dS)N)rk)r>�sigr?r&rrr�add_signal_handler�sz$AbstractEventLoop.add_signal_handlercCs
t�dS)N)rk)r>r�rrr�remove_signal_handler�sz'AbstractEventLoop.remove_signal_handlercCs
t�dS)N)rk)r>Zfactoryrrr�set_task_factory�sz"AbstractEventLoop.set_task_factorycCs
t�dS)N)rk)r>rrr�get_task_factory�sz"AbstractEventLoop.get_task_factorycCs
t�dS)N)rk)r>Zhandlerrrr�set_exception_handler�sz'AbstractEventLoop.set_exception_handlercCs
t�dS)N)rk)r>rSrrr�default_exception_handler�sz+AbstractEventLoop.default_exception_handlercCs
t�dS)N)rk)r>rSrrrrO�sz(AbstractEventLoop.call_exception_handlercCs
t�dS)N)rk)r>rrrr9�szAbstractEventLoop.get_debugcCs
t�dS)N)rk)r>Zenabledrrr�	set_debug�szAbstractEventLoop.set_debug)4r*rUr)rVrlrmrnrorprirhrrrqrsrtrurvrxryr�r�r��socketZ	AF_UNSPECZ
AI_PASSIVEr�r�r�r�r�r��
subprocess�PIPEr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rOr9r�rrrrr�sr
$		&	!

	c@sReZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�ZdS)
rz-Abstract policy for accessing the event loop.cCs
t�dS)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>rrrr�sz&AbstractEventLoopPolicy.get_event_loopcCs
t�dS)z3Set the event loop for the current context to loop.N)rk)r>r@rrrr	sz&AbstractEventLoopPolicy.set_event_loopcCs
t�dS)z�Create 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
t�dS)z$Get the watcher for child processes.N)rk)r>rrrrsz)AbstractEventLoopPolicy.get_child_watchercCs
t�dS)z$Set the watcher for child processes.N)rk)r>�watcherrrrrsz)AbstractEventLoopPolicy.set_child_watcherN)	r*rUr)rVrr	r
rrrrrrr�s
c@seeZdZdZdZGdd�dej�Zdd�Zdd�Z	d	d
�Z
dd�ZdS)
�BaseDefaultEventLoopPolicya�Default 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r�cCs|j�|_dS)N)r��_local)r>rrrrA.sz#BaseDefaultEventLoopPolicy.__init__cCs�|jjdkrM|jjrMttj�tj�rM|j|j��n|jjdkr{t	dtj�j
��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.)r�r4r�r�	threadingZcurrent_threadZ_MainThreadr	r
�RuntimeError�name)r>rrrr1s
z)BaseDefaultEventLoopPolicy.get_event_loopcCs=d|j_|dks-t|t�s-t�||j_dS)zSet the event loop.TN)r�r�rrr8r4)r>r@rrrr	?s!z)BaseDefaultEventLoopPolicy.set_event_loopcCs
|j�S)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)rVr�r�Zlocalr�rArr	r
rrrrr�sr�c	Cs9t�-tdkr/ddlm}|�anWdQXdS)Nr)�DefaultEventLoopPolicy)�_lock�_event_loop_policyr(r�)r�rrr�_init_event_loop_policyXsr�cCstdkrt�ntS)z"Get the current event loop policy.N)r�r�rrrrr`s
cCs+|dks!t|t�s!t�|adS)zZSet the current event loop policy.

    If policy is None, the default policy is restored.N)rrr8r�)Zpolicyrrrrgs!cCs
t�j�S)z?Equivalent to calling get_event_loop_policy().get_event_loop().)rrrrrrrpscCst�j|�dS)zCEquivalent to calling get_event_loop_policy().set_event_loop(loop).N)rr	)r@rrrr	uscCs
t�j�S)z?Equivalent to calling get_event_loop_policy().new_event_loop().)rr
rrrrr
zscCs
t�j�S)zBEquivalent to calling get_event_loop_policy().get_child_watcher().)rrrrrrrscCst�j|�S)zMEquivalent to calling
    get_event_loop_policy().set_child_watcher(watcher).)rr)r�rrrr�s)!rV�__all__rrr"r�r�r<r�r:Zasynciorrr'r+r0rrrrrr�r�ZLockr�r�rrrr	r
rrrrrr�<module>sH	?8�*"7	

Zerion Mini Shell 1.0