Current File : //usr/lib/python2.7/site-packages/paramiko/pipe.pyc
�
=OXc@s�dZddlZddlZddlZddlmZd�Zdefd��YZdefd��YZ	d	efd
��YZ
d�ZdS(s
Abstraction of a one-way pipe where the read end can be used in
`select.select`. Normally this is trivial, but Windows makes it nearly
impossible.

The pipe acts like an Event, which can be set or cleared. When set, the pipe
will trigger as readable in `select <select.select>`.
i����N(tbcCs,tjd dkrt�}n	t�}|S(Nitwin(tsystplatformt	PosixPipetWindowsPipe(tp((s1/usr/lib/python2.7/site-packages/paramiko/pipe.pyt	make_pipe"s	RcBs>eZd�Zd�Zd�Zd�Zd�Zd�ZRS(cCs7tj�\|_|_t|_t|_t|_dS(N(tostpipet_rfdt_wfdtFalset_sett_forevert_closed(tself((s1/usr/lib/python2.7/site-packages/paramiko/pipe.pyt__init__+s		cCs-tj|j�tj|j�t|_dS(N(RtcloseR
RtTrueR(R((s1/usr/lib/python2.7/site-packages/paramiko/pipe.pyR1scCs|jS(N(R
(R((s1/usr/lib/python2.7/site-packages/paramiko/pipe.pytfileno7scCs7|js|jrdStj|jd�t|_dS(Ni(R
RRtreadR
R(R((s1/usr/lib/python2.7/site-packages/paramiko/pipe.pytclear:scCs6|js|jrdSt|_tj|jd�dS(Nt*(R
RRRtwriteR(R((s1/usr/lib/python2.7/site-packages/paramiko/pipe.pytset@s	cCst|_|j�dS(N(RRR(R((s1/usr/lib/python2.7/site-packages/paramiko/pipe.pytset_foreverFs	(t__name__t
__module__RRRRRR(((s1/usr/lib/python2.7/site-packages/paramiko/pipe.pyR*s					RcBsDeZdZd�Zd�Zd�Zd�Zd�Zd�ZRS(s�
    On Windows, only an OS-level "WinSock" may be used in select(), but reads
    and writes must be to the actual socket object.
    cCs�tjtjtj�}|jd�|jd�tjtjtj�|_|jjd|j�df�|j�\|_	}|j
�t|_t|_
t|_dS(Ns	127.0.0.1ii(s	127.0.0.1i(tsockettAF_INETtSOCK_STREAMtbindtlistent_rsocktconnecttgetsocknametacceptt_wsockRRR
RR(Rtservtaddr((s1/usr/lib/python2.7/site-packages/paramiko/pipe.pyRPs

 
		cCs'|jj�|jj�t|_dS(N(R"RR&RR(R((s1/usr/lib/python2.7/site-packages/paramiko/pipe.pyR_s

cCs
|jj�S(N(R"R(R((s1/usr/lib/python2.7/site-packages/paramiko/pipe.pyRescCs4|js|jrdS|jjd�t|_dS(Ni(R
RR"trecvR(R((s1/usr/lib/python2.7/site-packages/paramiko/pipe.pyRhscCs3|js|jrdSt|_|jjd�dS(NR(R
RRR&tsend(R((s1/usr/lib/python2.7/site-packages/paramiko/pipe.pyRns	cCst|_|j�dS(N(RRR(R((s1/usr/lib/python2.7/site-packages/paramiko/pipe.pyRts	(	RRt__doc__RRRRRR(((s1/usr/lib/python2.7/site-packages/paramiko/pipe.pyRKs					tOrPipecBs#eZd�Zd�Zd�ZRS(cCst|_d|_||_dS(N(RR
tNonet_partnert_pipe(RR	((s1/usr/lib/python2.7/site-packages/paramiko/pipe.pyRzs		cCs)t|_|jjs%|jj�ndS(N(RR
R.R/R(R((s1/usr/lib/python2.7/site-packages/paramiko/pipe.pyRs	cCs)t|_|jjs%|jj�ndS(N(RR
R.R/R(R((s1/usr/lib/python2.7/site-packages/paramiko/pipe.pyR�s	(RRRRR(((s1/usr/lib/python2.7/site-packages/paramiko/pipe.pyR,ys		cCs4t|�}t|�}||_||_||fS(s�
    wraps a pipe into two pipe-like objects which are "or"d together to
    affect the real pipe. if either returned pipe is set, the wrapped pipe
    is set. when both are cleared, the wrapped pipe is cleared.
    (R,R.(R	tp1tp2((s1/usr/lib/python2.7/site-packages/paramiko/pipe.pytmake_or_pipe�s
		(R+RRRtparamiko.py3compatRRtobjectRRR,R2(((s1/usr/lib/python2.7/site-packages/paramiko/pipe.pyt<module>s	!.