• File: fdpexpect.pyc
  • Full Path: /home3/farmfre2/public_html/ALFA_DATA/alfasymlink/root/usr/lib/python2.7/site-packages/fdpexpect.pyc
  • Date Modified: 06/09/2014 7:48 PM
  • File size: 3.03 KB
  • MIME-type: text/x-bytecode.python
  • Charset: 8 bit

rGc@s?dZddlTddlZdgZdefdYZdS(sThis is like pexpect, but will work on any file descriptor that you pass it.
So you are reponsible for opening and close the file descriptor.

$Id: fdpexpect.py 505 2007-12-26 21:33:50Z noah $
i(t*NtfdspawncBsVeZdZgddd	d	dZdZdZdZedZ	dZ
RS(
sThis is like pexpect.spawn but allows you to supply your own open file
    descriptor. For example, you could use it to read through a file looking
    for patterns, or to control a modem or serial device. iic	Cst|tdkr6t|dr6|j}nt|tdkr]tdnytj|Wntk
rtdnXd|_d|_	t
j|d|||||||_t
|_t
|_d||_dS(sThis takes a file descriptor (an int) or an object that support the
        fileno() method (returning an int). All Python file-like objects
        support fileno(). itfilenosdThe fd argument is not an int. If this is a command string then maybe you want to use pexpect.spawn.s/The fd argument is not a valid file descriptor.s<file descriptor %d>N(ttypethasattrRtExceptionPexpecttostfstattOSErrortNonetargstcommandtspawnt__init__tchild_fdtFalsetown_fdtclosedtname(tselftfdR
ttimeouttmaxreadtsearchwindowsizetlogfile((s-/usr/lib/python2.7/site-packages/fdpexpect.pyR
s	'

					cCsdS(N((R((s-/usr/lib/python2.7/site-packages/fdpexpect.pyt__del__.scCs\|jdkrdS|jr,|j|n,|jtj|jd|_t|_dS(Ni(RRtclosetflushRtTrueR(R((s-/usr/lib/python2.7/site-packages/fdpexpect.pyR2s	
	cCs:|jdkrtSytj|jtSWntSXdS(sThis checks if the file descriptor is still valid. If os.fstat()
        does not raise an exception then we assume it is alive. iN(RRRRR(R((s-/usr/lib/python2.7/site-packages/fdpexpect.pytisalive>scCstddS(Ns.This method is not valid for file descriptors.(R(Rtforce((s-/usr/lib/python2.7/site-packages/fdpexpect.pyt	terminateKscCsdS(N((Rtsig((s-/usr/lib/python2.7/site-packages/fdpexpect.pytkillOsN(t__name__t
__module__t__doc__R	R
RRRRRR!(((s-/usr/lib/python2.7/site-packages/fdpexpect.pyRs			
(R$tpexpectRt__all__RR(((s-/usr/lib/python2.7/site-packages/fdpexpect.pyt<module>s