Skip to content
Snippets Groups Projects
Commit 56a01682 authored by Per Cederqvist's avatar Per Cederqvist
Browse files

Added support for collecting stderr of a spawned program via a pipe.

parent a264430d
Branches
Tags
No related merge requests found
2003-10-24 Per Cederqvist <ceder@ceder.dyndns.org> 2003-10-24 Per Cederqvist <ceder@ceder.dyndns.org>
Added support for collecting stderr of a spawned program via a
pipe.
* pcl_expect/spawn.py (_spawn): New helper function, extracted
from Spawn.__init__. New argument: use_stderr_pipe.
(Spawn.__init__): New optional argument: use_stderr_pipe. Set the
stderr attribute to an Expectable object that represents the
stderr output from the subprocess it it is true. Get rid of the
__pty attribute, and renamed __child to __child_pid.
(Spawn.send): Use self.fileno() instead of self.__pty.
(Spawn.close): Ditto. Close the stderr pipe if present.
(spawn2): New function. A possibly easier API if you want to
have the stderr output in a separate Expectable.
* demo/stdout.py: New demo program. Run a subshell in a pty.
* demo/stderr.py: New demo program. Run a subshell in a pty, but
with stderr connected to a pipe.
* README: Mention that pcl-expect can collect stderr of a spawned
program via a pipe.
Added TCP support. Added TCP support.
* README: TCP support is now implemented. * README: TCP support is now implemented.
* pcl_expect/tcp.py: New file. * pcl_expect/tcp.py: New file.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment