summaryrefslogtreecommitdiff
path: root/paramiko/sftp_handle.py
diff options
context:
space:
mode:
authorChris Rose <offline@offby1.net>2018-05-17 10:13:38 -0400
committerChris Rose <offline@offby1.net>2018-05-17 10:13:38 -0400
commit7f2c35052183b400827d9949a68b41c90f90a32d (patch)
treefea4a1ec04b7ee3ced14d61e8b6cf3f479e22704 /paramiko/sftp_handle.py
parent52551321a2297bdb966869fa719e584c868dd857 (diff)
downloadparamiko-7f2c35052183b400827d9949a68b41c90f90a32d.tar.gz
Blacken Paramiko on 2.4
Diffstat (limited to 'paramiko/sftp_handle.py')
-rw-r--r--paramiko/sftp_handle.py11
1 files changed, 6 insertions, 5 deletions
diff --git a/paramiko/sftp_handle.py b/paramiko/sftp_handle.py
index ca473900..a7e22f01 100644
--- a/paramiko/sftp_handle.py
+++ b/paramiko/sftp_handle.py
@@ -25,7 +25,7 @@ from paramiko.sftp import SFTP_OP_UNSUPPORTED, SFTP_OK
from paramiko.util import ClosingContextManager
-class SFTPHandle (ClosingContextManager):
+class SFTPHandle(ClosingContextManager):
"""
Abstract object representing a handle to an open file (or folder) in an
SFTP server implementation. Each handle has a string representation used
@@ -36,6 +36,7 @@ class SFTPHandle (ClosingContextManager):
Instances of this class may be used as context managers.
"""
+
def __init__(self, flags=0):
"""
Create a new file handle representing a local file being served over
@@ -63,10 +64,10 @@ class SFTPHandle (ClosingContextManager):
using the default implementations of `read` and `write`, this
method's default implementation should be fine also.
"""
- readfile = getattr(self, 'readfile', None)
+ readfile = getattr(self, "readfile", None)
if readfile is not None:
readfile.close()
- writefile = getattr(self, 'writefile', None)
+ writefile = getattr(self, "writefile", None)
if writefile is not None:
writefile.close()
@@ -88,7 +89,7 @@ class SFTPHandle (ClosingContextManager):
:param int length: number of bytes to attempt to read.
:return: data read from the file, or an SFTP error code, as a `str`.
"""
- readfile = getattr(self, 'readfile', None)
+ readfile = getattr(self, "readfile", None)
if readfile is None:
return SFTP_OP_UNSUPPORTED
try:
@@ -122,7 +123,7 @@ class SFTPHandle (ClosingContextManager):
:param str data: data to write into the file.
:return: an SFTP error code like ``SFTP_OK``.
"""
- writefile = getattr(self, 'writefile', None)
+ writefile = getattr(self, "writefile", None)
if writefile is None:
return SFTP_OP_UNSUPPORTED
try: