From 2f2d7bdee88c9f9b14dc2495fb77d7abd1587d64 Mon Sep 17 00:00:00 2001 From: Robey Pointer Date: Sat, 30 Apr 2005 19:21:43 +0000 Subject: [PATCH] [project @ Arch-1:robey@lag.net--2005-master-shake%paramiko--dev--1--patch-4] add Transport.open_sftp_client --- paramiko/transport.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/paramiko/transport.py b/paramiko/transport.py index a1ea5ae..da252ce 100644 --- a/paramiko/transport.py +++ b/paramiko/transport.py @@ -28,6 +28,7 @@ from common import * from ssh_exception import SSHException from message import Message from channel import Channel +from sftp_client import SFTPClient import util from rsakey import RSAKey from dsskey import DSSKey @@ -161,6 +162,8 @@ class BaseTransport (threading.Thread): 'diffie-hellman-group-exchange-sha1': KexGex, } + # READ the secsh RFC's before raising these values. if anything, + # they should probably be lower. REKEY_PACKETS = pow(2, 30) REKEY_BYTES = pow(2, 30) @@ -553,6 +556,18 @@ class BaseTransport (threading.Thread): self.lock.release() return chan + def open_sftp_client(self): + """ + Create an SFTP client channel from an open transport. On success, + an SFTP session will be opened with the remote host, and a new + SFTPClient object will be returned. + + @return: a new L{SFTPClient} object, referring to an sftp session + (channel) across this transport + @rtype: L{SFTPClient} + """ + return SFTPClient.from_transport(self) + def send_ignore(self, bytes=None): """ Send a junk packet across the encrypted link. This is sometimes used