Package Bio :: Package MultiProc :: Module copen :: Class _ProcHandle
[show private | hide private]
[frames | no frames]

Class _ProcHandle


This object provides a file-like interface to a running process.

Members: pid what is the PID of the subprocess? killsig what signal killed the child process? status what was the status of the command?

Methods: close Close this process, killing it if necessary. fileno Return the fileno used to read from the process. wait Wait for the process to finish. poll Is the process finished? elapsed How much time has this process taken? read readline readlines
Method Summary
  __init__(self, pid, cread, errread)
Create a wrapper around a running process.
  __del__(self)
  _cleanup_child(self)
Do necessary cleanup functions after child is finished running.
  _kill(self)
Kill the process and return killsig
  close(self)
Close the process, killing it if it is still running.
  elapsed(self)
Return the number of seconds elapsed since the process began.
  fileno(self)
Return the file descriptor used to read from the process.
  poll(self)
Return a boolean.
  read(self)
Return the output as a string.
  readline(self)
Return the next line or '' if finished.
  readlines(self)
Return the output of the process as a list of strings.
  wait(self)
Wait for the process to finish.

Method Details

__init__(self, pid, cread, errread=None)
(Constructor)

Create a wrapper around a running process. pid is the process ID. cread is the file object used to read from the child. errread is an optional file object used to read errors from the child.

_cleanup_child(self)

Do necessary cleanup functions after child is finished running.

_kill(self)

Kill the process and return killsig

close(self)

Close the process, killing it if it is still running.

elapsed(self)

Return the number of seconds elapsed since the process began.

fileno(self)

Return the file descriptor used to read from the process.

poll(self)

Return a boolean. Is the process finished running?

read(self)

Return the output as a string.

readline(self)

Return the next line or '' if finished.

readlines(self)

Return the output of the process as a list of strings.

wait(self)

Wait for the process to finish.

Generated by Epydoc 2.1 on Mon Aug 27 16:12:10 2007 http://epydoc.sf.net