]> git.ipfire.org Git - thirdparty/tornado.git/commitdiff
Standardize future imports for all files in the package.
authorBen Darnell <ben@bendarnell.com>
Thu, 9 Feb 2012 07:22:51 +0000 (23:22 -0800)
committerBen Darnell <ben@bendarnell.com>
Thu, 9 Feb 2012 07:22:51 +0000 (23:22 -0800)
49 files changed:
tornado/__init__.py
tornado/auth.py
tornado/autoreload.py
tornado/curl_httpclient.py
tornado/database.py
tornado/escape.py
tornado/gen.py
tornado/httpclient.py
tornado/httpserver.py
tornado/httputil.py
tornado/ioloop.py
tornado/iostream.py
tornado/locale.py
tornado/netutil.py
tornado/options.py
tornado/platform/auto.py
tornado/platform/interface.py
tornado/platform/posix.py
tornado/platform/twisted.py
tornado/platform/windows.py
tornado/process.py
tornado/simple_httpclient.py
tornado/stack_context.py
tornado/template.py
tornado/test/auth_test.py
tornado/test/curl_httpclient_test.py
tornado/test/escape_test.py
tornado/test/gen_test.py
tornado/test/httpclient_test.py
tornado/test/httpserver_test.py
tornado/test/httputil_test.py
tornado/test/import_test.py
tornado/test/ioloop_test.py
tornado/test/iostream_test.py
tornado/test/process_test.py
tornado/test/run_pyversion_tests.py
tornado/test/runtests.py
tornado/test/simple_httpclient_test.py
tornado/test/stack_context_test.py
tornado/test/template_test.py
tornado/test/testing_test.py
tornado/test/twisted_test.py
tornado/test/web_test.py
tornado/test/wsgi_test.py
tornado/testing.py
tornado/util.py
tornado/web.py
tornado/websocket.py
tornado/wsgi.py

index 12a94b3f4a93acd4db79ea4149c316ea874b102b..8ab36594d898c6dd43a5bc30c5a667d0b5be4a32 100644 (file)
@@ -16,6 +16,8 @@
 
 """The Tornado web server and tools."""
 
+from __future__ import absolute_import, with_statement
+
 # version is a human-readable version number.
 
 # version_info is a four-tuple for programmatic comparison. The first
index a7162105304c546af3e1cdcde4a91a759375b077..9f1a7a7a66d9fe0c19e0b75445b9921b19bc1125 100644 (file)
@@ -44,6 +44,8 @@ Example usage for Google OpenID::
             # Save the user with, e.g., set_secure_cookie()
 """
 
+from __future__ import absolute_import, with_statement
+
 import base64
 import binascii
 import hashlib
index 7e3a3d73c330ee46482513d9d285ec6616d2b510..4d23f1984ac0fd87ba9c55c5026177f87594f316 100644 (file)
@@ -26,7 +26,7 @@ and Google AppEngine.  It also will not work correctly when HTTPServer's
 multi-process mode is used.
 """
 
-from __future__ import with_statement
+from __future__ import absolute_import, with_statement
 
 import functools
 import logging
index a338cb8d6603b060945feeb5c08b56c1f5b161f7..9cfbbb74c11438240a006eb92ff482784ade1aab 100644 (file)
@@ -16,7 +16,7 @@
 
 """Blocking and non-blocking HTTP client implementations using pycurl."""
 
-from __future__ import with_statement
+from __future__ import absolute_import, with_statement
 
 import cStringIO
 import collections
index 97717137672005f62bc487f397a06a3984550b9e..26e4a603a3631619ff63e6f24466d7ec040c716b 100644 (file)
@@ -16,6 +16,8 @@
 
 """A lightweight wrapper around MySQLdb."""
 
+from __future__ import absolute_import, with_statement
+
 import copy
 import MySQLdb.constants
 import MySQLdb.converters
index 4010b1c92dd50b21318e7e5b4f5d74a907c6bbf7..a9de7e3965c1c6d74932acf345f0f2d0054e2bf1 100644 (file)
@@ -20,6 +20,8 @@ Also includes a few other miscellaneous string manipulation functions that
 have crept in over time.
 """
 
+from __future__ import absolute_import, with_statement
+
 import htmlentitydefs
 import re
 import sys
index 51be53760187084ade525a799973098a9e8b6af9..21ba8f8278cba7bad2b887cf9465b9fe1660704e 100644 (file)
@@ -62,7 +62,7 @@ it was called with one argument, the result is that argument.  If it was
 called with more than one argument or any keyword arguments, the result
 is an `Arguments` object, which is a named tuple ``(args, kwargs)``.
 """
-from __future__ import with_statement
+from __future__ import absolute_import, with_statement
 
 import functools
 import operator
index 354d907c374082388e93153ed236799c3a2c507c..5b4bac240608436f66b80ff089864581b5167a33 100644 (file)
@@ -29,6 +29,8 @@ you use a recent version of ``libcurl`` and ``pycurl``.  Currently the minimum
 supported version is 7.18.2, and the recommended version is 7.21.1 or newer.
 """
 
+from __future__ import absolute_import, with_statement
+
 import calendar
 import email.utils
 import httplib
index e24c3768e5018347e6a6b1a2ac6ab07e72d34d2e..11602d287f73f97d6cff92cc5f583045deaa3b7f 100644 (file)
@@ -24,6 +24,8 @@ This module also defines the `HTTPRequest` class which is exposed via
 `tornado.web.RequestHandler.request`.
 """
 
+from __future__ import absolute_import, with_statement
+
 import Cookie
 import logging
 import socket
index 2398ade95e57eabae7c9f3b7abe02be2d5be4f1e..a197707b0f06d81563437246c6ce19f0728db9e4 100644 (file)
@@ -16,6 +16,8 @@
 
 """HTTP utility code shared by clients and servers."""
 
+from __future__ import absolute_import, with_statement
+
 import logging
 import urllib
 import re
index edd2fec2e3ee27f97d4c0b9c80f845c6eb00f10c..1f3f9bc2770a8f8a8e9a506b28ea100f519a4af1 100644 (file)
@@ -26,7 +26,7 @@ In addition to I/O events, the `IOLoop` can also schedule time-based events.
 `IOLoop.add_timeout` is a non-blocking alternative to `time.sleep`.
 """
 
-from __future__ import with_statement
+from __future__ import absolute_import, with_statement
 
 import datetime
 import errno
index db7895f0ed057e4639b42622801838b358393ce2..95c659615fb0f153fda42b516ec208cdb91d9e08 100644 (file)
@@ -16,7 +16,7 @@
 
 """A utility class to write to and read from a non-blocking socket."""
 
-from __future__ import with_statement
+from __future__ import absolute_import, with_statement
 
 import collections
 import errno
index 61cdb7e7eb68f662f888cf0baf70e3974b826d5e..dd2a0e233c157ea4051e311d3dc754fd1e5d6737 100644 (file)
@@ -39,6 +39,8 @@ supported by gettext and related tools).  If neither method is called,
 the locale.translate method will simply return the original string.
 """
 
+from __future__ import absolute_import, with_statement
+
 import csv
 import datetime
 import logging
index 1e1bcbf91708266ab13d0565c22857304e565f2a..517367791db11d515a906441f4752129c5d56bff 100644 (file)
@@ -16,6 +16,8 @@
 
 """Miscellaneous network utility code."""
 
+from __future__ import absolute_import, with_statement
+
 import errno
 import logging
 import os
index 5fb91e1fe1a32320ebcaa3cc04105463aae018d5..a7344421be7417f48706cb70c9ebd691cb1e424c 100644 (file)
@@ -48,6 +48,8 @@ kwarg to define). We also accept multi-value options. See the documentation
 for define() below.
 """
 
+from __future__ import absolute_import, with_statement
+
 import datetime
 import logging
 import logging.handlers
index e76d731b3ed15eccd50336ded1565ffc8640749a..086fe70b503b9ed2077e93f6c638f7593ea9374e 100644 (file)
@@ -23,6 +23,8 @@ Most code that needs access to this functionality should do e.g.::
     from tornado.platform.auto import set_close_exec
 """
 
+from __future__ import absolute_import, with_statement
+
 import os
 
 if os.name == 'nt':
index 20f0f7161bf0d4fe2f4317a4c4e4abc4f8d8d6e2..0879b5a0bc99301889496852f083628b18b00a68 100644 (file)
@@ -21,6 +21,8 @@ for other tornado.platform modules.  Most code should import the appropriate
 implementation from `tornado.platform.auto`.
 """
 
+from __future__ import absolute_import, with_statement
+
 def set_close_exec(fd):
     """Sets the close-on-exec bit (``FD_CLOEXEC``)for a file descriptor."""
     raise NotImplementedError()
index aa09b31c75506d0b11a0f6ad0e01156256a0eed0..40afbad4e82f570de1a09b258d68b851ed1c67ae 100644 (file)
@@ -16,6 +16,8 @@
 
 """Posix implementations of platform-specific functionality."""
 
+from __future__ import absolute_import, with_statement
+
 import fcntl
 import os
 
index 5d406d3471c6b502bf000a2a1aaa990f821969b7..ed426fcc3477f0f9af1660c277798cf12640f8e9 100644 (file)
@@ -44,7 +44,7 @@ before closing the `IOLoop`.
 This module has been tested with Twisted versions 11.0.0 and 11.1.0.
 """
 
-from __future__ import with_statement, absolute_import
+from __future__ import absolute_import, with_statement
 
 import functools
 import logging
index 1735f1b38d0f3fd4119f4844209a6d72fc3a4d8b..cef82e901a3f5b55b31823d02820caffc9bfaa46 100644 (file)
@@ -1,6 +1,8 @@
 # NOTE: win32 support is currently experimental, and not recommended
 # for production use.
 
+
+from __future__ import absolute_import, with_statement
 import ctypes
 import ctypes.wintypes
 import socket
index 06f6aa9b03a928b42d70ee2d1c035a5748dfe63a..4958fa499d2ed39ebe71ee30b9a9eb125c7f8f08 100644 (file)
@@ -16,6 +16,8 @@
 
 """Utilities for working with multiple processes."""
 
+from __future__ import absolute_import, with_statement
+
 import errno
 import logging
 import os
index c301295a5011f093ee9fc885007063b9541b7549..a6cba17baac6f994a10be6c9d7fade36824d9dd6 100644 (file)
@@ -1,5 +1,5 @@
 #!/usr/bin/env python
-from __future__ import with_statement
+from __future__ import absolute_import, with_statement
 
 from tornado.escape import utf8, _unicode, native_str
 from tornado.httpclient import HTTPRequest, HTTPResponse, HTTPError, AsyncHTTPClient, main
index 1ba3730c3d212176eda7012cf849026a7040b179..fe229cdcb94cd07ef9b836a32005d8a001500d7c 100644 (file)
@@ -66,7 +66,7 @@ Here are a few rules of thumb for when it's necessary:
   block that references your `StackContext`.
 '''
 
-from __future__ import with_statement
+from __future__ import absolute_import, with_statement
 
 import contextlib
 import functools
index 139667dce29d8f565259d23fe3c83fd96c1e084b..69813eb5adf1f9f560e7b1920359987792642042 100644 (file)
@@ -172,7 +172,7 @@ with ``{# ... #}``.
     Same as the python ``while`` statement.
 """
 
-from __future__ import with_statement
+from __future__ import absolute_import, with_statement
 
 import cStringIO
 import datetime
index 2047904099b4ecd8ade7f94c9f7102ae10624f39..06903a0bc8cecbfe3847db2239d34ba4d66057e1 100644 (file)
@@ -3,6 +3,8 @@
 # and ensure that it doesn't blow up (e.g. with unicode/bytes issues in
 # python 3)
 
+
+from __future__ import absolute_import, with_statement
 from tornado.auth import OpenIdMixin, OAuthMixin, OAuth2Mixin
 from tornado.escape import json_decode
 from tornado.testing import AsyncHTTPTestCase, LogTrapTestCase
index afa56f8f752556f2ebe68e21d013f3edace4f558..35aaf97580146d1a29bb10a13eb7150e09f2fe24 100644 (file)
@@ -1,3 +1,4 @@
+from __future__ import absolute_import, with_statement
 from tornado.test.httpclient_test import HTTPClientCommonTestCase
 
 try:
index 42ba50bbf5adba2f2dc18ebfcff271caefd6ac54..b34fcab50fda11a136c739b8c84dcee8c36d5773 100644 (file)
@@ -1,5 +1,7 @@
 #!/usr/bin/env python
 
+
+from __future__ import absolute_import, with_statement
 import tornado.escape
 import unittest
 
index 935b409482cff079458d87a5f3f64555e3f5ef10..2f40e774d36577eb9d894a4946e4a6d2c532fd85 100644 (file)
@@ -1,3 +1,4 @@
+from __future__ import absolute_import, with_statement
 import functools
 from tornado.escape import url_escape
 from tornado.httpclient import AsyncHTTPClient
index 8388338b48c15ec50d4e34a32aad1e5caf26ad34..bf1e19cd2af72c3b89bac15db631b238c517da26 100644 (file)
@@ -1,6 +1,6 @@
 #!/usr/bin/env python
 
-from __future__ import with_statement
+from __future__ import absolute_import, with_statement
 
 import base64
 import binascii
index 132af561b3cdb0529da21660ddf8b6f5512f5047..ba0e18d2e355794f06281fa1528f3feea13a5f4a 100644 (file)
@@ -1,5 +1,7 @@
 #!/usr/bin/env python
 
+
+from __future__ import absolute_import, with_statement
 from tornado import httpclient, simple_httpclient, netutil
 from tornado.escape import json_decode, utf8, _unicode, recursive_unicode, native_str
 from tornado.httpserver import HTTPServer
index e2f4421c92085333e59b26c838d658cddbfc8725..00f740d82f41508c3404656cc31a19f5e3c8b9b6 100644 (file)
@@ -1,5 +1,7 @@
 #!/usr/bin/env python
 
+
+from __future__ import absolute_import, with_statement
 from tornado.httputil import url_concat, parse_multipart_form_data, HTTPHeaders
 from tornado.escape import utf8
 from tornado.testing import LogTrapTestCase
index 7da1a1ef91b4e85bf8b4fc6fbb959803b2f3ff88..7a25fdb5a07c7e94de763a9935b4305bd759cf3c 100644 (file)
@@ -1,3 +1,4 @@
+from __future__ import absolute_import, with_statement
 import unittest
 
 class ImportTest(unittest.TestCase):
index 74bb60282d81c9325c2f5443b55705b793c8d1c5..b01afce137e2c51cbfcf0abf65bfa792227ac100 100644 (file)
@@ -1,5 +1,7 @@
 #!/usr/bin/env python
 
+
+from __future__ import absolute_import, with_statement
 import datetime
 import unittest
 import time
index 895a3de953aee949497f74d4aff26cf4bb289853..0509205f9ade865af70c06da27e020810ba40a5d 100644 (file)
@@ -1,3 +1,4 @@
+from __future__ import absolute_import, with_statement
 from tornado import netutil
 from tornado.ioloop import IOLoop
 from tornado.iostream import IOStream
index de9ae523b4b4ba8b128cbefcfa34682db155cc11..1546f3ddea5a1c06d76bc6c2a554f6ad752a76a3 100644 (file)
@@ -1,5 +1,7 @@
 #!/usr/bin/env python
 
+
+from __future__ import absolute_import, with_statement
 import logging
 import os
 import signal
index 8c4e9671c238adb3356052b72ff79c426e7b0da6..672d49561e4b5c8d996cbb598e09d27be5ad3b51 100755 (executable)
@@ -1,6 +1,8 @@
 #!/usr/bin/env python
 """Runs the tornado test suite with all supported python interpreters."""
 
+from __future__ import absolute_import, with_statement
+
 import os
 import subprocess
 import sys
index 92bd2ac0ab26dbada969365810df1b71c82fac69..14782ac7b9aa477aefc7dc97539c516c67324e07 100755 (executable)
@@ -1,4 +1,6 @@
 #!/usr/bin/env python
+
+from __future__ import absolute_import, with_statement
 import unittest
 
 TEST_MODULES = [
index 030876beb8308bc182e89ec65f9297c63463db62..4d241b027bf80a0be7380b8e6c9008e6c2d368a9 100644 (file)
@@ -1,4 +1,4 @@
-from __future__ import with_statement
+from __future__ import absolute_import, with_statement
 
 import collections
 import gzip
index b79f1e328f73448784cb6b80405d7d47ae44116e..1fbfa4d724e23da6de871c6d10d9a182b15aa1d1 100644 (file)
@@ -1,5 +1,5 @@
 #!/usr/bin/env python
-from __future__ import with_statement
+from __future__ import absolute_import, with_statement
 
 from tornado.stack_context import StackContext, wrap
 from tornado.testing import AsyncHTTPTestCase, AsyncTestCase, LogTrapTestCase
index c2a05333a9a5d19d909b7ca5e2c75baa50d26a28..bf9b3f039a8e83cddd7c93f9c5fe37edb689ecef 100644 (file)
@@ -1,4 +1,4 @@
-from __future__ import with_statement
+from __future__ import absolute_import, with_statement
 
 import traceback
 
index bdca031ed37bc998ef1090d327196359d9ab5359..3a40fb4afbee9751660c30044a557881162a7d23 100644 (file)
@@ -1,4 +1,6 @@
 #!/usr/bin/env python
+
+from __future__ import absolute_import, with_statement
 import unittest
 from tornado.testing import AsyncTestCase, LogTrapTestCase
 
index ba53c7897605c53e42ca09b14f4a3754a36b3e88..9d4e5c9d895b8ce057a85bea6a7247eb0b0bce3f 100644 (file)
@@ -17,6 +17,8 @@
 Unittest for the twisted-style reactor.
 """
 
+from __future__ import absolute_import, with_statement
+
 import os
 import thread
 import threading
index 9f4c860ebf91bc0c1da984c38ef0ff590ce50f07..c84755523be2e8e2b934b96dba985713cbe78944 100644 (file)
@@ -1,3 +1,4 @@
+from __future__ import absolute_import, with_statement
 from tornado.escape import json_decode, utf8, to_unicode, recursive_unicode, native_str
 from tornado.iostream import IOStream
 from tornado.template import DictLoader
index 9c3ff7fd55edcd2758e2370f1d3dbd38b39da9d7..ac4564e4f080fe26a96a7a3b69992afc9f314b64 100644 (file)
@@ -1,3 +1,4 @@
+from __future__ import absolute_import, with_statement
 from wsgiref.validate import validator
 
 from tornado.testing import AsyncHTTPTestCase, LogTrapTestCase
index b2b983dd0dcff2e7dce9a15be11456e89164b8f8..15b59ae0f2be49848fb0ae2c3c78ce5484415f21 100644 (file)
@@ -18,7 +18,7 @@ inheritance.  See the docstrings for each class/function below for more
 information.
 """
 
-from __future__ import with_statement
+from __future__ import absolute_import, with_statement
 
 from cStringIO import StringIO
 try:
index 6752401affb46f4983e1e7f8dfad0eda09ba0a34..f597becb70b5af440bbef0415e0aec8a6a75980c 100644 (file)
@@ -1,5 +1,7 @@
 """Miscellaneous utility functions."""
 
+from __future__ import absolute_import, with_statement
+
 class ObjectDict(dict):
     """Makes a dictionary behave like an object."""
     def __getattr__(self, name):
index c31eb674b2aa760bf9e6c17a74a2988cc5c144de..91008936223f490839e1e639cca23562fe01eaf0 100644 (file)
@@ -49,7 +49,7 @@ threads it is important to use IOLoop.add_callback to transfer control
 back to the main thread before finishing the request.
 """
 
-from __future__ import with_statement
+from __future__ import absolute_import, with_statement
 
 import Cookie
 import base64
index 8aa777716051ca5f9e440c06d9d25a6abc2aaae3..773b94bfc19e00a96b2f74cc4488f0b920821373 100644 (file)
@@ -16,6 +16,8 @@ communication between the browser and server.
    overriding `WebSocketHandler.allow_draft76` (see that method's
    documentation for caveats).
 """
+
+from __future__ import absolute_import, with_statement
 # Author: Jacob Kristhammar, 2010
 
 import array
index e8f878bb4b14ece798995a66294c14136a3513ee..08ce4eaa9175394bd3695cff39738d22b7a06d4a 100644 (file)
@@ -29,6 +29,8 @@ provides WSGI support in two ways:
   and Tornado handlers in a single server.
 """
 
+from __future__ import absolute_import, with_statement
+
 import Cookie
 import cgi
 import httplib