From: Ben Darnell Date: Sun, 5 Jun 2011 23:11:05 +0000 (-0700) Subject: Remove unused imports, add a few missing ones X-Git-Tag: v2.0.0~28 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=cdc1dbf589f481bf96d322a8e28aabb6e737f62d;p=thirdparty%2Ftornado.git Remove unused imports, add a few missing ones --- diff --git a/demos/facebook/facebook.py b/demos/facebook/facebook.py index 1428c709f..c6b8c2468 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 574bb55fb..056e8a6e4 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 e911596a6..8b4e97e80 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 ac3e7f7ff..781ce6e3b 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 97d796b83..fe3dcafe6 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 f1a4794b7..4eef01afa 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 38c1a2ba3..e47814552 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 d5d2e8fdf..ad15a2d32 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 61b426061..e59d5c01a 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 4a7c1e9fc..999a1a131 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 def4f0fd2..69ea01cdf 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 2c718a79e..2c0f5f12e 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 87ffabadb..39f5acb9a 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 377a36f9e..edca7c510 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 2e58b6c8a..cd6837cfa 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 bff107aa7..6e0d6df59 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 1170cff8b..316ffb5f6 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