twisted.internet.process.PTYProcess(abstract.FileDescriptor, _BaseProcess) class documentationtwisted.internet.process
View Source
(View In Hierarchy)
Implements interfaces: twisted.internet.interfaces.IProcessTransport
An operating-system Process that uses PTY support.
| Method | __init__ | Spawn an operating-system process. |
| Method | closeStdin | Close stdin after all data has been written out. |
| Method | closeStdout | Close stdout. |
| Method | closeStderr | Close stderr. |
| Method | doRead | Called when my standard output stream is ready for reading. |
| Method | fileno | This returns the file number of standard output on this process. |
| Method | maybeCallProcessEnded | Call processEnded on protocol after final cleanup. |
| Method | connectionLost | I call this to clean up when one or all of my connections has died. |
| Method | writeSomeData | Write some data to the open process. |
| Method | _setupChild | Set up child process after fork() but before
exec(). |
Inherited from BaseProcess (via _BaseProcess):
| Method | processEnded | This is called when the child terminates. |
| Method | _callProcessExited | Undocumented |
Inherited from BaseProcess (via _BaseProcess):
| Method | processEnded | This is called when the child terminates. |
| Method | _callProcessExited | Undocumented |
Inherited from BaseProcess (via _BaseProcess):
| Method | processEnded | This is called when the child terminates. |
| Method | _callProcessExited | Undocumented |
Inherited from BaseProcess (via _BaseProcess):
| Method | processEnded | This is called when the child terminates. |
| Method | _callProcessExited | Undocumented |
Inherited from BaseProcess (via _BaseProcess):
| Method | processEnded | This is called when the child terminates. |
| Method | _callProcessExited | Undocumented |
Spawn an operating-system process.
This is where the hard work of disconnecting all currently open files / forking / executing the new process happens. (This is executed automatically when a Process is instantiated.)
This will also run the subprocess as a given user ID and group ID, if specified. (Implementation Note: this doesn't support all the arcane nuances of setXXuid on UNIX: it will assume that either your effective or real UID is 0.)
Set up child process after fork() but before
exec().
This involves:
masterfd, since it is not used in the subprocess
os.setsid
slavefd
slavefd to standard input, output, and error
_listOpenFDs)
SIG_DFL
| Parameters | masterfd | The master end of a PTY file descriptors opened with openpty. (type: int) |
| slavefd | The slave end of a PTY opened with openpty. (type: int) |
I call this to clean up when one or all of my connections has died.