diff --git a/pcl_expect/popen.py b/pcl_expect/popen.py index 1cde80dd668bd58302131333b0d92c1f867951d1..1e9a1c5db572b341ca10746da676232121a58502 100644 --- a/pcl_expect/popen.py +++ b/pcl_expect/popen.py @@ -1,3 +1,7 @@ +"""Start a process using os.popen, and read input from it. +""" + + import os import pcl_expect @@ -8,9 +12,18 @@ __all__ = [ class Popen(pcl_expect.Expectable): def __init__(self, cmd): + """Run cmd via os.popen.""" self.__cmd = os.popen(cmd, "r") pcl_expect.Expectable.__init__(self, self.__cmd.fileno()) def close(self): + """Close the pipe and wait for the child to die. + + Return the status of the child; see the documentation for + os.popen for information about the return value. + + Note: this will block until the child process dies. + """ + pcl_expect.Expectable.close(self) return self.__cmd.close()