|
HWRF
trunk@4391
|
This class is a wrapper around launch and manage. More...
This class is a wrapper around launch and manage.
It converts Runner objects to calls to "launch", and runs "manage" on the resulting processes.
Definition at line 564 of file pipeline.py.
Public Member Functions | |
| def | __init__ |
| Pipeline constructor. More... | |
| def | __repr__ (self) |
| Return a debug string representation of this Pipeline. More... | |
| def | send_signal (self, sig) |
| Sends a signal to all children. More... | |
| def | terminate (self) |
| Sends SIGTERM to all children. More... | |
| def | kill (self) |
| Sends SIGKILL to all children. More... | |
| def | communicate |
| Writes to input, reads from output, waits for child processes, etc. More... | |
| def | poll (self) |
| Returns the exit status of the last element of the pipeline. More... | |
| def | to_string (self) |
| Calls self.communicate(), and returns the stdout from the pipeline (self.outstring). More... | |
| def | outstring (self) |
| The stdout from the pipeline. More... | |
| def produtil.pipeline.Pipeline.__init__ | ( | self, | |
| runner, | |||
capture = False, |
|||
logger = None, |
|||
debug = False |
|||
| ) |
Pipeline constructor.
| runner | the produtil.prog.Runner to convert |
| capture | if True, capture the stdout of the runner |
| logger | a logging.Logger for messages |
| debug | if True, send debug messages |
Definition at line 568 of file pipeline.py.
| def produtil.pipeline.Pipeline.__repr__ | ( | self | ) |
Return a debug string representation of this Pipeline.
Definition at line 589 of file pipeline.py.
Referenced by produtil.prog.Runner.__str__().
| def produtil.pipeline.Pipeline.communicate | ( | self, | |
sleeptime = None |
|||
| ) |
Writes to input, reads from output, waits for child processes, etc.
This is just a wrapper around the manage() function. It will return immediately if self.communicate has already completed earlier.
| sleeptime | the sleep time in seconds between checks |
Definition at line 653 of file pipeline.py.
Referenced by produtil.pipeline.Pipeline.to_string().
| def produtil.pipeline.Pipeline.kill | ( | self | ) |
Sends SIGKILL to all children.
Definition at line 644 of file pipeline.py.
| def produtil.pipeline.Pipeline.outstring | ( | self | ) |
The stdout from the pipeline.
Will be Null if the pipeline was redirected to a file, or if the constructor's capture option was not True.
Definition at line 693 of file pipeline.py.
Referenced by produtil.pipeline.Pipeline.to_string().
| def produtil.pipeline.Pipeline.poll | ( | self | ) |
Returns the exit status of the last element of the pipeline.
If the process died due to a signal, returns a negative number.
Definition at line 670 of file pipeline.py.
| def produtil.pipeline.Pipeline.send_signal | ( | self, | |
| sig | |||
| ) |
Sends a signal to all children.
| sig | the signal |
Definition at line 633 of file pipeline.py.
Referenced by produtil.pipeline.Pipeline.kill(), and produtil.pipeline.Pipeline.terminate().
| def produtil.pipeline.Pipeline.terminate | ( | self | ) |
Sends SIGTERM to all children.
Definition at line 641 of file pipeline.py.
| def produtil.pipeline.Pipeline.to_string | ( | self | ) |
Calls self.communicate(), and returns the stdout from the pipeline (self.outstring).
The return value will be Null if the pipeline was redirected to a file or if the constructor's capture option was not True.
Definition at line 684 of file pipeline.py.
1.8.10