add a get_channel() method to SFTPClient, to retrieve the underlying channel.
This commit is contained in:
Robey Pointer 2007-05-20 15:57:04 -07:00
parent 3229cd0f94
commit afa5e0594e
1 changed files with 12 additions and 0 deletions

View File

@ -115,6 +115,18 @@ class SFTPClient (BaseSFTP):
self._log(INFO, 'sftp session closed.') self._log(INFO, 'sftp session closed.')
self.sock.close() self.sock.close()
def get_channel(self):
"""
Return the underlying L{Channel} object for this SFTP session. This
might be useful for doing things like setting a timeout on the channel.
@return: the SSH channel
@rtype: L{Channel}
@since: 1.7.1
"""
return self.sock
def listdir(self, path='.'): def listdir(self, path='.'):
""" """
Return a list containing the names of the entries in the given C{path}. Return a list containing the names of the entries in the given C{path}.