From: Pierce Lopez Date: Mon, 1 Jan 2018 20:27:34 +0000 (-0500) Subject: style fix: misc indent flake warnings X-Git-Tag: v5.0.0~20^2~3 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0a1565aba237d7a611d1e7dd6d5e47a2b166f21d;p=thirdparty%2Ftornado.git style fix: misc indent flake warnings E126 continuation line over-indented for hanging indent E128 continuation line under-indented for visual indent E129 visually indented line with same indent as next logical line --- diff --git a/maint/scripts/custom_fixers/fix_future_imports.py b/maint/scripts/custom_fixers/fix_future_imports.py index 48553c4a6..54ce87380 100644 --- a/maint/scripts/custom_fixers/fix_future_imports.py +++ b/maint/scripts/custom_fixers/fix_future_imports.py @@ -8,8 +8,7 @@ from lib2to3.fixer_util import FromImport, Name, Comma, Newline # copied from fix_tuple_params.py def is_docstring(stmt): - return isinstance(stmt, pytree.Node) and \ - stmt.children[0].type == token.STRING + return isinstance(stmt, pytree.Node) and stmt.children[0].type == token.STRING class FixFutureImports(fixer_base.BaseFix): diff --git a/maint/test/websocket/server.py b/maint/test/websocket/server.py index 5d86b1316..c237afc78 100644 --- a/maint/test/websocket/server.py +++ b/maint/test/websocket/server.py @@ -19,7 +19,7 @@ class EchoHandler(WebSocketHandler): if __name__ == '__main__': parse_command_line() app = Application([ - ('/', EchoHandler), + ('/', EchoHandler), ]) app.listen(options.port, address='127.0.0.1') IOLoop.instance().start() diff --git a/tornado/gen.py b/tornado/gen.py index 41764461a..f6b786add 100644 --- a/tornado/gen.py +++ b/tornado/gen.py @@ -939,8 +939,8 @@ def with_timeout(timeout, future, quiet_exceptions=()): # We know this future will resolve on the IOLoop, so we don't # need the extra thread-safety of IOLoop.add_future (and we also # don't care about StackContext here. - future_add_done_callback(future, - lambda future: io_loop.remove_timeout(timeout_handle)) + future_add_done_callback( + future, lambda future: io_loop.remove_timeout(timeout_handle)) else: # concurrent.futures.Futures may resolve on any thread, so we # need to route them back to the IOLoop. @@ -1150,8 +1150,7 @@ class Runner(object): try: yielded.start(self) if yielded.is_ready(): - future_set_result_unless_cancelled(self.future, - yielded.get_result()) + future_set_result_unless_cancelled(self.future, yielded.get_result()) else: self.yield_point = yielded except Exception: diff --git a/tornado/http1connection.py b/tornado/http1connection.py index cf1572602..4d20593a5 100644 --- a/tornado/http1connection.py +++ b/tornado/http1connection.py @@ -362,13 +362,11 @@ class HTTP1Connection(httputil.HTTPConnection): # but if they do, leave it alone. 'Transfer-Encoding' not in headers) # If connection to a 1.1 client will be closed, inform client - if (self._request_start_line.version == 'HTTP/1.1' and - self._disconnect_on_finish): + if (self._request_start_line.version == 'HTTP/1.1' and self._disconnect_on_finish): headers['Connection'] = 'close' # If a 1.0 client asked for keep-alive, add the header. if (self._request_start_line.version == 'HTTP/1.0' and - (self._request_headers.get('Connection', '').lower() == - 'keep-alive')): + self._request_headers.get('Connection', '').lower() == 'keep-alive'): headers['Connection'] = 'Keep-Alive' if self._chunking_output: headers['Transfer-Encoding'] = 'chunked' diff --git a/tornado/ioloop.py b/tornado/ioloop.py index 6311dda5f..38c506d1b 100644 --- a/tornado/ioloop.py +++ b/tornado/ioloop.py @@ -706,8 +706,8 @@ class IOLoop(Configurable): """ assert is_future(future) callback = stack_context.wrap(callback) - future_add_done_callback(future, - lambda future: self.add_callback(callback, future)) + future_add_done_callback( + future, lambda future: self.add_callback(callback, future)) def run_in_executor(self, executor, func, *args): """Runs a function in a ``concurrent.futures.Executor``. If diff --git a/tornado/tcpclient.py b/tornado/tcpclient.py index 906b89664..549643985 100644 --- a/tornado/tcpclient.py +++ b/tornado/tcpclient.py @@ -104,8 +104,8 @@ class _Connector(object): return stream, future = self.connect(af, addr) self.streams.add(stream) - future_add_done_callback(future, functools.partial(self.on_connect_done, - addrs, af, addr)) + future_add_done_callback( + future, functools.partial(self.on_connect_done, addrs, af, addr)) def on_connect_done(self, addrs, af, addr, future): self.remaining -= 1 diff --git a/tornado/test/runtests.py b/tornado/test/runtests.py index 1bee79726..9699f5133 100644 --- a/tornado/test/runtests.py +++ b/tornado/test/runtests.py @@ -180,8 +180,8 @@ def main(): # logged anything at info level or above (except for the one # allowed info message "PASS") if (log_counter.info_count > 1 or - log_counter.warning_count > 0 or - log_counter.error_count > 0): + log_counter.warning_count > 0 or + log_counter.error_count > 0): logging.error("logged %d infos, %d warnings, and %d errors", log_counter.info_count, log_counter.warning_count, log_counter.error_count) diff --git a/tornado/web.py b/tornado/web.py index 5cca00629..8827209c1 100644 --- a/tornado/web.py +++ b/tornado/web.py @@ -999,7 +999,7 @@ class RequestHandler(object): self._write_buffer = [] self.set_status(304) if (self._status_code in (204, 304) or - (self._status_code >= 100 and self._status_code < 200)): + (self._status_code >= 100 and self._status_code < 200)): assert not self._write_buffer, "Cannot send body with %s" % self._status_code self._clear_headers_for_304() elif "Content-Length" not in self._headers: