Part of lp.services.command_spawner View In Hierarchy
Output received from a sub-process may not be neatly broken down by line. This class collects them into lines and processes them one by one. If desired, it can also add a prefix to each.
|Method||__init__||Set up an output line handler.|
|Method||process_line||Process a single line of output.|
|Method||__call__||Process multi-line output.|
|Method||finalize||Process the remaining incomplete line, if any.|
|Parameters||line_processor||A callback to be invoked for each line of output received. Will receive exactly one argument: a single nonempty line of text, without the trailing newline.|
|prefix||An optional string to be prefixed to each line of
output before it is sent into the |
Any trailing text not (yet) terminated with a newline is buffered.