Home | Trees | Indices | Help |
---|
|
object --+ | exec_safe_iter_stdout
Iterator over the output of a child process. Fork/exec a process with its output piped. Each iteration will cause a iteration of the process output pipe. The pipe is properly closed whenever the output is exhausted or the iterator is deleted. If the output is exhausted, the process exit status is checked and an ExecError exception will be raised for abnormal or unexpected exit status.
Instance Methods | |||
|
|||
|
|||
|
|||
|
|||
|
|||
Inherited from |
Properties | |
finished Whether the underlying process has terminated. |
|
status Exit status of the underlying process. |
|
Inherited from |
Method Details |
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
|
Destructor. If needed, close the pipe and wait the child process. If child process has already been joined, it means the iterator was deleted before being exhausted. It is assumed the return status is not cared about. |
Close the pipe and wait the child process. If the output is not exhausted yet, you should be prepared to handle the error condition caused by breaking the pipe. |
Iterator. Return self. |
Iteration method. Iterate on the pipe file. Close the pipe and wait the child process once output is exhausted. Use `file.readline` instead of `file.next` because we want maximal responsiveness to incremental output. The pipe mechanism itself provides buffering. |
Property Details |
finishedWhether the underlying process has terminated.
|
statusExit status of the underlying process. Raises ValueError if the process has not yet finished. (Hm... should be AttributeError). Can be None if the process was killed by a signal.
|
Home | Trees | Indices | Help |
---|
Generated by Epydoc 3.0beta1 on Wed Sep 5 09:53:13 2007 | http://epydoc.sourceforge.net |