From bcf197d02731b9548954a6c8dcad1bb290751439 Mon Sep 17 00:00:00 2001 From: Robey Pointer Date: Thu, 21 Apr 2005 16:59:03 +0000 Subject: [PATCH] [project @ Arch-1:robey@lag.net--2005-master-shake%paramiko--dev--1--patch-3] make SFTPClient.file an alias for SFTPClient.open. clean up docs a little, and make 'file' an alias for 'open'. this is how python is heading in general. --- paramiko/sftp_client.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/paramiko/sftp_client.py b/paramiko/sftp_client.py index 329667c..b29f71e 100644 --- a/paramiko/sftp_client.py +++ b/paramiko/sftp_client.py @@ -148,12 +148,16 @@ class SFTPClient (BaseSFTP): is ignored, since SSH treats all files as binary. The C{'U'} flag is supported in a compatible way. + The file will be buffered in standard python style by default, but + can be altered with the C{bufsize} parameter. C{0} turns off + buffering, C{1} uses line buffering, and any number greater than 1 + (C{>1}) uses that specific buffer size. + @param filename: name of the file to open. @type filename: string @param mode: mode (python-style) to open in. @type mode: string - @param bufsize: desired buffering (-1 = default buffer size, 0 = - unbuffered, 1 = line buffered, >1 = requested buffer size). + @param bufsize: desired buffering (-1 = default buffer size) @type bufsize: int @return: a file object representing the open file. @rtype: SFTPFile @@ -176,6 +180,10 @@ class SFTPClient (BaseSFTP): handle = msg.get_string() return SFTPFile(self, handle, mode, bufsize) + # python has migrated toward file() instead of open(). + # and really, that's more easily identifiable. + file = open + def remove(self, path): """ Remove the file at the given path.