[paramiko] channel.recv_exit_status_ready()

Justin Cook jhcook at gmail.com
Tue Mar 11 06:22:20 PDT 2008


It would be useful to have a function added to the channel object that
provides information as to whether an exit status is available from
the server. This can be used much in the same way as the existing
channel.recv_ready(). It is quite trivial to implement, and I have
provided the diff below. Sorry for my rambling doc string. It's not
exactly accurate. @return is.

--- channel.py  2008-03-11 11:13:11.000000000 +0000
+++ channel.py.orig     2008-03-11 11:03:09.000000000 +0000
@@ -283,22 +283,6 @@
             self.status_event.wait(0.1)
         return self.exit_status

-    def recv_exit_status_ready(self):
-        """
-        Return if we have an exit status available. This is mostly useful
-        for polling if there is an exit status available. Note, the server
-        may not return an exit status for badly written code.
-
-        @return: True if an exit code maybe waiting. False if not.
-        @rtype: bool
-
-        @since: 1.7.2
-        """
-        if self.closed or self.status_event.isSet():
-                return True
-        else:
-                return False
-
     def send_exit_status(self, status):
         """
         Send the exit status of an executed command to the client.  (This

Cheers,

-- 
Justin Cook
-------------- next part --------------
A non-text attachment was scrubbed...
Name: channel.py.diff
Type: text/x-patch
Size: 867 bytes
Desc: not available
Url : http://www.lag.net/pipermail/paramiko/attachments/20080311/bb53132b/attachment.bin 


More information about the paramiko mailing list