Your IP : 172.28.240.42


Current Path : /usr/lib/python2.7/dist-packages/twisted/internet/
Upload File :
Current File : //usr/lib/python2.7/dist-packages/twisted/internet/_posixstdio.pyc


{Kc@sdZddlZddlZddlZddlmZddlmZmZm	Z	ddl
mZmZde
fdYZde
fd	YZdS(
sStandard input/out/err support.

Future Plans::

    support for stderr, perhaps
    Rewrite to use the reactor instead of an ad-hoc mechanism for connecting
        protocols to transport.

Maintainer: James Y Knight
iN(t
implements(tprocessterrort
interfaces(tlogtfailuretPipeAddresscBseZeejRS((t__name__t
__module__RRtIAddress(((s@/usr/lib/python2.7/dist-packages/twisted/internet/_posixstdio.pyRst
StandardIOcBseZeejejejejdZ	dZ
eZeZ
dddZdZdZdZdZdZdZd	Zd
ZdZdZd
ZdZdZdZdZdZdZdZ dZ!RS(iicCsddlm}||_tj||d||_y|jjWnMtk
r}|jtj	krt
d|tj|j
fnnXtj||d||_|jj|jj|dS(Ni(treactortwritesThis reactor does not support this type of file descriptor (fd %d, mode %d) (for example, epollreactor does not support normal files.  See #4429).tread(ttwisted.internetRtprotocolRt
ProcessWritert_writertstartReadingtIOErrorterrnotEPERMtRuntimeErrortostfstattst_modet
ProcessReadert_readertmakeConnection(tselftprototstdintstdoutRte((s@/usr/lib/python2.7/dist-packages/twisted/internet/_posixstdio.pyt__init__ s	
cCs#|jdk	r|jjndS(N(RtNonetloseConnection(R((s@/usr/lib/python2.7/dist-packages/twisted/internet/_posixstdio.pytloseWriteConnection:scCs&|jdk	r"|jj|ndS(N(RR#R(Rtdata((s@/usr/lib/python2.7/dist-packages/twisted/internet/_posixstdio.pyR>scCs&|jdk	r"|jj|ndS(N(RR#t
writeSequence(RR&((s@/usr/lib/python2.7/dist-packages/twisted/internet/_posixstdio.pyR'BscCsKt|_|jdk	r(|jjn|jdk	rG|jjndS(N(tTruet
disconnectingRR#R$RtstopReading(R((s@/usr/lib/python2.7/dist-packages/twisted/internet/_posixstdio.pyR$Fs
	cCstS(N(R(R((s@/usr/lib/python2.7/dist-packages/twisted/internet/_posixstdio.pytgetPeerOscCstS(N(R(R((s@/usr/lib/python2.7/dist-packages/twisted/internet/_posixstdio.pytgetHostRscCs|jj|dS(N(RtdataReceived(RtfdR&((s@/usr/lib/python2.7/dist-packages/twisted/internet/_posixstdio.pytchildDataReceivedWscCs_|jr
dS|jjtjkrN|dkr>|j|q[|j|n
|j|dS(NR
(tdisconnectedtvaluet	__class__RtConnectionDonet_readConnectionLostt_writeConnectionLosttconnectionLost(RR.treason((s@/usr/lib/python2.7/dist-packages/twisted/internet/_posixstdio.pytchildConnectionLostZs	cCst|_|j}|j}|j}d|_|_d|_|dk	rc|jrc|j|n|dk	r|jr|j|ny|j|WntjnXdS(N(	R(R0RRRR#R6Rterr(RR7RRR((s@/usr/lib/python2.7/dist-packages/twisted/internet/_posixstdio.pyR6gs					cCszd|_|jr#|j|dStj|jd}|rvy|jWqvtj	|jt
jqvXndS(N(R#RR)R6RtIHalfCloseableProtocolRtwriteConnectionLostRR9RtFailure(RR7tp((s@/usr/lib/python2.7/dist-packages/twisted/internet/_posixstdio.pyR5|s		

cCsmd|_tj|jd}|r\y|jWqitj|jt	j
qiXn
|j|dS(N(R#RRR:RtreadConnectionLostRR9R6RR<(RR7R=((s@/usr/lib/python2.7/dist-packages/twisted/internet/_posixstdio.pyR4s	
cCs3|jdkr|jn|jj||dS(N(RR#t
stopProducingtregisterProducer(Rtproducert	streaming((s@/usr/lib/python2.7/dist-packages/twisted/internet/_posixstdio.pyR@s
cCs#|jdk	r|jjndS(N(RR#tunregisterProducer(R((s@/usr/lib/python2.7/dist-packages/twisted/internet/_posixstdio.pyRCscCs|jdS(N(R$(R((s@/usr/lib/python2.7/dist-packages/twisted/internet/_posixstdio.pyR?scCs#|jdk	r|jjndS(N(RR#tpauseProducing(R((s@/usr/lib/python2.7/dist-packages/twisted/internet/_posixstdio.pyRDscCs#|jdk	r|jjndS(N(RR#tresumeProducing(R((s@/usr/lib/python2.7/dist-packages/twisted/internet/_posixstdio.pyREscCs'tjddtdd|jdS(s;Compatibility only, don't use. Same as loseWriteConnection.s=This function is deprecated, use loseWriteConnection instead.tcategoryt
stackleveliN(twarningstwarntDeprecationWarningR%(R((s@/usr/lib/python2.7/dist-packages/twisted/internet/_posixstdio.pyt
closeStdins
cCs|jdS(s3Compatibility only, don't use. Call pauseProducing.N(RD(R((s@/usr/lib/python2.7/dist-packages/twisted/internet/_posixstdio.pyR*scCs|jdS(s4Compatibility only, don't use. Call resumeProducing.N(RE(R((s@/usr/lib/python2.7/dist-packages/twisted/internet/_posixstdio.pyRsN("RRRRt
ITransportt	IProducert	IConsumertIHalfCloseableDescriptorR#RRtFalseR0R)R"R%RR'R$R+R,R/R8R6R5R4R@RCR?RDRERKR*R(((s@/usr/lib/python2.7/dist-packages/twisted/internet/_posixstdio.pyR
s2									
			
							(t__doc__RHRRtzope.interfaceRRRRRttwisted.pythonRRtobjectRR
(((s@/usr/lib/python2.7/dist-packages/twisted/internet/_posixstdio.pyt<module>s$