From cdc1dbf589f481bf96d322a8e28aabb6e737f62d Mon Sep 17 00:00:00 2001 From: Ben Darnell Date: Sun, 5 Jun 2011 16:11:05 -0700 Subject: [PATCH] Remove unused imports, add a few missing ones --- demos/facebook/facebook.py | 3 --- tornado/auth.py | 1 - tornado/curl_httpclient.py | 6 ------ tornado/httpclient.py | 2 ++ tornado/httputil.py | 1 + tornado/ioloop.py | 1 - tornado/iostream.py | 1 - tornado/simple_httpclient.py | 1 - tornado/stack_context.py | 1 - tornado/test/httpclient_test.py | 1 - tornado/test/httpserver_test.py | 6 ------ tornado/test/ioloop_test.py | 1 - tornado/test/web_test.py | 1 - tornado/test/wsgi_test.py | 1 - tornado/testing.py | 2 -- tornado/web.py | 1 - tornado/websocket.py | 1 - 17 files changed, 3 insertions(+), 28 deletions(-) diff --git a/demos/facebook/facebook.py b/demos/facebook/facebook.py index 1428c709..c6b8c246 100755 --- a/demos/facebook/facebook.py +++ b/demos/facebook/facebook.py @@ -14,7 +14,6 @@ # License for the specific language governing permissions and limitations # under the License. -import logging import os.path import tornado.auth import tornado.escape @@ -22,7 +21,6 @@ import tornado.httpserver import tornado.ioloop import tornado.options import tornado.web -import uimodules from tornado.options import define, options @@ -76,7 +74,6 @@ class MainHandler(BaseHandler, tornado.auth.FacebookGraphMixin): self.render("stream.html", stream=stream) -import logging class AuthLoginHandler(BaseHandler, tornado.auth.FacebookGraphMixin): @tornado.web.asynchronous def get(self): diff --git a/tornado/auth.py b/tornado/auth.py index 574bb55f..056e8a6e 100644 --- a/tornado/auth.py +++ b/tornado/auth.py @@ -59,7 +59,6 @@ import uuid from tornado import httpclient from tornado import escape from tornado.httputil import url_concat -from tornado.ioloop import IOLoop from tornado.util import bytes_type class OpenIdMixin(object): diff --git a/tornado/curl_httpclient.py b/tornado/curl_httpclient.py index e911596a..8b4e97e8 100644 --- a/tornado/curl_httpclient.py +++ b/tornado/curl_httpclient.py @@ -19,15 +19,9 @@ from __future__ import with_statement import cStringIO -import calendar import collections -import email.utils -import errno -import httplib import logging -import os import pycurl -import sys import threading import time diff --git a/tornado/httpclient.py b/tornado/httpclient.py index ac3e7f7f..781ce6e3 100644 --- a/tornado/httpclient.py +++ b/tornado/httpclient.py @@ -1,3 +1,5 @@ +import calendar +import email.utils import httplib import os import time diff --git a/tornado/httputil.py b/tornado/httputil.py index 97d796b8..fe3dcafe 100644 --- a/tornado/httputil.py +++ b/tornado/httputil.py @@ -16,6 +16,7 @@ """HTTP utility code shared by clients and servers.""" +import logging import urllib import re diff --git a/tornado/ioloop.py b/tornado/ioloop.py index f1a4794b..4eef01af 100644 --- a/tornado/ioloop.py +++ b/tornado/ioloop.py @@ -507,7 +507,6 @@ class _KQueue(object): events = {} for kevent in kevents: fd = kevent.ident - flags = 0 if kevent.filter == select.KQ_FILTER_READ: events[fd] = events.get(fd, 0) | IOLoop.READ if kevent.filter == select.KQ_FILTER_WRITE: diff --git a/tornado/iostream.py b/tornado/iostream.py index 38c1a2ba..e4781455 100644 --- a/tornado/iostream.py +++ b/tornado/iostream.py @@ -20,7 +20,6 @@ from __future__ import with_statement import collections import errno -import functools import logging import socket import sys diff --git a/tornado/simple_httpclient.py b/tornado/simple_httpclient.py index d5d2e8fd..ad15a2d3 100644 --- a/tornado/simple_httpclient.py +++ b/tornado/simple_httpclient.py @@ -13,7 +13,6 @@ import base64 import collections import contextlib import copy -import errno import functools import logging import os.path diff --git a/tornado/stack_context.py b/tornado/stack_context.py index 61b42606..e59d5c01 100644 --- a/tornado/stack_context.py +++ b/tornado/stack_context.py @@ -51,7 +51,6 @@ from __future__ import with_statement import contextlib import functools import itertools -import logging import sys import threading diff --git a/tornado/test/httpclient_test.py b/tornado/test/httpclient_test.py index 4a7c1e9f..999a1a13 100644 --- a/tornado/test/httpclient_test.py +++ b/tornado/test/httpclient_test.py @@ -5,7 +5,6 @@ from __future__ import with_statement import base64 import binascii import gzip -import logging import socket from contextlib import closing diff --git a/tornado/test/httpserver_test.py b/tornado/test/httpserver_test.py index def4f0fd..69ea01cd 100644 --- a/tornado/test/httpserver_test.py +++ b/tornado/test/httpserver_test.py @@ -2,17 +2,11 @@ from tornado import httpclient, simple_httpclient from tornado.escape import json_decode, utf8, _unicode, recursive_unicode -from tornado.iostream import IOStream from tornado.simple_httpclient import SimpleAsyncHTTPClient from tornado.testing import AsyncHTTPTestCase, LogTrapTestCase from tornado.util import b, bytes_type from tornado.web import Application, RequestHandler -import logging import os -import re -import socket -import unittest -import urllib try: import ssl diff --git a/tornado/test/ioloop_test.py b/tornado/test/ioloop_test.py index 2c718a79..2c0f5f12 100644 --- a/tornado/test/ioloop_test.py +++ b/tornado/test/ioloop_test.py @@ -3,7 +3,6 @@ import unittest import time -from tornado import ioloop from tornado.testing import AsyncTestCase, LogTrapTestCase class TestIOLoop(AsyncTestCase, LogTrapTestCase): diff --git a/tornado/test/web_test.py b/tornado/test/web_test.py index 87ffabad..39f5acb9 100644 --- a/tornado/test/web_test.py +++ b/tornado/test/web_test.py @@ -9,7 +9,6 @@ import binascii import logging import re import socket -import tornado.ioloop class CookieTestRequestHandler(RequestHandler): # stub out enough methods to make the secure_cookie functions work diff --git a/tornado/test/wsgi_test.py b/tornado/test/wsgi_test.py index 377a36f9..edca7c51 100644 --- a/tornado/test/wsgi_test.py +++ b/tornado/test/wsgi_test.py @@ -1,6 +1,5 @@ from wsgiref.validate import validator -from tornado.escape import json_encode from tornado.testing import AsyncHTTPTestCase, LogTrapTestCase from tornado.util import b from tornado.web import RequestHandler diff --git a/tornado/testing.py b/tornado/testing.py index 2e58b6c8..cd6837cf 100644 --- a/tornado/testing.py +++ b/tornado/testing.py @@ -22,13 +22,11 @@ from tornado.httpclient import AsyncHTTPClient from tornado.httpserver import HTTPServer from tornado.stack_context import StackContext, NullContext import contextlib -import functools import logging import os import sys import time import tornado.ioloop -import traceback import unittest _next_port = 10000 diff --git a/tornado/web.py b/tornado/web.py index bff107aa..6e0d6df5 100644 --- a/tornado/web.py +++ b/tornado/web.py @@ -55,7 +55,6 @@ import Cookie import base64 import binascii import calendar -import contextlib import datetime import email.utils import functools diff --git a/tornado/websocket.py b/tornado/websocket.py index 1170cff8..316ffb5f 100644 --- a/tornado/websocket.py +++ b/tornado/websocket.py @@ -16,7 +16,6 @@ import functools import hashlib import logging -import re import struct import time import tornado.escape