Home | Trees | Index | Help |
---|
Package pybaz :: Package backends :: Module forkexec :: Class exec_safe_iter_stdout |
|
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.
Method Summary | |
---|---|
__init__(self,
program,
args,
stdin,
stderr,
expected,
delsignal,
chdir,
logger)
| |
Destructor. | |
Iterator. | |
Close the pipe and wait the child process. | |
Iteration method. | |
Inherited from object | |
x.__delattr__('name') <==> del x.name... | |
x.__getattribute__('name') <==> x.name... | |
x.__hash__() <==> hash(x)... | |
T.__new__(S, ...) -> a new object with type S, a subtype of T... | |
helper for pickle... | |
helper for pickle... | |
x.__repr__() <==> repr(x)... | |
x.__setattr__('name', value) <==> x.name = value... | |
x.__str__() <==> str(x)... |
Property Summary | |
---|---|
finished | |
status |
Method Details |
---|
__del__(self)
|
__iter__(self)Iterator. Return self. |
close(self)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. |
next(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. |
Home | Trees | Index | Help |
---|
Generated by Epydoc 2.1 on Thu Feb 2 14:21:53 2006 | http://epydoc.sf.net |