[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.
This commit is contained in:
Robey Pointer 2005-04-21 16:59:03 +00:00
parent fc7ccdf834
commit bcf197d027
1 changed files with 10 additions and 2 deletions

View File

@ -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.