AlkantarClanX12

Your IP : 3.142.98.60


Current Path : /opt/alt/python36/lib64/python3.6/multiprocessing/__pycache__/
Upload File :
Current File : //opt/alt/python36/lib64/python3.6/multiprocessing/__pycache__/managers.cpython-36.pyc

3

� f��@s�ddddgZddlZddlZddlZddlZddlZddlmZddlm	Z	dd	l
mZmZdd
lm
Z
ddlmZddlmZdd
lmZdd�Zejeje�dd�d�D�Zedek	r�dd�ZxeD]Zejee�q�WGdd�de�Zfifdd�Zdd�ZGdd�de�Zdd�Zd d!�ZGd"d#�d#e�ZGd$d%�d%e�Z e	j!e	j"fe	j#e	j$fd&�Z%Gd'd�de�Z&Gd(d)�d)e'�Z(Gd*d�de�Z)d+d,�Z*ifd-d.�Z+d�d0d1�Z,Gd2d3�d3e�Z-Gd4d5�d5e�Z.d�d6d7�Z/Gd8d9�d9e)�Z0Gd:d;�d;e)�Z1Gd<d=�d=e1�Z2Gd>d?�d?e)�Z3Gd@dA�dAe)�Z4GdBdC�dCe)�Z5GdDdE�dEe)�Z6e+dFd��Z7GdZd[�d[e7�Z8e+d\d��Z9d]deie9_:e+dfd��Z;e+dgd��Z<dsdsdsdededt�e<_:Gdudg�dge<�Z=Gdvd�de&�Z>e>jdwej?�e>jdxej?�e>jdyej@e3�e>jdzejAe1�e>jd{ejBe1�e>jd|ejCe1�e>jd}ejDe1�e>jd~ejEe2�e>jdejFe4�e>jd�e
jGe=�e>jd�ee8�e>jd�eHe9�e>jd5e.e6�e>jd7e/e;�e>jd3e-e5�e>jdee0d�d��e>jdsd�d��dS)��BaseManager�SyncManager�	BaseProxy�Token�N)�
format_exc�)�
connection)�	reduction�get_spawning_popen)�pool)�process)�util)�get_contextcCstj|j|j�ffS)N)�array�typecode�tobytes)�a�r�=/opt/alt/python36/lib64/python3.6/multiprocessing/managers.py�reduce_array$srcCsg|]}tti|����qSr)�type�getattr)�.0�namerrr�
<listcomp>(sr�items�keys�valuescCstt|�ffS)N)�list)�objrrr�rebuild_as_list*sr c@s4eZdZdZdZdd�Zdd�Zd	d
�Zdd�Zd
S)rz4
    Type to uniquely indentify a shared object
    �typeid�address�idcCs||||_|_|_dS)N)r!r"r#)�selfr!r"r#rrr�__init__9szToken.__init__cCs|j|j|jfS)N)r!r"r#)r$rrr�__getstate__<szToken.__getstate__cCs|\|_|_|_dS)N)r!r"r#)r$�staterrr�__setstate__?szToken.__setstate__cCsd|jj|j|j|jfS)Nz %s(typeid=%r, address=%r, id=%r))�	__class__�__name__r!r"r#)r$rrr�__repr__BszToken.__repr__N)r!r"r#)	r*�
__module__�__qualname__�__doc__�	__slots__r%r&r(r+rrrrr3scCs8|j||||f�|j�\}}|dkr*|St||��dS)zL
    Send a message to manager using connection `c` and return response
    z#RETURNN)�send�recv�convert_to_error)�cr#�
methodname�args�kwds�kind�resultrrr�dispatchJs
r9cCs\|dkr|S|dkr,t|�tks$t�t|�S|dkrPt|�tksDt�td|�Std�SdS)Nz#ERRORz
#TRACEBACKz#UNSERIALIZABLEzUnserializable message: %s
zUnrecognized message type)r�str�AssertionError�RemoteError�
ValueError)r7r8rrrr2Tsr2c@seZdZdd�ZdS)r<cCs&ddddt|jd�ddS)N�
�-�Kr)r:r5)r$rrr�__str__aszRemoteError.__str__N)r*r,r-rArrrrr<`sr<cCs6g}x,t|�D] }t||�}t|�r|j|�qW|S)z4
    Return a list of names of methods of `obj`
    )�dirr�callable�append)r�tempr�funcrrr�all_methodshs
rGcCsdd�t|�D�S)zP
    Return a list of names of methods of `obj` which do not start with '_'
    cSsg|]}|ddkr|�qS)r�_r)rrrrrrwsz"public_methods.<locals>.<listcomp>)rG)rrrr�public_methodsssrIc	@s�eZdZdZdddddddd	d
g	Zdd�Zd
d�Zdd�Zdd�Zdd�Z	dd�Z
dd�Zdd�Zeee
d�Z
dd�Zdd�Zd d!�Zd"d#�Zd$d%�Zd&d'�Zd(d)�Zd*d+�Zd,d-�Zd.S)/�ServerzM
    Server class which runs in a process controlled by a manager object
    �shutdown�create�accept_connection�get_methods�
debug_info�number_of_objects�dummy�incref�decrefcCslt|t�st�||_tj|�|_t|\}}||dd�|_|jj	|_	ddffi|_
i|_i|_t
j�|_dS)N�)r"Zbacklog�0)�
isinstance�bytesr;�registryr�AuthenticationString�authkey�listener_client�listenerr"�	id_to_obj�id_to_refcount�id_to_local_proxy_obj�	threading�Lock�mutex)r$rXr"rZ�
serializer�Listener�Clientrrrr%�s
zServer.__init__cCs�tj�|_|tj�_zZtj|jd�}d|_|j	�y x|jj
�sN|jjd�q6WWntt
fk
rjYnXWdtjtjkr�tjd�tjt_tjt_tjd�XdS)z(
        Run the server forever
        )�targetTrNzresetting stdout, stderrr)r`�Event�
stop_eventr�current_process�_manager_server�Thread�accepter�daemon�start�is_set�wait�KeyboardInterrupt�
SystemExit�sys�stdout�
__stdout__r
�debug�
__stderr__�stderr�exit)r$rlrrr�
serve_forever�s 



zServer.serve_forevercCsPxJy|jj�}Wntk
r&wYnXtj|j|fd�}d|_|j�qWdS)N)rfr5T)r\Zaccept�OSErrorr`rk�handle_requestrmrn)r$r3�trrrrl�szServer.accepterc'CsLd}}}yTtj||j�tj||j�|j�}|\}}}}||jksTtd|��t||�}Wntk
r~dt	�f}	Yn>Xy||f|�|�}Wntk
r�dt	�f}	Yn
Xd|f}	y|j
|	�Wnttk
�r>}
zVy|j
dt	�f�Wntk
�rYnXtjd|	�tjd|�tjd|
�WYdd}
~
XnX|j
�dS)z)
        Handle a new connection
        Nz%r unrecognizedz
#TRACEBACKz#RETURNzFailure to send message: %rz ... request was %rz ... exception was %r)rZdeliver_challengerZZanswer_challenger1�publicr;r�	Exceptionrr0r
�info�close)r$r3�funcnamer8�request�ignorer5r6rF�msg�errrr|�s4zServer.handle_requestcDCs�tjdtj�j�|j}|j}|j}�x�|jj	��s�yBd}}|�}|\}}}	}
y||\}}}Wn^t
k
r�}
zBy|j|\}}}Wn&t
k
r�}z
|
�WYdd}~XnXWYdd}
~
XnX||kr�td|t
|�|f��t||�}y||	|
�}Wn,tk
�r&}zd|f}WYdd}~XnPX|�o8|j|d�}|�rn|j|||�\}}t||j|�}d||ff}nd|f}Wn�tk
�r�|dk�r�dt�f}nNy,|j|}|||||f|	�|
�}d|f}Wn tk
�r�dt�f}YnXYnPtk
�r"tjdtj�j�tjd	�Yn tk
�r@dt�f}YnXyDy||�Wn2tk
�r�}z|d
t�f�WYdd}~XnXWq(tk
�r�}zBtjdtj�j�tjd|�tjd
|�|j�tjd�WYdd}~Xq(Xq(WdS)zQ
        Handle requests from the proxies in a particular process/thread
        z$starting server thread to service %rNz+method %r of %r object is not in exposed=%rz#ERRORz#PROXYz#RETURNz
#TRACEBACKz$got EOF -- exiting thread serving %rrz#UNSERIALIZABLEzexception in thread serving %rz ... message was %rz ... exception was %rr)r
rvr`�current_threadrr1r0r]rhro�KeyErrorr_�AttributeErrorrrr�getrLrr"r�fallback_mapping�EOFErrorrsryr�r�)r$�connr1r0r]r4rr��identr5r6�exposed�	gettypeid�keZ	second_keZfunction�resr�r�r!ZridentZrexposed�tokenZ
fallback_funcr8rrr�serve_client�sx(


$zServer.serve_clientcCs|S)Nr)r$r�r�rrrr�fallback_getvalue&szServer.fallback_getvaluecCst|�S)N)r:)r$r�r�rrrr�fallback_str)szServer.fallback_strcCst|�S)N)�repr)r$r�r�rrrr�
fallback_repr,szServer.fallback_repr)rAr+z	#GETVALUEcCsdS)Nr)r$r3rrrrQ5szServer.dummycCs||j�lg}t|jj��}|j�xD|D]<}|dkr(|jd||j|t|j|d�dd�f�q(Wdj|�SQRXdS)zO
        Return some info --- useful to spot problems with refcounting
        rUz  %s:       refcount=%s
    %srNr@r>)	rbrr^r�sortrDr:r]�join)r$r3r8rr�rrrrO8s

$zServer.debug_infocCs
t|j�S)z*
        Number of shared objects
        )�lenr^)r$r3rrrrPGszServer.number_of_objectscCsLz:ytjd�|jd�Wnddl}|j�YnXWd|jj�XdS)z'
        Shutdown this process
        z!manager received shutdown message�#RETURNNr)r�N)r
rvr0�	traceback�	print_excrh�set)r$r3r�rrrrKNs
zServer.shutdowncOs�|j��|j|\}}}}|dkrBt|�dkr4|s8t�|d}	n
|||�}	|dkr\t|	�}|dk	r�t|�tkstt�t|�t|�}dt|	�}
t	j
d||
�|	t|�|f|j|
<|
|j
kr�d|j
|
<WdQRX|j||
�|
t|�fS)z>
        Create a new shared object and return its id
        Nrrz%xz&%r callable returned object with id %r)rbrXr�r;rIr�dictrr#r
rvr�r]r^rR�tuple)r$r3r!r5r6rCr��method_to_typeid�	proxytyperr�rrrrL[s$


z
Server.createcCst|j|jd�S)zL
        Return the methods of the shared object indicated by token
        r)r�r]r#)r$r3r�rrrrNzszServer.get_methodscCs"|tj�_|jd�|j|�dS)z=
        Spawn a new thread to serve this connection
        �#RETURNN)r�N)r`r�rr0r�)r$r3rrrrrM�s

zServer.accept_connectioncCs�|j��y|j|d7<Wnhtk
r�}zL||jkrrd|j|<|j||j|<|j|\}}}tjd|�n|�WYdd}~XnXWdQRXdS)Nrz&Server re-enabled tracking & INCREF %r)rbr^r�r_r]r
rv)r$r3r�r�rr�r�rrrrR�s

z
Server.increfcCs�||jkr$||jkr$tjd|�dS|j�@|j|dks>t�|j|d8<|j|dkrf|j|=WdQRX||jkr�dfdf|j|<tjd|�|j�|j|=WdQRXdS)NzServer DECREF skipping %rrrzdisposing of obj with id %r)r^r_r
rvrbr;r])r$r3r�rrrrS�s


z
Server.decrefN)r*r,r-r.r~r%rzrlr|r�r�r�r�r�rQrOrPrKrLrNrMrRrSrrrrrJ}s.
"Q
rJc@seZdZdgZdZdZdZdS)�State�valuerr�N)r*r,r-r/�INITIAL�STARTED�SHUTDOWNrrrrr��sr�)�pickleZ	xmlrpclibc@s�eZdZdZiZeZd!dd�Zdd�Zdd	�Z	dffd
d�Z
edffdd
��Zdd�Z
d"dd�Zdd�Zdd�Zdd�Zdd�Zedd��Zedd��Zed#dd ��ZdS)$rz!
    Base class for managers
    Nr�cCs\|dkrtj�j}||_tj|�|_t�|_tj|j_	||_
t|\|_|_
|pTt�|_dS)N)rrirZ�_addressrY�_authkeyr��_stater�r��_serializerr[Z	_Listener�_Clientr�_ctx)r$r"rZrcZctxrrrr%�s

zBaseManager.__init__cCs(|jjtjkst�t|j|j|j|j	�S)zX
        Return server object with serve_forever() method and address attribute
        )
r�r�r�r�r;rJ�	_registryr�r�r�)r$rrr�
get_server�s
zBaseManager.get_servercCs8t|j\}}||j|jd�}t|dd�tj|j_dS)z>
        Connect manager object to the server process
        )rZNrQ)	r[r�r�r�r9r�r�r�r�)r$rdrer�rrr�connect�szBaseManager.connectc	Cs�|jjtjkst�|dk	r,t|�r,td��tjdd�\}}|j	j
t|�j|j
|j|j|j|||fd�|_djdd�|jjD��}t|�jd	||j_|jj�|j�|j�|_|j�tj|j_tj|t|�j|j|j|j|j|jfd
d�|_dS)z@
        Spawn a server process for this manager object
        Nzinitializer must be a callableF)Zduplex)rfr5�:css|]}t|�VqdS)N)r:)r�irrr�	<genexpr>�sz$BaseManager.start.<locals>.<genexpr>r?r)r5�exitpriority)r�r�r�r�r;rC�	TypeErrorrZPiper�ZProcessr�_run_serverr�r�r�r��_processr�Z	_identityr*rrnr�r1r�r
�Finalize�_finalize_managerr�rK)r$�initializer�initargs�reader�writerr�rrrrn�s(




zBaseManager.startc	CsN|dk	r||�|j||||�}|j|j�|j�tjd|j�|j�dS)z@
        Create a server, report its address and run it
        Nzmanager serving at %r)�_Serverr0r"r�r
r�rz)	�clsrXr"rZrcr�r�r��serverrrrr�szBaseManager._run_servercOsd|jjtjkstd��|j|j|jd�}zt|dd|f||�\}}Wd|j	�Xt
||j|�|fS)zP
        Create a new shared object; return the token and exposed tuple
        zserver not yet started)rZNrL)r�r�r�r�r;r�r�r�r9r�r)r$r!r5r6r�r#r�rrr�_create%s
zBaseManager._createcCs*|jdk	r&|jj|�|jj�s&d|_dS)zC
        Join the manager process (if it has been spawned)
        N)r�r��is_alive)r$�timeoutrrrr�1s

zBaseManager.joinc
Cs.|j|j|jd�}zt|dd�S|j�XdS)zS
        Return some info about the servers shared objects and connections
        )rZNrO)r�r�r�r9r�)r$r�rrr�_debug_info:szBaseManager._debug_infoc
Cs.|j|j|jd�}zt|dd�S|j�XdS)z5
        Return the number of shared objects
        )rZNrP)r�r�r�r9r�)r$r�rrr�_number_of_objectsDszBaseManager._number_of_objectscCs,|jjtjkr|j�|jjtjks(t�|S)N)r�r�r�r�rnr�r;)r$rrr�	__enter__NszBaseManager.__enter__cCs|j�dS)N)rK)r$�exc_type�exc_val�exc_tbrrr�__exit__TszBaseManager.__exit__cCs�|j�r�tjd�y,|||d�}zt|dd�Wd|j�XWntk
rRYnX|jdd�|j�r�tjd�t|d�r�tjd	�|j�|jd
d�|j�r�tjd�t	j
|_ytj
|=Wntk
r�YnXdS)zQ
        Shutdown the manager process; will be registered as a finalizer
        z#sending shutdown message to manager)rZNrKg�?)r�zmanager still alive�	terminatez'trying to `terminate()` manager processg�������?z#manager still alive after terminate)r�r
r�r9r�rr��hasattrr�r�r�r�r�_address_to_localr�)rr"rZr'r�r�rrrr�Ws.




zBaseManager._finalize_managercCs|jS)N)r�)r$rrr�<lambda>wszBaseManager.<lambda>Tc
s�d|jkr|jj�|_�dkr"t�|p0t�dd�}|p@t�dd�}|r�xHt|j��D]8\}}t|�tkstt	d|��t|�tksTt	d|��qTW|||�f|j�<|rƇ�fdd�}	�|	_
t|�|	�dS)z9
        Register a typeid with the manager type
        r�N�	_exposed_�_method_to_typeid_z%r is not a stringcs`tjd��|j�f|�|�\}}�||j||j|d�}|j|j|jd�}t|dd|jf�|S)Nz)requesting creation of a shared %r object)�managerrZr�)rZrS)	r
rvr�r�r�r�r"r9r#)r$r5r6r�Zexp�proxyr�)r�r!rrrE�sz"BaseManager.register.<locals>.temp)�__dict__r��copy�	AutoProxyrrrrr:r;r*�setattr)
r�r!rCr�r�r��
create_method�keyr�rEr)r�r!r�registerys 

zBaseManager.register)NNr�N)N)NNNNT)r*r,r-r.r�rJr�r%r�r�rn�classmethodr�r�r�r�r�r�r��staticmethodr��propertyr"r�rrrrr�s*
	$
	

 c@seZdZdd�Zdd�ZdS)�ProcessLocalSetcCstj|dd��dS)NcSs|j�S)N)�clear)rrrrr��sz*ProcessLocalSet.__init__.<locals>.<lambda>)r
�register_after_fork)r$rrrr%�szProcessLocalSet.__init__cCst|�ffS)N)r)r$rrr�
__reduce__�szProcessLocalSet.__reduce__N)r*r,r-r%r�rrrrr��sr�c@s�eZdZdZiZej�Zddd�Zdd�Z	fifd	d
�Z
dd�Zd
d�Ze
dd��Zdd�Zdd�Zdd�Zdd�Zdd�ZdS)rz.
    A base for proxies of shared objects
    NTFc	
Cs�tj�8tjj|jd�}|dkr:tj�t�f}|tj|j<WdQRX|d|_|d|_	||_
|j
j|_||_
||_t|d|_||_|dk	r�tj|�|_n"|j
dk	r�|j
j|_ntj�j|_|r�|j�tj|tj�dS)Nrr)r�_mutexr�r�r"r
ZForkAwareLocalr��_tls�_idset�_tokenr#�_id�_managerr�r[r��_owned_by_managerrrYr�rirZ�_increfr��_after_fork)	r$r�rcr�rZr�rR�
manager_ownedZ	tls_idsetrrrr%�s*



zBaseProxy.__init__cCsdtjd�tj�j}tj�jdkr4|dtj�j7}|j|jj	|j
d�}t|dd|f�||j_
dS)Nzmaking connection to managerZ
MainThread�|)rZrM)r
rvrrirr`r�r�r�r"r�r9r�r)r$rr�rrr�_connect�s

zBaseProxy._connectcCs�y|jj}Wn6tk
rBtjdtj�j�|j�|jj}YnX|j	|j
|||f�|j�\}}|dkrp|S|dkr�|\}}|jj
|jd	}	|jj|_|	||j|j|j|d�}
|j|j|jd�}t|dd|jf�|
St||��dS)
zW
        Try to call a method of the referrent and return a copy of the result
        z#thread %r does not own a connectionz#RETURNz#PROXYr)r�rZr�)rZNrS���)r�rr�r
rvr`r�rr�r0r�r1r�r�r!r�r"r�r�r�r9r#r2)r$r4r5r6r�r7r8r�r�r�r�rrr�_callmethod�s,

zBaseProxy._callmethodcCs
|jd�S)z9
        Get a copy of the value of the referent
        z	#GETVALUE)r�)r$rrr�	_getvalueszBaseProxy._getvaluec	Cs�|jrtjd|jj�dS|j|jj|jd�}t|dd|j	f�tjd|jj�|j
j|j	�|joj|jj
}tj|tj|j|j||j|j
|jfdd�|_dS)Nz%owned_by_manager skipped INCREF of %r)rZrRz	INCREF %r�
)r5r�)r�r
rvr�r#r�r"r�r9r�r��addr�r�r�r�_decrefr�Z_close)r$r�r'rrrr�s
zBaseProxy._increfcCs�|j|j�|dks |jtjkr�y2tjd|j�||j|d�}t|dd|jf�Wq�t	k
r�}ztjd|�WYdd}~Xq�Xntjd|j�|r�t
|d�r�tjdtj�j
�|jj�|`dS)Nz	DECREF %r)rZrSz... decref failed %sz%DECREF %r -- manager already shutdownrz-thread %r has no more proxies so closing conn)�discardr#r�r�r�r
rvr"r9rr�r`r�rrr�)r�rZr'ZtlsZidsetr�r�r�rrrr� s 
zBaseProxy._decrefcCsHd|_y|j�Wn0tk
rB}ztjd|�WYdd}~XnXdS)Nzincref failed: %s)r�r�rr
r�)r$r�rrrr�9s
zBaseProxy._after_forkcCs^i}t�dk	r|j|d<t|dd�rB|j|d<tt|j|j|ffStt|�|j|j|ffSdS)NrZ�_isautoFr�)	r
r�rr��RebuildProxyr�r�r�r)r$r6rrrr�As


zBaseProxy.__reduce__cCs|j�S)N)r�)r$�memorrr�__deepcopy__NszBaseProxy.__deepcopy__cCsdt|�j|jjt|�fS)Nz<%s object, typeid %r at %#x>)rr*r�r!r#)r$rrrr+QszBaseProxy.__repr__cCs4y
|jd�Stk
r.t|�dd�dSXdS)zV
        Return representation of the referent (or a fall-back if that fails)
        r+Nrz; '__str__()' failed>r�)r�rr�)r$rrrrAUs
zBaseProxy.__str__)NNNTF)r*r,r-r.r�r
ZForkAwareThreadLockr�r%r�r�r�r�r�r�r�r�r�r+rArrrrr�s
(	
cCs�ttj�dd�}|rT|j|jkrTtjd|�d|d<|j|jkrT|j|j|j|j<|j	dd�opttj�dd�}|||fd|i|��S)	z5
    Function used for unpickling proxy objects.
    rjNz*Rebuild a proxy owned by manager, token=%rTr�rRZ_inheritingF)
rrrir"r
rvr#r_r]�pop)rFr�rcr6r�rRrrrr�bsr�c
Csrt|�}y|||fStk
r(YnXi}x|D]}td||f|�q4Wt|tf|�}||_||||f<|S)zB
    Return a proxy type whose methods are given by `exposed`
    zLdef %s(self, *args, **kwds):
        return self._callmethod(%r, args, kwds))r�r��execrrr�)rr��_cacheZdic�meth�	ProxyTyperrr�
MakeProxyTypews
rTc
Cs�t|d}|dkrB||j|d�}zt|dd|f�}Wd|j�X|dkrX|dk	rX|j}|dkrjtj�j}td|j	|�}||||||d�}	d|	_
|	S)z*
    Return an auto-proxy for `token`
    rN)rZrNz
AutoProxy[%s])r�rZrRT)r[r"r9r�r�rrirZrr!r�)
r�rcr�rZr�rRr�r�rr�rrrr��s


r�c@seZdZdd�Zdd�ZdS)�	NamespacecKs|jj|�dS)N)r��update)r$r6rrrr%�szNamespace.__init__cCs^t|jj��}g}x,|D]$\}}|jd�s|jd||f�qW|j�d|jjdj|�fS)NrHz%s=%rz%s(%s)z, )	rr�r�
startswithrDr�r)r*r�)r$rrErr�rrrr+�s
zNamespace.__repr__N)r*r,r-r%r+rrrrr�src@s8eZdZddd�Zdd�Zdd�Zdd	�Zeee�Zd
S)�ValueTcCs||_||_dS)N)�	_typecode�_value)r$rr��lockrrrr%�szValue.__init__cCs|jS)N)r)r$rrrr��sz	Value.getcCs
||_dS)N)r)r$r�rrrr��sz	Value.setcCsdt|�j|j|jfS)Nz
%s(%r, %r))rr*rr)r$rrrr+�szValue.__repr__N)T)	r*r,r-r%r�r�r+r�r�rrrrr�s

rcCstj||�S)N)r)rZsequencerrrr�Array�sr	c@s8eZdZdZdd�Zdd�Zd	d
�Zdd�Zd
d�ZdS)�
IteratorProxy�__next__r0�throwr�cCs|S)Nr)r$rrr�__iter__�szIteratorProxy.__iter__cGs|jd|�S)Nr)r�)r$r5rrrr�szIteratorProxy.__next__cGs|jd|�S)Nr0)r�)r$r5rrrr0�szIteratorProxy.sendcGs|jd|�S)Nr)r�)r$r5rrrr�szIteratorProxy.throwcGs|jd|�S)Nr�)r�)r$r5rrrr��szIteratorProxy.closeN)rr0rr�)	r*r,r-r�r
rr0rr�rrrrr
�sr
c@s2eZdZd
Zddd�Zdd�Zd	d
�Zdd�ZdS)�
AcquirerProxy�acquire�releaseTNcCs"|dkr|fn||f}|jd|�S)Nr)r�)r$Zblockingr�r5rrrr�szAcquirerProxy.acquirecCs
|jd�S)Nr)r�)r$rrrr�szAcquirerProxy.releasecCs
|jd�S)Nr)r�)r$rrrr��szAcquirerProxy.__enter__cCs
|jd�S)Nr)r�)r$r�r�r�rrrr��szAcquirerProxy.__exit__)rr)TN)r*r,r-r�rrr�r�rrrrr�s

rc@s4eZdZdZddd�Zd	d
�Zdd�Zdd
d�ZdS)�ConditionProxyrrrp�notify�
notify_allNcCs|jd|f�S)Nrp)r�)r$r�rrrrp�szConditionProxy.waitcCs
|jd�S)Nr)r�)r$rrrr�szConditionProxy.notifycCs
|jd�S)Nr)r�)r$rrrr�szConditionProxy.notify_allcCsh|�}|r|S|dk	r$tj�|}nd}d}x6|sb|dk	rP|tj�}|dkrPP|j|�|�}q.W|S)Nr)�timeZ	monotonicrp)r$Z	predicater�r8ZendtimeZwaittimerrr�wait_for�s

zConditionProxy.wait_for)rrrprr)N)N)r*r,r-r�rprrrrrrrr�s

rc@s2eZdZdZdd�Zdd�Zd	d
�Zddd
�ZdS)�
EventProxyror�r�rpcCs
|jd�S)Nro)r�)r$rrrroszEventProxy.is_setcCs
|jd�S)Nr�)r�)r$rrrr�szEventProxy.setcCs
|jd�S)Nr�)r�)r$rrrr�szEventProxy.clearNcCs|jd|f�S)Nrp)r�)r$r�rrrrpszEventProxy.wait)ror�r�rp)N)r*r,r-r�ror�r�rprrrrr�s
rc@sNeZdZdZddd�Zdd	�Zd
d�Zedd
��Zedd��Z	edd��Z
dS)�BarrierProxy�__getattribute__rp�abort�resetNcCs|jd|f�S)Nrp)r�)r$r�rrrrp
szBarrierProxy.waitcCs
|jd�S)Nr)r�)r$rrrrszBarrierProxy.abortcCs
|jd�S)Nr)r�)r$rrrrszBarrierProxy.resetcCs|jdd�S)Nr�parties)r)r�)r$rrrrszBarrierProxy.partiescCs|jdd�S)Nr�	n_waiting)r)r�)r$rrrrszBarrierProxy.n_waitingcCs|jdd�S)Nr�broken)r)r�)r$rrrrszBarrierProxy.broken)rrprr)N)r*r,r-r�rprrr�rrrrrrrrs
rc@s(eZdZdZdd�Zdd�Zdd	�Zd
S)�NamespaceProxyr�__setattr__�__delattr__cCs0|ddkrtj||�Stj|d�}|d|f�S)NrrHr�r)�objectr)r$r��
callmethodrrr�__getattr__ szNamespaceProxy.__getattr__cCs4|ddkrtj|||�Stj|d�}|d||f�S)NrrHr�r)r!rr)r$r�r�r"rrrr%szNamespaceProxy.__setattr__cCs0|ddkrtj||�Stj|d�}|d|f�S)NrrHr�r )r!r r)r$r�r"rrrr *szNamespaceProxy.__delattr__N)rrr )r*r,r-r�r#rr rrrrrsrc@s*eZdZdZdd�Zdd�Zeee�ZdS)	�
ValueProxyr�r�cCs
|jd�S)Nr�)r�)r$rrrr�3szValueProxy.getcCs|jd|f�S)Nr�)r�)r$r�rrrr�5szValueProxy.setN)r�r�)r*r,r-r�r�r�r�r�rrrrr$1sr$�
BaseListProxy�__add__�__contains__�__delitem__�__getitem__�__len__�__mul__�__reversed__�__rmul__�__setitem__rD�count�extend�index�insertr��remove�reverser��__imul__c@seZdZdd�Zdd�ZdS)�	ListProxycCs|jd|f�|S)Nr0)r�)r$r�rrr�__iadd__AszListProxy.__iadd__cCs|jd|f�|S)Nr5)r�)r$r�rrrr5DszListProxy.__imul__N)r*r,r-r7r5rrrrr6@sr6�	DictProxyr
r�r�r��has_key�popitem�
setdefaultr�Iterator�
ArrayProxy�	PoolProxy�apply�apply_asyncr��imap�imap_unorderedr��map�	map_async�starmap�
starmap_asyncr�ZAsyncResult)r@rDrFrArBc@seZdZdd�Zdd�ZdS)r>cCs|S)Nr)r$rrrr�dszPoolProxy.__enter__cCs|j�dS)N)r�)r$r�r�r�rrrr�fszPoolProxy.__exit__N)r*r,r-r�r�rrrrr>csc@seZdZdZdS)ra(
    Subclass of `BaseManager` which supports a number of shared object types.

    The types registered are those intended for the synchronization
    of threads, plus `dict`, `list` and `Namespace`.

    The `multiprocessing.Manager()` function creates started instances of
    this class.
    N)r*r,r-r.rrrrrms	�QueueZ
JoinableQueuergra�RLock�	Semaphore�BoundedSemaphore�	Condition�Barrier�Poolrr�F)r�r�)r�)rrr)NNNT)T)r&r'r(r)r*r+r,r-r.rDr/r0r1r2r�r3r4r�r5)r'r(r)r
r*r.r�r�r�r9rrr�r:r;rr)r*r)r.)r?r@r�rArBr�rCrDrErFr�)I�__all__rsr`rZqueuerr�r�r�contextr	r
rrr
rrr�Z
view_typesrr Z	view_typer!rr9r2rr<rGrIrJr�rdreZXmlListenerZ	XmlClientr[rr�r�rr�rr�rrr	r
rrrrrr$r%r6r8r�r=Z
BasePoolProxyr>rrGrgrarHrIrJrKrLrMr�rrrr�<module>s�


;
]
4