]> git.ipfire.org Git - thirdparty/tornado.git/commitdiff
style fix: misc indent flake warnings
authorPierce Lopez <pierce.lopez@gmail.com>
Mon, 1 Jan 2018 20:27:34 +0000 (15:27 -0500)
committerPierce Lopez <pierce.lopez@gmail.com>
Tue, 2 Jan 2018 20:29:05 +0000 (15:29 -0500)
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

maint/scripts/custom_fixers/fix_future_imports.py
maint/test/websocket/server.py
tornado/gen.py
tornado/http1connection.py
tornado/ioloop.py
tornado/tcpclient.py
tornado/test/runtests.py
tornado/web.py

index 48553c4a6761af343ed4f290d35297635918fac8..54ce8738098285c682ca520417935ae4c05864be 100644 (file)
@@ -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):
index 5d86b1316e67479898694ac307b1d03188f26571..c237afc78963cf68ef3fa060a6ca1f6081b5c2ab 100644 (file)
@@ -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()
index 41764461a87b1c4c14482b49b6c6b48dc5c9f973..f6b786add7b0f9f4f6a60fb4045223337ef157ab 100644 (file)
@@ -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:
index cf1572602bc4d0845a6eca6b05db38fbe75be4a3..4d20593a5a1b0757ddfc46019678b0f335512c0f 100644 (file)
@@ -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'
index 6311dda5f2386574de7bae9959bb1315f1080dd4..38c506d1bad36822a914fdf5e9dc5f0456f15c23 100644 (file)
@@ -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
index 906b8966489a3c653a901104aa36e71935872909..5496439852b15da7fed67b88859a5c92c2fd939b 100644 (file)
@@ -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
index 1bee7972639f0b3d9ed84dfa88816baea048754e..9699f5133c489fc6868ce326bda8bed0cfd7956f 100644 (file)
@@ -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)
index 5cca006295029a9c37a51e3f24e68f5d333ee2c8..8827209c1b5ccf11e9ca17a2a2caf8debc98002b 100644 (file)
@@ -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: