From b6a8d077b3d9a5adb8e2020bcd813bb7b2ecbf70 Mon Sep 17 00:00:00 2001 From: Jeff Forcier Date: Wed, 11 Oct 2017 18:48:43 -0700 Subject: flake8 --- paramiko/sftp_file.py | 9 ++++++--- paramiko/sftp_server.py | 2 +- paramiko/transport.py | 23 +++++++++++++++-------- 3 files changed, 22 insertions(+), 12 deletions(-) diff --git a/paramiko/sftp_file.py b/paramiko/sftp_file.py index be7e6eac..b1c0f849 100644 --- a/paramiko/sftp_file.py +++ b/paramiko/sftp_file.py @@ -288,7 +288,8 @@ class SFTPFile (BufferedFile): :param int mode: new permissions """ - self.sftp._log(DEBUG, 'chmod({}, {!r})'.format(hexlify(self.handle), mode)) + self.sftp._log(DEBUG, 'chmod({}, {!r})'.format( + hexlify(self.handle), mode)) attr = SFTPAttributes() attr.st_mode = mode self.sftp._request(CMD_FSETSTAT, self.handle, attr) @@ -325,7 +326,8 @@ class SFTPFile (BufferedFile): """ if times is None: times = (time.time(), time.time()) - self.sftp._log(DEBUG, 'utime({}, {!r})'.format(hexlify(self.handle), times)) + self.sftp._log(DEBUG, 'utime({}, {!r})'.format( + hexlify(self.handle), times)) attr = SFTPAttributes() attr.st_atime, attr.st_mtime = times self.sftp._request(CMD_FSETSTAT, self.handle, attr) @@ -473,7 +475,8 @@ class SFTPFile (BufferedFile): .. versionadded:: 1.5.4 """ - self.sftp._log(DEBUG, 'readv({}, {!r})'.format(hexlify(self.handle), chunks)) + self.sftp._log(DEBUG, 'readv({}, {!r})'.format( + hexlify(self.handle), chunks)) read_chunks = [] for offset, size in chunks: diff --git a/paramiko/sftp_server.py b/paramiko/sftp_server.py index a6f43217..f8c4f727 100644 --- a/paramiko/sftp_server.py +++ b/paramiko/sftp_server.py @@ -100,7 +100,7 @@ class SFTPServer (BaseSFTP, SubsystemHandler): def start_subsystem(self, name, transport, channel): self.sock = channel - self._log(DEBUG, 'Started sftp server on channel {}'.format(repr(channel))) + self._log(DEBUG, 'Started sftp server on channel {!r}'.format(channel)) self._send_server_version() self.server.session_started() while True: diff --git a/paramiko/transport.py b/paramiko/transport.py index f5178885..3394417c 100644 --- a/paramiko/transport.py +++ b/paramiko/transport.py @@ -415,7 +415,8 @@ class Transport(threading.Thread, ClosingContextManager): """ Returns a string representation of this object, for debugging. """ - out = ' 0: continue else: - self._log(WARNING, 'Oops, unhandled type {:d}'.format(ptype)) + err = 'Oops, unhandled type {:d}'.format(ptype) + self._log(WARNING, err) msg = Message() msg.add_byte(cMSG_UNIMPLEMENTED) msg.add_int(m.seqno) @@ -2447,7 +2451,8 @@ class Transport(threading.Thread, ClosingContextManager): ERROR, 'Secsh channel {:d} open FAILED: {}: {}'.format( chanid, reason_str, reason_text, - )) + ) + ) self.lock.acquire() try: self.saved_exception = ChannelException(reason, reason_text) @@ -2483,7 +2488,8 @@ class Transport(threading.Thread, ClosingContextManager): DEBUG, 'Incoming x11 connection from {}:{:d}'.format( origin_addr, origin_port, - )) + ) + ) self.lock.acquire() try: my_chanid = self._next_channel() @@ -2498,7 +2504,8 @@ class Transport(threading.Thread, ClosingContextManager): DEBUG, 'Incoming tcp forwarded connection from {}:{:d}'.format( origin_addr, origin_port, - )) + ) + ) self.lock.acquire() try: my_chanid = self._next_channel() @@ -2638,7 +2645,7 @@ class SecurityOptions (object): """ Returns a string representation of this object, for debugging. """ - return ''.format(repr(self._transport)) + return ''.format(self._transport) def _set(self, name, orig, x): if type(x) is list: -- cgit v1.2.3