summaryrefslogtreecommitdiff
path: root/paramiko/sftp_si.py
diff options
context:
space:
mode:
authorDorian Pula <dorian.pula@amber-penguin-software.ca>2017-05-30 12:02:17 -0400
committerJeff Forcier <jeff@bitprophet.org>2017-05-31 17:14:40 -0700
commitecb297518267487853813109da946d7240d717e1 (patch)
tree9974aecc603adad39e6bb88034c08dd74d91340e /paramiko/sftp_si.py
parent98f682815cdd33a2f1999b931582e2467bb59754 (diff)
downloadparamiko-ecb297518267487853813109da946d7240d717e1.tar.gz
Additional PEP8 fixes.
Diffstat (limited to 'paramiko/sftp_si.py')
-rw-r--r--paramiko/sftp_si.py22
1 files changed, 11 insertions, 11 deletions
diff --git a/paramiko/sftp_si.py b/paramiko/sftp_si.py
index 7ab00ad7..c335eaec 100644
--- a/paramiko/sftp_si.py
+++ b/paramiko/sftp_si.py
@@ -35,16 +35,15 @@ class SFTPServerInterface (object):
SFTP sessions). However, raising an exception will usually cause the SFTP
session to abruptly end, so you will usually want to catch exceptions and
return an appropriate error code.
-
+
All paths are in string form instead of unicode because not all SFTP
clients & servers obey the requirement that paths be encoded in UTF-8.
"""
-
def __init__(self, server, *largs, **kwargs):
"""
Create a new SFTPServerInterface object. This method does nothing by
default and is meant to be overridden by subclasses.
-
+
:param .ServerInterface server:
the server object associated with this channel and SFTP subsystem
"""
@@ -92,7 +91,7 @@ class SFTPServerInterface (object):
The ``attr`` object contains requested attributes of the file if it
has to be created. Some or all attribute fields may be missing if
the client didn't specify them.
-
+
.. note:: The SFTP protocol defines all files to be in "binary" mode.
There is no equivalent to Python's "text" mode.
@@ -123,11 +122,12 @@ class SFTPServerInterface (object):
In case of an error, you should return one of the ``SFTP_*`` error
codes, such as `.SFTP_PERMISSION_DENIED`.
- :param str path: the requested path (relative or absolute) to be listed.
+ :param str path: the requested path (relative or absolute) to be
+ listed.
:return:
a list of the files in the given folder, using `.SFTPAttributes`
objects.
-
+
.. note::
You should normalize the given ``path`` first (see the `os.path`
module) and check appropriate permissions before returning the list
@@ -189,7 +189,7 @@ class SFTPServerInterface (object):
and since there's no other (easy) way to move files via SFTP, it's
probably a good idea to implement "move" in this method too, even for
files that cross disk partition boundaries, if at all possible.
-
+
.. note:: You should return an error if a file with the same name as
``newpath`` already exists. (The rename operation should be
non-desctructive.)
@@ -267,25 +267,25 @@ class SFTPServerInterface (object):
# on windows, normalize backslashes to sftp/posix format
out = out.replace('\\', '/')
return out
-
+
def readlink(self, path):
"""
Return the target of a symbolic link (or shortcut) on the server.
If the specified path doesn't refer to a symbolic link, an error
should be returned.
-
+
:param str path: path (relative or absolute) of the symbolic link.
:return:
the target `str` path of the symbolic link, or an error code like
`.SFTP_NO_SUCH_FILE`.
"""
return SFTP_OP_UNSUPPORTED
-
+
def symlink(self, target_path, path):
"""
Create a symbolic link on the server, as new pathname ``path``,
with ``target_path`` as the target of the link.
-
+
:param str target_path:
path (relative or absolute) of the target for this new symbolic
link.