$52 GRAYBYTE WORDPRESS FILE MANAGER $94

SERVER : premium201.web-hosting.com #1 SMP Wed Mar 26 12:08:09 UTC 2025
SERVER IP : 172.67.217.254 | ADMIN IP 216.73.216.157
OPTIONS : CRL = ON | WGT = ON | SDO = OFF | PKEX = OFF
DEACTIVATED : mail

/opt/alt/python34/lib64/python3.4/asyncio/__pycache__/

HOME
Current File : /opt/alt/python34/lib64/python3.4/asyncio/__pycache__//base_events.cpython-34.pyo
�
j f���@sdZddlZddlZddlZddlZddlZddlZddlZddl	Z	ddl
Z
ddlZddlZddl
Z
ddlZddlZddlZddlZddlmZddlmZddlmZddlmZddlmZdd	lmZdd
lmZdgZdZd
ZdZdd�Zdd�Z dZ!e"ed�r�e!ej#OZ!ne"ed�r�e!ej$OZ!nej%dd�dd��Z&dd�Z'dd�Z(Gdd�dej)�Z*Gdd�dej+�Z,dS) a�Base implementation of event loop.

The event loop can be broken up into a multiplexer (the part
responsible for notifying us of I/O events) and the event loop proper,
which wraps a multiplexer with functionality for scheduling callbacks,
immediately or at a given time in the future.

Whenever a public API takes a callback, subsequent positional
arguments will be passed to the callback if/when it is called.  This
avoids the proliferation of trivial lambdas implementing closures.
Keyword arguments for the callback are not supported; this is a
conscious design decision, leaving the door open for keyword arguments
to modify the meaning of the API call itself.
�N�)�compat)�
coroutines)�events)�futures)�tasks)�	coroutine)�logger�
BaseEventLoop��dg�?cCsH|j}tj|�r:t|jtj�r:t|j�St|�SdS)N)	�	_callback�inspectZismethod�
isinstance�__self__r�Task�repr�str)�handle�cb�r�8/opt/alt/python34/lib64/python3.4/asyncio/base_events.py�_format_handle9s	$
rcCs4|tjkrdS|tjkr&dSt|�SdS)Nz<pipe>z<stdout>)�
subprocess�PIPE�STDOUTr)�fdrrr�_format_pipeBs
r�
SOCK_NONBLOCK�SOCK_CLOEXEC�maxsizeicCs�|dtjtjhks'|dkr+dS|tM}|tjkrQtj}n|tjkrltj}ndSttd�r2|tjkr�tjtj	g}n	|g}x|D]w}y\|tj	kr�tj
||jd�d�ntj
||�|||d||ffSWq�tk
r)Yq�Xq�WdSyt
j|�}WnKtk
r�y t
j|jd�d�}Wntk
r�dSYnXYnX|jdkr�tjntj	}|tj|fkr�dS|||d||ffS)Nr�	inet_pton�%��)�socketZIPPROTO_TCPZIPPROTO_UDP�_SOCKET_TYPE_MASK�SOCK_STREAM�
SOCK_DGRAM�hasattr�	AF_UNSPECZAF_INET�AF_INET6r!�	partition�OSError�	ipaddressZIPv4Address�
ValueErrorZIPv6Address�version)�host�port�family�type�protoZafs�af�addrrrr�_ipaddr_infoSs@'	
 
	
 
!r8cCsyttd�r%|jtjkr%dS|dd�\}}t|||j|j|j�dkrutd|��ndS)N�AF_UNIX�z2address must be resolved (IP address), got host %r)r)r%r3r9r8r4r5r/)�sock�addressr1r2rrr�_check_resolved_address�s!'r=cCs=|j}t|t�r,t|t�r,dS|jj�dS)N)Z
_exceptionr�
BaseException�	Exception�_loop�stop)�fut�excrrr�_run_until_complete_cb�s
	rDc@sjeZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Ze	d
d��Z
dS)�ServercCs(||_||_d|_g|_dS)Nr)r@�sockets�
_active_count�_waiters)�self�looprFrrr�__init__�s			zServer.__init__cCsd|jj|jfS)Nz<%s sockets=%r>)�	__class__�__name__rF)rIrrr�__repr__�szServer.__repr__cCs|jd7_dS)Nr)rG)rIrrr�_attach�szServer._attachcCs>|jd8_|jdkr:|jdkr:|j�ndS)Nrr)rGrF�_wakeup)rIrrr�_detach�szServer._detachcCsc|j}|dkrdSd|_x|D]}|jj|�q)W|jdkr_|j�ndS)Nr)rFr@Z
_stop_servingrGrP)rIrFr;rrr�close�s		
zServer.closecCsC|j}d|_x*|D]"}|j�s|j|�qqWdS)N)rH�done�
set_result)rI�waiters�waiterrrrrP�s
		
zServer._wakeupccsT|jdks|jdkr"dStjd|j�}|jj|�|DdHdS)NrJ)rFrHr�Futurer@�append)rIrVrrr�wait_closed�s
zServer.wait_closedN)rM�
__module__�__qualname__rKrNrOrQrRrPrrYrrrrrE�s
rEc@s!eZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdddd
ddd�Zdddddddd
ddd�Z	ddddd�Z
dddd�Zdddd�Ze
ddd��Zdd�Zdd �Zd!d"�Zd#d$�Zd%d&�Zd'd(�Zd)d*�Zd+d,�ZejrPd-d.�Znd/d0�Zd1d2�Zd3d4�Zd5d6�Zd7d8�Zd9d:�Zd;d<�Z d=d>�Z!d?d@�Z"dAdB�Z#dCdD�Z$dEdFdGdFdHdFdIdFdJdK�Z%dFdLdM�Z&e
dddNddEdFdHdFdIdFdOddPddddQdR��Z'e
dSdT��Z(e
dddEdFdHdFdIdFdUddVddWddOddXdY��Z)e
dZd[��Z*e
dddEe+j,dIe+j-dOdd\d]dNddUddVdd^d_��Z.e
d`da��Z/e
dbdc��Z0ddde�Z1e
dfe2j3dge2j3dhe2j3diddjdkdldFdmdn��Z4e
dfe2j3dge2j3dhe2j3diddjddldFdodp��Z5dqdr�Z6dsdt�Z7dudv�Z8dwdx�Z9dydz�Z:d{d|�Z;d}d~�Z<dd��Z=d�d��Z>d�d��Z?dS)�r
cCs�d|_d|_d|_tj�|_g|_d|_d|_d|_	t
jd�j|_
d|_|jtjjo�ttjjd���d|_d|_d|_d|_dS)NrF�	monotonicZPYTHONASYNCIODEBUGg�������?)�_timer_cancelled_count�_closed�	_stopping�collections�deque�_ready�
_scheduled�_default_executorZ
_internal_fds�
_thread_id�timeZget_clock_infoZ
resolution�_clock_resolution�_exception_handler�	set_debug�sys�flags�ignore_environment�bool�os�environ�get�slow_callback_duration�_current_handle�
_task_factory�_coroutine_wrapper_set)rIrrrrK�s 											zBaseEventLoop.__init__cCs,d|jj|j�|j�|j�fS)Nz"<%s running=%s closed=%s debug=%s>)rLrM�
is_running�	is_closed�	get_debug)rIrrrrN�szBaseEventLoop.__repr__cCs]|j�|jdkrGtj|d|�}|jrY|jd=qYn|j||�}|S)zDSchedule a coroutine object.

        Return a task object.
        NrJr���)�
_check_closedrsrr�_source_traceback)rIZcoroZtaskrrr�create_task�s
	zBaseEventLoop.create_taskcCs5|dk	r(t|�r(td��n||_dS)awSet a task factory that will be used by loop.create_task().

        If factory is None the default task factory will be set.

        If factory is a callable, it should have a signature matching
        '(loop, coro)', where 'loop' will be a reference to the active
        event loop, 'coro' will be a coroutine object.  The callable
        must return a Future.
        Nz'task factory must be a callable or None)�callable�	TypeErrorrs)rIZfactoryrrr�set_task_factory�s
zBaseEventLoop.set_task_factorycCs|jS)z<Return a task factory, or None if the default one is in use.)rs)rIrrr�get_task_factoryszBaseEventLoop.get_task_factoryN�extra�servercCs
t�dS)zCreate socket transport.N)�NotImplementedError)rIr;�protocolrVr�r�rrr�_make_socket_transportsz$BaseEventLoop._make_socket_transport�server_sideF�server_hostnamec	Cs
t�dS)zCreate SSL transport.N)r�)	rIZrawsockr��
sslcontextrVr�r�r�r�rrr�_make_ssl_transportsz!BaseEventLoop._make_ssl_transportcCs
t�dS)zCreate datagram transport.N)r�)rIr;r�r<rVr�rrr�_make_datagram_transportsz&BaseEventLoop._make_datagram_transportcCs
t�dS)zCreate read pipe transport.N)r�)rI�piper�rVr�rrr�_make_read_pipe_transport sz'BaseEventLoop._make_read_pipe_transportcCs
t�dS)zCreate write pipe transport.N)r�)rIr�r�rVr�rrr�_make_write_pipe_transport%sz(BaseEventLoop._make_write_pipe_transportc	
Ks
t�dS)zCreate subprocess transport.N)r�)
rIr��args�shell�stdin�stdout�stderr�bufsizer��kwargsrrr�_make_subprocess_transport*sz(BaseEventLoop._make_subprocess_transportcCs
t�dS)z�Write a byte to self-pipe, to wake up the event loop.

        This may be called from a different thread.

        The subclass is responsible for implementing the self-pipe.
        N)r�)rIrrr�_write_to_self1szBaseEventLoop._write_to_selfcCs
t�dS)zProcess selector events.N)r�)rI�
event_listrrr�_process_events:szBaseEventLoop._process_eventscCs|jrtd��ndS)NzEvent loop is closed)r^�RuntimeError)rIrrrry>s	zBaseEventLoop._check_closedcCs�|j�|j�r%td��n|j|j�tj�|_z"x|j�|j	rJPqJqJWWdd|_	d|_|jd�XdS)zRun until stop() is called.zEvent loop is running.NF)
ryrur��_set_coroutine_wrapper�_debug�	threading�	get_identre�	_run_oncer_)rIrrr�run_foreverBs

			zBaseEventLoop.run_foreverc	Cs�|j�t|tj�}tj|d|�}|rDd|_n|jt�y|j	�Wn7|r�|j
�r�|j�r�|j�n�YnX|j
t�|j
�s�td��n|j�S)a\Run until the Future is done.

        If the argument is a coroutine, it is wrapped in a Task.

        WARNING: It would be disastrous to call run_until_complete()
        with the same coroutine twice -- it would wrap it in two
        different Tasks and that can't be good.

        Return the Future's result, or raise its exception.
        rJFz+Event loop stopped before Future completed.)ryrrrWrZ
ensure_futureZ_log_destroy_pendingZadd_done_callbackrDr�rSZ	cancelled�	exceptionZremove_done_callbackr��result)rIZfutureZnew_taskrrr�run_until_completeSs 



z BaseEventLoop.run_until_completecCs
d|_dS)z�Stop running the event loop.

        Every callback already scheduled will still run.  This simply informs
        run_forever to stop looping after a complete iteration.
        TN)r_)rIrrrrAwszBaseEventLoop.stopcCs�|j�rtd��n|jr(dS|jrDtjd|�nd|_|jj�|jj�|j	}|dk	r�d|_	|j
dd�ndS)z�Close the event loop.

        This clears the queues and shuts down the executor,
        but does not wait for the executor to finish.

        The event loop must not be running.
        z!Cannot close a running event loopNzClose %rT�waitF)rur�r^r�r	�debugrb�clearrcrdZshutdown)rI�executorrrrrRs			

		zBaseEventLoop.closecCs|jS)z*Returns True if the event loop was closed.)r^)rIrrrrv�szBaseEventLoop.is_closedcCs@|j�s<tjd|t�|j�s<|j�q<ndS)Nzunclosed event loop %r)rv�warnings�warn�ResourceWarningrurR)rIrrr�__del__�szBaseEventLoop.__del__cCs
|jdk	S)z*Returns True if the event loop is running.N)re)rIrrrru�szBaseEventLoop.is_runningcCs
tj�S)z�Return the time according to the event loop's clock.

        This is a float expressed in seconds since an epoch, but the
        epoch, precision, accuracy and drift are unspecified and may
        differ per event loop.
        )rfr\)rIrrrrf�szBaseEventLoop.timecGs9|j|j�|||�}|jr5|jd=n|S)a8Arrange for a callback to be called at a given time.

        Return a Handle: an opaque object with a cancel() method that
        can be used to cancel the call.

        The delay can be an int or float, expressed in seconds.  It is
        always relative to the current time.

        Each callback will be called exactly once.  If two callbacks
        are scheduled for exactly the same time, it undefined which
        will be called first.

        Any positional arguments after the callback will be passed to
        the callback when it is called.
        rrx)�call_atrfrz)rIZdelay�callbackr��timerrrr�
call_later�s	
zBaseEventLoop.call_latercGs�tj|�stj|�r-td��n|j�|jrM|j�ntj||||�}|j	r{|j	d=nt
j|j|�d|_|S)z|Like call_later(), but uses an absolute time.

        Absolute time corresponds to the event loop's time() method.
        z(coroutines cannot be used with call_at()rTrx)
r�iscoroutine�iscoroutinefunctionr}ryr��
_check_threadrZTimerHandlerz�heapq�heappushrc)rI�whenr�r�r�rrrr��s
	
	
	zBaseEventLoop.call_atcGsB|jr|j�n|j||�}|jr>|jd=n|S)aTArrange for a callback to be called as soon as possible.

        This operates as a FIFO queue: callbacks are called in the
        order in which they are registered.  Each callback will be
        called exactly once.

        Any positional arguments after the callback will be passed to
        the callback when it is called.
        rrx)r�r��
_call_soonrz)rIr�r�rrrr�	call_soon�s
	
	
zBaseEventLoop.call_sooncCsvtj|�stj|�r-td��n|j�tj|||�}|jrb|jd=n|jj	|�|S)Nz*coroutines cannot be used with call_soon()rrx)
rr�r�r}ryr�HandlerzrbrX)rIr�r�rrrrr��s
	
zBaseEventLoop._call_sooncCsA|jdkrdStj�}||jkr=td��ndS)aoCheck that the current thread is the thread running the event loop.

        Non-thread-safe methods of this class make this assumption and will
        likely behave incorrectly when the assumption is violated.

        Should only be called when (self._debug == True).  The caller is
        responsible for checking this condition for performance reasons.
        NzMNon-thread-safe operation invoked on an event loop other than the current one)rer�r�r�)rIZ	thread_idrrrr��s	zBaseEventLoop._check_threadcGs6|j||�}|jr(|jd=n|j�|S)z"Like call_soon(), but thread-safe.rrx)r�rzr�)rIr�r�rrrr�call_soon_threadsafes
	

z"BaseEventLoop.call_soon_threadsafecGs�tj|�stj|�r-td��n|j�t|tj�r�|jrut	j
d|�}|jd�|S|j|j
}}n|dkr�|j}|dkr�tj	jt�}||_q�nt	j|j||�d|�S)Nz0coroutines cannot be used with run_in_executor()rJ)rr�r�r}ryrrr��
_cancelledrrWrTr
�_argsrd�
concurrentZThreadPoolExecutor�_MAX_WORKERSZwrap_futureZsubmit)rIr��funcr��frrr�run_in_executors 
	
	zBaseEventLoop.run_in_executorcCs
||_dS)N)rd)rIr�rrr�set_default_executor sz"BaseEventLoop.set_default_executorcCsd||fg}|r-|jd|�n|rG|jd|�n|ra|jd|�n|r{|jd|�ndj|�}tjd|�|j�}tj||||||�}	|j�|}
d||
d	|	f}|
|jkr
tj|�n
tj|�|	S)
Nz%s:%rz	family=%rztype=%rzproto=%rzflags=%rz, zGet address info %sz(Getting address info %s took %.3f ms: %rg@�@)	rX�joinr	r�rfr%�getaddrinforq�info)rIr1r2r3r4r5rk�msg�t0Zaddrinfo�dtrrr�_getaddrinfo_debug#s(
z BaseEventLoop._getaddrinfo_debugr3rr4r5rkc		Cs�t|||||�}|dk	rJtjd|�}|j|g�|S|jrx|jd|j||||||�S|jdtj||||||�SdS)NrJ)	r8rrWrTr�r�r�r%r�)	rIr1r2r3r4r5rkr�rBrrrr�<s	zBaseEventLoop.getaddrinfocCs|jdtj||�S)N)r�r%�getnameinfo)rIZsockaddrrkrrrr�JszBaseEventLoop.getnameinfo�sslr;�
local_addrc#s0|
dk	r"|r"td��n|
dkrR|rR|sItd��n|}
n|dk	sj|dk	r�|dk	r�td��n|j||d|dtjd|d|�}|g}|	dk	r|jd|dtjd|d||	�}
|j|
�nd}
tj|d	|�DdH|j�}|s@td
��n|
dk	rp|
j�}|sptd
��qpng}xF|D]�\}}}}}ytjd|d|d|�}|j	d�|
dk	rpx�|D]�\}}}}}y|j
|�PWq�tk
rU}z9t|jdj||j
j���}|j|�WYdd}~Xq�Xq�W|j�d}w}n|jr�tjd
||�n|j||�DdHWnntk
r�}z+|dk	r�|j�n|j|�WYdd}~Xq}|dk	r|j�n�Yq}XPq}Wt|�dkr:|d�q�t|d��t�fdd�|D��rv|d�ntdjdjdd�|D�����n|dkr�td��n|j	d�|j||||
�DdH\}}|jr&|jd�}tjd|||||�n||fS)a�Connect to a TCP server.

        Create a streaming transport connection to a given Internet host and
        port: socket family AF_INET or socket.AF_INET6 depending on host (or
        family if specified), socket type SOCK_STREAM. protocol_factory must be
        a callable returning a protocol instance.

        This method is a coroutine which will try to establish the connection
        in the background.  When successful, the coroutine returns a
        (transport, protocol) pair.
        Nz+server_hostname is only meaningful with sslz:You must set server_hostname when using ssl without a hostz8host/port and sock can not be specified at the same timer3r4r5rkrJz!getaddrinfo() returned empty listFz2error while attempting to bind on address {!r}: {}zconnect %r to %rrrc3s!|]}t|��kVqdS)N)r)�.0rC)�modelrr�	<genexpr>�sz2BaseEventLoop.create_connection.<locals>.<genexpr>zMultiple exceptions: {}z, css|]}t|�VqdS)N)r)r�rCrrrr��sz5host and port was not specified and no sock specifiedr%z%r connected to %s:%r: (%r, %r))r/r�r%r'rXrr�r�r-�setblocking�bind�errno�format�strerror�lowerrRr�r	r��sock_connect�lenr�allr��_create_connection_transportZget_extra_info)rI�protocol_factoryr1r2r�r3r5rkr;r�r��f1�fs�f2�infosZladdr_infos�
exceptionsr4Zcnamer<�_ZladdrrC�	transportr�r)r�r�create_connectionMs�			

$
	



	%
		zBaseEventLoop.create_connectionc		cs�|�}tjd|�}|rct|t�r6dn|}|j||||ddd|�}n|j|||�}y
|DdHWn|j��YnX||fS)NrJr�Fr�)rrWrrmr�r�rR)	rIr;r�r�r�r�rVr�r�rrrr��s	

z*BaseEventLoop._create_connection_transport�
reuse_address�
reuse_port�allow_broadcastc#s�|
dk	r��s<�s<|s<|s<|s<|s<|s<|	r�td�d�d|d|d|d|d|d	|	�}d
jdd�|j�D��}td
j|���n|
jd�d}
n%�p��s|dkr�td��n||fdff}ntj�}x�d�fd�ffD]�\}}|dk	r)|jd|dt	j
d|d||�DdH}|s�td��nxY|D]N\}}}}}||f}||kr�ddg||<n||||<q�Wq)q)W��fdd�|j�D�}|std��ng}|dkrOtj
dkoItjdk}nx�|D]�\\}}\}}d}
d}
y�t	j	d|dt	j
d|�}
|r�|
jt	jt	jd�n|rtt	d�s�td��q|
jt	jt	jd�n|	r"|
jt	jt	jd�n|
jd��rE|
j|�n�ri|j|
|�DdH|}
nWnntk
r�}z+|
dk	r�|
j�n|j|�WYdd}~XqV|
dk	r�|
j�n�YqVXPqVW|d�|�}tjd|�}|j|
||
|�}|jra�rHtjd��||�qatj d�||�ny
|DdHWn|j��YnX||fS)zCreate datagram connection.Nr��remote_addrr3r5rkr�r�r�z, css-|]#\}}|rdj||�VqdS)z{}={}N)r�)r��k�vrrrr��sz9BaseEventLoop.create_datagram_endpoint.<locals>.<genexpr>zNsocket modifier keyword arguments can not be used when sock is specified. ({})Frzunexpected address familyrr4z!getaddrinfo() returned empty listcsNg|]D\}}�r(|ddkp;�o;|ddks||f�qS)rNrr)r��keyZ	addr_pair)r�r�rr�
<listcomp>s		z:BaseEventLoop.create_datagram_endpoint.<locals>.<listcomp>zcan not get address information�posix�cygwin�SO_REUSEPORTz)reuse_port not supported by socket modulerJz@Datagram endpoint local_addr=%r remote_addr=%r created: (%r, %r)z2Datagram endpoint remote_addr=%r created: (%r, %r))NN)!�dictr��itemsr/r�r�r`�OrderedDictr�r%r(r-rn�namerj�platform�
setsockopt�
SOL_SOCKET�SO_REUSEADDRr)r�ZSO_BROADCASTr�r�rRrXrrWr�r�r	r�r�)rIr�r�r�r3r5rkr�r�r�r;ZoptsZproblemsZr_addrZaddr_pairs_infoZ
addr_infos�idxr7r�Zfamr�Zpror<r�r�Z
local_addressZremote_addressrCr�rVr�r)r�r�r�create_datagram_endpoint�s�	
	%	"!	




				

z&BaseEventLoop.create_datagram_endpointc	csN|j||d|dtjd|�DdH}|sJtdj|���n|S)Nr3r4rkz%getaddrinfo({!r}) returned empty list)r�r%r'r-r�)rIr1r2r3rkr�rrr�_create_server_getaddrinfoZs	z(BaseEventLoop._create_server_getaddrinfo�backlogrc #s�t|t�rtd��n|dk	s6�dk	r�|dk	rQtd��nttdd�}|	dkr�tjdko�tj	dk}	ng}|dkr�dg}
n4t|t
�s�t|tj�r�|g}
n|}
����fd	d
�|
D�}t
jd�|�DdH}tjj|�}d}z�x�|D]{}|\}}}}}ytj|||�}Wn@tjk
r��jr�tjd
|||dd�nw@YnX|j|�|	r�|jtjtjd�n|
r&ttd�s
td��q&|jtjtjd�n||kr]ttd�r]|jtjtjd�ny|j|�Wq@tk
r�}z*t|j d||j!j"�f��WYdd}~Xq@Xq@Wd}Wd|s�x|D]}|j#�q�WnXn$|dkrtd��n|g}t$�|�}x>|D]6}|j%|�|j&d��j'||||�q+W�jr�tj(d|�n|S)a�Create a TCP server.

        The host parameter can be a string, in that case the TCP server is bound
        to host and port.

        The host parameter can also be a sequence of strings and in that case
        the TCP server is bound to all hosts of the sequence.

        Return a Server object which can be used to stop the service.

        This method is a coroutine.
        z*ssl argument must be an SSLContext or NoneNz8host/port and sock can not be specified at the same timer+rr�r�r#c	s.g|]$}�j|�d�d���qS)r3rk)r�)r�r1)r3rkr2rIrrr��s	z/BaseEventLoop.create_server.<locals>.<listcomp>rJFz:create_server() failed to create socket.socket(%r, %r, %r)�exc_infoTr�z)reuse_port not supported by socket module�IPPROTO_IPV6z0error while attempting to bind on address %r: %sz)Neither host/port nor sock were specifiedz
%r is serving))rrmr}r/�getattrr%rnr�rjr�rr`�IterablerZgather�	itertools�chain�
from_iterable�errorr�r	�warningrXr�r�r�r)r�r�ZIPV6_V6ONLYr�r-r�r�r�rRrEZlistenr�Z_start_servingr�)rIr�r1r2r3rkr;r�r�r�r�r+rFZhostsr�r�Z	completed�resr6Zsocktyper5Z	canonnameZsa�errr�r)r3rkr2rIr�
create_servercs�!

		

0

	


	zBaseEventLoop.create_serverccs�|�}tjd|�}|j|||�}y
|DdHWn|j��YnX|jr}tjd|j�||�n||fS)NrJz Read pipe %r connected: (%r, %r))rrWr�rRr�r	r��fileno)rIr�r�r�rVr�rrr�connect_read_pipe�s	

		zBaseEventLoop.connect_read_pipeccs�|�}tjd|�}|j|||�}y
|DdHWn|j��YnX|jr}tjd|j�||�n||fS)NrJz!Write pipe %r connected: (%r, %r))rrWr�rRr�r	r�r)rIr�r�r�rVr�rrr�connect_write_pipe�s	

		z BaseEventLoop.connect_write_pipecCs�|g}|dk	r/|jdt|��n|dk	rd|tjkrd|jdt|��nL|dk	r�|jdt|��n|dk	r�|jdt|��ntjdj|��dS)Nzstdin=%szstdout=stderr=%sz	stdout=%sz	stderr=%s� )rXrrrr	r�r�)rIr�r�r�r�r�rrr�_log_subprocess�s	zBaseEventLoop._log_subprocessr�r�r��universal_newlinesr�Tr�c
	ks�t|ttf�s$td��n|r9td��n|sNtd��n|dkritd��n|�}
|jr�d|}|j||||�n|j|
|d|||||	�DdH}|jr�tjd||f�n||
fS)	Nzcmd must be a stringz universal_newlines must be Falsezshell must be Truerzbufsize must be 0zrun shell command %rTz%s: %r)	r�bytesrr/r�rr�r	r�)
rIr��cmdr�r�r�rr�r�r�r��	debug_logr�rrr�subprocess_shell�s"		
#	zBaseEventLoop.subprocess_shellc	os|rtd��n|r*td��n|dkrEtd��n|f|	}x?|D]7}t|ttf�sYtdt|�j��qYqYW|�}
|jr�d|}|j||||�n|j	|
|d|||||
�DdH}|jrt
jd||f�n||
fS)	Nz universal_newlines must be Falsezshell must be Falserzbufsize must be 0z8program arguments must be a bytes or text string, not %szexecute program %rFz%s: %r)r/rrr	r}r4rMr�rr�r	r�)rIr�Zprogramr�r�r�rr�r�r�r�Z
popen_args�argr�rr�rrr�subprocess_execs*

		
	zBaseEventLoop.subprocess_execcCs>|dk	r1t|�r1tdj|���n||_dS)a�Set handler as the new event loop exception handler.

        If handler is None, the default exception handler will
        be set.

        If handler is a callable object, it should have a
        signature matching '(loop, context)', where 'loop'
        will be a reference to the active event loop, 'context'
        will be a dict object (see `call_exception_handler()`
        documentation for details about context).
        Nz/A callable object or None is expected, got {!r})r|r}r�rh)rIZhandlerrrr�set_exception_handler0s	z#BaseEventLoop.set_exception_handlerc	Cs�|jd�}|sd}n|jd�}|dk	rTt|�||jf}nd}d|kr�|jdk	r�|jjr�|jj|d<n|g}x�t|�D]�}|dkr�q�n||}|dkr	djtj|��}d	}||j	�7}nI|dkrFdjtj|��}d
}||j	�7}nt
|�}|jdj||��q�Wt
jdj|�d
|�dS)a@Default exception handler.

        This is called when an exception occurs and no exception
        handler is set, and can be called by a custom exception
        handler that wants to defer to the default behavior.

        The context parameter has the same meaning as in
        `call_exception_handler()`.
        �messagez!Unhandled exception in event loopr�NFZsource_tracebackZhandle_tracebackr#z+Object created at (most recent call last):
z+Handle created at (most recent call last):
z{}: {}�
r�>�	exception�message)rpr4�
__traceback__rrrz�sortedr��	traceback�format_list�rstriprrXr�r	r�)	rI�contextrr�r�Z	log_linesr��value�tbrrr�default_exception_handlerAs6
		
z'BaseEventLoop.default_exception_handlercCs�|jdkrKy|j|�Wq�tk
rGtjddd�Yq�Xn�y|j||�Wnstk
r�}zSy&|jidd6|d6|d6�Wn%tk
r�tjd	dd�YnXWYdd}~XnXdS)
a�Call the current event loop's exception handler.

        The context argument is a dict containing the following keys:

        - 'message': Error message;
        - 'exception' (optional): Exception object;
        - 'future' (optional): Future instance;
        - 'handle' (optional): Handle instance;
        - 'protocol' (optional): Protocol instance;
        - 'transport' (optional): Transport instance;
        - 'socket' (optional): Socket instance.

        New keys maybe introduced in the future.

        Note: do not overload this method in an event loop subclass.
        For custom exception handling, use the
        `set_exception_handler()` method.
        Nz&Exception in default exception handlerr�Tz$Unhandled error in exception handlerrr�rzeException in default exception handler while handling an unexpected error in custom exception handler)rhrr?r	r�)rIrrCrrr�call_exception_handlerms"
	
z$BaseEventLoop.call_exception_handlercCs!|jr
dS|jj|�dS)z3Add a Handle to _scheduled (TimerHandle) or _ready.N)r�rbrX)rIrrrr�
_add_callback�s	zBaseEventLoop._add_callbackcCs|j|�|j�dS)z6Like _add_callback() but called from a signal handler.N)rr�)rIrrrr�_add_callback_signalsafe�s
z&BaseEventLoop._add_callback_signalsafecCs|jr|jd7_ndS)z3Notification that a TimerHandle has been cancelled.rN)rcr])rIrrrr�_timer_handle_cancelled�s	z%BaseEventLoop._timer_handle_cancelledcCs{t|j�}|tkr�|j|tkr�g}x3|jD](}|jrYd|_q>|j|�q>Wtj|�||_d|_nJxG|jr�|jdjr�|jd8_tj	|j�}d|_q�Wd}|j
s�|jr�d}n5|jr,|jdj}t
d||j��}n|jr|dkr|j�}|jj|�}|j�|}|dkr�tj}	n	tj}	t|�}
|dkr�tj|	d|d|
�q1|
r�tj|	d|d|d|
�q1|dkr1tj|	d	|d|d�q1n|jj|�}|j|�|j�|j}xX|jr�|jd}|j|kr}Pntj	|j�}d|_|j
j|�qTWt|j
�}x�t|�D]�}
|j
j�}|jr�q�n|jrcz^||_|j�}|j�|j�|}||jkrRtjd
t|�|�nWdd|_Xq�|j�q�Wd}dS)z�Run one full iteration of the event loop.

        This calls all currently ready callbacks, polls for I/O,
        schedules the resulting callbacks, and finally schedules
        'call_later' callbacks.
        FrrNg�?zpoll took %.3f ms: %s eventsg@�@z$poll %.3f ms took %.3f ms: %s eventsz"poll %.3f ms took %.3f ms: timeoutzExecuting %s took %.3f seconds) r�rc�_MIN_SCHEDULED_TIMER_HANDLESr]�%_MIN_CANCELLED_TIMER_HANDLES_FRACTIONr�rXr��heapify�heappoprbr_Z_when�maxrfr�Z	_selectorZselect�logging�INFO�DEBUGr	�logr�rg�range�popleftrrZ_runrqr�r)rIZsched_countZ
new_scheduledrZtimeoutr�r�r�r��levelZneventZend_timeZntodo�irrrr��s�
		
	
					

				
	
zBaseEventLoop._run_oncecCs�ytj}tj}Wntk
r.dSYnXt|�}|j|krNdStj}|�}|r�|d|fkr�tj	d|t
�q�||�d|_n<|d|fkr�tj	d|t
�n|d�d|_dS)Nz[loop.set_debug(True): cannot set debug coroutine wrapper; another wrapper is already set %rTzWloop.set_debug(False): cannot unset debug coroutine wrapper; another wrapper was set %rF)rjZset_coroutine_wrapperZget_coroutine_wrapper�AttributeErrorrmrtrZ
debug_wrapperr�r��RuntimeWarning)rI�enabledZset_wrapperZget_wrapper�wrapperZcurrent_wrapperrrrr�s.	

			

z$BaseEventLoop._set_coroutine_wrappercCs|jS)N)r�)rIrrrrw3szBaseEventLoop.get_debugcCs)||_|j�r%|j|�ndS)N)r�rur�)rIr0rrrri6s	zBaseEventLoop.set_debug)@rMrZr[rKrNr{r~rr�r�r�r�r�rr�r�r�ryr�r�rArRrvrZPY34r�rurfr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r%r*Z
AI_PASSIVErrrrrrrrrrrrrr r�r�rwrirrrrr
�s�	$		!
	y	w				^
	,0c!)-�__doc__r`Zconcurrent.futuresr��	functoolsr�rr.r�r&rnr%rr�rfrrjr�r#rrrrrrr)r	�__all__r�r!r"rrr&r)rr�	lru_cacher8r=rDZAbstractServerrEZAbstractEventLoopr
rrrr�<module>sN		
:

/


Current_dir [ NOT WRITEABLE ] Document_root [ NOT WRITEABLE ]


[ Back ]
NAME
SIZE
LAST TOUCH
USER
CAN-I?
FUNCTIONS
..
--
24 May 2024 8.33 AM
root / linksafe
0755
__init__.cpython-34.pyc
0.85 KB
17 Apr 2024 5.10 PM
root / linksafe
0644
__init__.cpython-34.pyo
0.85 KB
17 Apr 2024 5.10 PM
root / linksafe
0644
base_events.cpython-34.pyc
37.272 KB
17 Apr 2024 5.10 PM
root / linksafe
0644
base_events.cpython-34.pyo
36.948 KB
17 Apr 2024 5.10 PM
root / linksafe
0644
base_subprocess.cpython-34.pyc
9.591 KB
17 Apr 2024 5.10 PM
root / linksafe
0644
base_subprocess.cpython-34.pyo
9.469 KB
17 Apr 2024 5.10 PM
root / linksafe
0644
compat.cpython-34.pyc
0.733 KB
17 Apr 2024 5.10 PM
root / linksafe
0644
compat.cpython-34.pyo
0.733 KB
17 Apr 2024 5.10 PM
root / linksafe
0644
constants.cpython-34.pyc
0.236 KB
17 Apr 2024 5.10 PM
root / linksafe
0644
constants.cpython-34.pyo
0.236 KB
17 Apr 2024 5.10 PM
root / linksafe
0644
coroutines.cpython-34.pyc
8.498 KB
17 Apr 2024 5.10 PM
root / linksafe
0644
coroutines.cpython-34.pyo
8.368 KB
17 Apr 2024 5.10 PM
root / linksafe
0644
events.cpython-34.pyc
23.621 KB
17 Apr 2024 5.10 PM
root / linksafe
0644
events.cpython-34.pyo
23.417 KB
17 Apr 2024 5.10 PM
root / linksafe
0644
futures.cpython-34.pyc
15.293 KB
17 Apr 2024 5.10 PM
root / linksafe
0644
futures.cpython-34.pyo
15.025 KB
17 Apr 2024 5.10 PM
root / linksafe
0644
locks.cpython-34.pyc
15.329 KB
17 Apr 2024 5.10 PM
root / linksafe
0644
locks.cpython-34.pyo
15.329 KB
17 Apr 2024 5.10 PM
root / linksafe
0644
log.cpython-34.pyc
0.238 KB
17 Apr 2024 5.10 PM
root / linksafe
0644
log.cpython-34.pyo
0.238 KB
17 Apr 2024 5.10 PM
root / linksafe
0644
proactor_events.cpython-34.pyc
17.587 KB
17 Apr 2024 5.10 PM
root / linksafe
0644
proactor_events.cpython-34.pyo
17.347 KB
17 Apr 2024 5.10 PM
root / linksafe
0644
protocols.cpython-34.pyc
5.948 KB
17 Apr 2024 5.10 PM
root / linksafe
0644
protocols.cpython-34.pyo
5.948 KB
17 Apr 2024 5.10 PM
root / linksafe
0644
queues.cpython-34.pyc
8.722 KB
17 Apr 2024 5.10 PM
root / linksafe
0644
queues.cpython-34.pyo
8.722 KB
17 Apr 2024 5.10 PM
root / linksafe
0644
selector_events.cpython-34.pyc
30.271 KB
17 Apr 2024 5.10 PM
root / linksafe
0644
selector_events.cpython-34.pyo
30.208 KB
17 Apr 2024 5.10 PM
root / linksafe
0644
sslproto.cpython-34.pyc
20.805 KB
17 Apr 2024 5.10 PM
root / linksafe
0644
sslproto.cpython-34.pyo
20.56 KB
17 Apr 2024 5.10 PM
root / linksafe
0644
streams.cpython-34.pyc
20.356 KB
17 Apr 2024 5.10 PM
root / linksafe
0644
streams.cpython-34.pyo
20.008 KB
17 Apr 2024 5.10 PM
root / linksafe
0644
subprocess.cpython-34.pyc
6.984 KB
17 Apr 2024 5.10 PM
root / linksafe
0644
subprocess.cpython-34.pyo
6.949 KB
17 Apr 2024 5.10 PM
root / linksafe
0644
tasks.cpython-34.pyc
22.315 KB
17 Apr 2024 5.10 PM
root / linksafe
0644
tasks.cpython-34.pyo
22.116 KB
17 Apr 2024 5.10 PM
root / linksafe
0644
test_utils.cpython-34.pyc
15.955 KB
17 Apr 2024 5.10 PM
root / linksafe
0644
test_utils.cpython-34.pyo
15.558 KB
17 Apr 2024 5.10 PM
root / linksafe
0644
transports.cpython-34.pyc
11.878 KB
17 Apr 2024 5.10 PM
root / linksafe
0644
transports.cpython-34.pyo
11.843 KB
17 Apr 2024 5.10 PM
root / linksafe
0644
unix_events.cpython-34.pyc
30.643 KB
17 Apr 2024 5.10 PM
root / linksafe
0644
unix_events.cpython-34.pyo
30.241 KB
17 Apr 2024 5.10 PM
root / linksafe
0644
windows_events.cpython-34.pyc
22.762 KB
17 Apr 2024 5.10 PM
root / linksafe
0644
windows_events.cpython-34.pyo
22.762 KB
17 Apr 2024 5.10 PM
root / linksafe
0644
windows_utils.cpython-34.pyc
5.804 KB
17 Apr 2024 5.10 PM
root / linksafe
0644
windows_utils.cpython-34.pyo
5.704 KB
17 Apr 2024 5.10 PM
root / linksafe
0644

GRAYBYTE WORDPRESS FILE MANAGER @ 2025 CONTACT ME
Static GIF