Skip to content

Commit 06c0903

Browse files
committed
Autopep8 cleanups.
1 parent 0cb3924 commit 06c0903

File tree

13 files changed

+17
-9
lines changed

13 files changed

+17
-9
lines changed

tornado/auth.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -862,7 +862,7 @@ def get_authenticated_user(self, callback):
862862
self._on_get_user_info, callback, session),
863863
session_key=session["session_key"],
864864
uids=session["uid"],
865-
fields="uid,first_name,last_name,name,locale,pic_square," \
865+
fields="uid,first_name,last_name,name,locale,pic_square,"
866866
"profile_url,username")
867867

868868
def facebook_request(self, method, callback, **args):

tornado/iostream.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -670,7 +670,6 @@ def _do_ssl_handshake(self):
670670
self._ssl_connect_callback = None
671671
self._run_callback(callback)
672672

673-
674673
def _handle_read(self):
675674
if self._ssl_accepting:
676675
self._do_ssl_handshake()

tornado/platform/twisted.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,7 @@ def getWriters(self):
281281
# IOLoop.start() instead of Reactor.run().
282282
def stop(self):
283283
PosixReactorBase.stop(self)
284-
fire_shutdown = functools.partial(self.fireSystemEvent,"shutdown")
284+
fire_shutdown = functools.partial(self.fireSystemEvent, "shutdown")
285285
self._io_loop.add_callback(fire_shutdown)
286286

287287
def crash(self):

tornado/stack_context.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ def wrap(fn):
197197

198198
def wrapped(*args, **kwargs):
199199
callback, contexts, args = args[0], args[1], args[2:]
200-
200+
201201
if contexts is _state.contexts or not contexts:
202202
callback(*args, **kwargs)
203203
return

tornado/test/httpserver_test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ def get_app(self):
5656

5757
class SSLTestMixin(object):
5858
def get_ssl_options(self):
59-
return dict(ssl_version = self.get_ssl_version(),
59+
return dict(ssl_version=self.get_ssl_version(),
6060
**AsyncHTTPSTestCase.get_ssl_options())
6161

6262
def get_ssl_version(self):

tornado/test/iostream_test.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ def test_read_zero_bytes(self):
7979
def test_write_while_connecting(self):
8080
stream = self._make_client_iostream()
8181
connected = [False]
82+
8283
def connected_callback():
8384
connected[0] = True
8485
self.stop()
@@ -87,6 +88,7 @@ def connected_callback():
8788
# unlike the previous tests, try to write before the connection
8889
# is complete.
8990
written = [False]
91+
9092
def write_callback():
9193
written[0] = True
9294
self.stop()
@@ -111,7 +113,7 @@ class TestIOStreamMixin(object):
111113
def _make_server_iostream(self, connection, **kwargs):
112114
raise NotImplementedError()
113115

114-
def _make_client_iostream(self, connection ,**kwargs):
116+
def _make_client_iostream(self, connection, **kwargs):
115117
raise NotImplementedError()
116118

117119
def make_iostream_pair(self, **kwargs):
@@ -346,23 +348,27 @@ def test_close_callback_with_pending_read(self):
346348
server.close()
347349
client.close()
348350

351+
349352
class TestIOStreamWebHTTP(TestIOStreamWebMixin, AsyncHTTPTestCase,
350353
LogTrapTestCase):
351354
def _make_client_iostream(self):
352355
return IOStream(socket.socket(), io_loop=self.io_loop)
353356

357+
354358
class TestIOStreamWebHTTPS(TestIOStreamWebMixin, AsyncHTTPSTestCase,
355359
LogTrapTestCase):
356360
def _make_client_iostream(self):
357361
return SSLIOStream(socket.socket(), io_loop=self.io_loop)
358362

363+
359364
class TestIOStream(TestIOStreamMixin, AsyncTestCase, LogTrapTestCase):
360365
def _make_server_iostream(self, connection, **kwargs):
361366
return IOStream(connection, io_loop=self.io_loop, **kwargs)
362367

363368
def _make_client_iostream(self, connection, **kwargs):
364369
return IOStream(connection, io_loop=self.io_loop, **kwargs)
365370

371+
366372
class TestIOStreamSSL(TestIOStreamMixin, AsyncTestCase, LogTrapTestCase):
367373
def _make_server_iostream(self, connection, **kwargs):
368374
ssl_options = dict(

tornado/test/locale_test.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
import tornado.locale
55
import unittest
66

7+
78
class TranslationLoaderTest(unittest.TestCase):
89
# TODO: less hacky way to get isolated tests
910
SAVE_VARS = ['_translations', '_supported_locales', '_use_gettext']

tornado/test/options_test.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
from tornado.options import _Options, _LogFormatter
1212
from tornado.util import b, bytes_type
1313

14+
1415
@contextlib.contextmanager
1516
def ignore_bytes_warning():
1617
if not hasattr(warnings, 'catch_warnings'):

tornado/test/runtests.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ def all():
5555

5656
import tornado.testing
5757
kwargs = {}
58-
if sys.version_info >= (3,2):
58+
if sys.version_info >= (3, 2):
5959
# HACK: unittest.main will make its own changes to the warning
6060
# configuration, which may conflict with the settings above
6161
# or command-line flags like -bb. Passing warnings=False

tornado/test/twisted_test.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -230,6 +230,7 @@ def doWrite(self):
230230
if have_twisted:
231231
Writer = implementer(IWriteDescriptor)(Writer)
232232

233+
233234
class ReactorReaderWriterTest(ReactorTestCase):
234235
def _set_nonblocking(self, fd):
235236
flags = fcntl.fcntl(fd, fcntl.F_GETFL)

tornado/test/wsgi_test.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ class WSGIConnectionTest(HTTPConnectionTest):
7373
def get_app(self):
7474
return WSGIContainer(validator(WSGIApplication(self.get_handlers())))
7575

76+
7677
class WSGIWebTest(WSGISafeWebTest):
7778
def get_app(self):
7879
self.app = WSGIApplication(self.get_handlers(), **self.get_app_kwargs())

tornado/testing.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,6 @@ def get_http_server(self):
247247
return HTTPServer(self._app, io_loop=self.io_loop,
248248
**self.get_httpserver_options())
249249

250-
251250
def get_app(self):
252251
"""Should be overridden by subclasses to return a
253252
tornado.web.Application or other HTTPServer callback.

tornado/web.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1577,7 +1577,7 @@ def get(self, path, include_body=True):
15771577
cache_time = self.get_cache_time(path, modified, mime_type)
15781578

15791579
if cache_time > 0:
1580-
self.set_header("Expires", datetime.datetime.utcnow() + \
1580+
self.set_header("Expires", datetime.datetime.utcnow() +
15811581
datetime.timedelta(seconds=cache_time))
15821582
self.set_header("Cache-Control", "max-age=" + str(cache_time))
15831583
else:

0 commit comments

Comments
 (0)