Permalink
Browse files

Autopep8 cleanups.

  • Loading branch information...
1 parent 0cb3924 commit 06c09038cf33cab6e1632ef2ffc16e6a1f117484 @bdarnell bdarnell committed Aug 27, 2012
View
2 tornado/auth.py
@@ -862,7 +862,7 @@ def get_authenticated_user(self, callback):
self._on_get_user_info, callback, session),
session_key=session["session_key"],
uids=session["uid"],
- fields="uid,first_name,last_name,name,locale,pic_square," \
+ fields="uid,first_name,last_name,name,locale,pic_square,"
"profile_url,username")
def facebook_request(self, method, callback, **args):
View
1 tornado/iostream.py
@@ -670,7 +670,6 @@ def _do_ssl_handshake(self):
self._ssl_connect_callback = None
self._run_callback(callback)
-
def _handle_read(self):
if self._ssl_accepting:
self._do_ssl_handshake()
View
2 tornado/platform/twisted.py
@@ -281,7 +281,7 @@ def getWriters(self):
# IOLoop.start() instead of Reactor.run().
def stop(self):
PosixReactorBase.stop(self)
- fire_shutdown = functools.partial(self.fireSystemEvent,"shutdown")
+ fire_shutdown = functools.partial(self.fireSystemEvent, "shutdown")
self._io_loop.add_callback(fire_shutdown)
def crash(self):
View
2 tornado/stack_context.py
@@ -197,7 +197,7 @@ def wrap(fn):
def wrapped(*args, **kwargs):
callback, contexts, args = args[0], args[1], args[2:]
-
+
if contexts is _state.contexts or not contexts:
callback(*args, **kwargs)
return
View
2 tornado/test/httpserver_test.py
@@ -56,7 +56,7 @@ def get_app(self):
class SSLTestMixin(object):
def get_ssl_options(self):
- return dict(ssl_version = self.get_ssl_version(),
+ return dict(ssl_version=self.get_ssl_version(),
**AsyncHTTPSTestCase.get_ssl_options())
def get_ssl_version(self):
View
8 tornado/test/iostream_test.py
@@ -79,6 +79,7 @@ def test_read_zero_bytes(self):
def test_write_while_connecting(self):
stream = self._make_client_iostream()
connected = [False]
+
def connected_callback():
connected[0] = True
self.stop()
@@ -87,6 +88,7 @@ def connected_callback():
# unlike the previous tests, try to write before the connection
# is complete.
written = [False]
+
def write_callback():
written[0] = True
self.stop()
@@ -111,7 +113,7 @@ class TestIOStreamMixin(object):
def _make_server_iostream(self, connection, **kwargs):
raise NotImplementedError()
- def _make_client_iostream(self, connection ,**kwargs):
+ def _make_client_iostream(self, connection, **kwargs):
raise NotImplementedError()
def make_iostream_pair(self, **kwargs):
@@ -346,23 +348,27 @@ def test_close_callback_with_pending_read(self):
server.close()
client.close()
+
class TestIOStreamWebHTTP(TestIOStreamWebMixin, AsyncHTTPTestCase,
LogTrapTestCase):
def _make_client_iostream(self):
return IOStream(socket.socket(), io_loop=self.io_loop)
+
class TestIOStreamWebHTTPS(TestIOStreamWebMixin, AsyncHTTPSTestCase,
LogTrapTestCase):
def _make_client_iostream(self):
return SSLIOStream(socket.socket(), io_loop=self.io_loop)
+
class TestIOStream(TestIOStreamMixin, AsyncTestCase, LogTrapTestCase):
def _make_server_iostream(self, connection, **kwargs):
return IOStream(connection, io_loop=self.io_loop, **kwargs)
def _make_client_iostream(self, connection, **kwargs):
return IOStream(connection, io_loop=self.io_loop, **kwargs)
+
class TestIOStreamSSL(TestIOStreamMixin, AsyncTestCase, LogTrapTestCase):
def _make_server_iostream(self, connection, **kwargs):
ssl_options = dict(
View
1 tornado/test/locale_test.py
@@ -4,6 +4,7 @@
import tornado.locale
import unittest
+
class TranslationLoaderTest(unittest.TestCase):
# TODO: less hacky way to get isolated tests
SAVE_VARS = ['_translations', '_supported_locales', '_use_gettext']
View
1 tornado/test/options_test.py
@@ -11,6 +11,7 @@
from tornado.options import _Options, _LogFormatter
from tornado.util import b, bytes_type
+
@contextlib.contextmanager
def ignore_bytes_warning():
if not hasattr(warnings, 'catch_warnings'):
View
2 tornado/test/runtests.py
@@ -55,7 +55,7 @@ def all():
import tornado.testing
kwargs = {}
- if sys.version_info >= (3,2):
+ if sys.version_info >= (3, 2):
# HACK: unittest.main will make its own changes to the warning
# configuration, which may conflict with the settings above
# or command-line flags like -bb. Passing warnings=False
View
1 tornado/test/twisted_test.py
@@ -230,6 +230,7 @@ def doWrite(self):
if have_twisted:
Writer = implementer(IWriteDescriptor)(Writer)
+
class ReactorReaderWriterTest(ReactorTestCase):
def _set_nonblocking(self, fd):
flags = fcntl.fcntl(fd, fcntl.F_GETFL)
View
1 tornado/test/wsgi_test.py
@@ -73,6 +73,7 @@ class WSGIConnectionTest(HTTPConnectionTest):
def get_app(self):
return WSGIContainer(validator(WSGIApplication(self.get_handlers())))
+
class WSGIWebTest(WSGISafeWebTest):
def get_app(self):
self.app = WSGIApplication(self.get_handlers(), **self.get_app_kwargs())
View
1 tornado/testing.py
@@ -247,7 +247,6 @@ def get_http_server(self):
return HTTPServer(self._app, io_loop=self.io_loop,
**self.get_httpserver_options())
-
def get_app(self):
"""Should be overridden by subclasses to return a
tornado.web.Application or other HTTPServer callback.
View
2 tornado/web.py
@@ -1577,7 +1577,7 @@ def get(self, path, include_body=True):
cache_time = self.get_cache_time(path, modified, mime_type)
if cache_time > 0:
- self.set_header("Expires", datetime.datetime.utcnow() + \
+ self.set_header("Expires", datetime.datetime.utcnow() +
datetime.timedelta(seconds=cache_time))
self.set_header("Cache-Control", "max-age=" + str(cache_time))
else:

0 comments on commit 06c0903

Please sign in to comment.