From 476badf45cd085d69b6162cd48983e3cd22cefcc Mon Sep 17 00:00:00 2001 From: Thomas Kriechbaumer Date: Mon, 10 Aug 2015 20:36:47 +0200 Subject: [PATCH] cleanup imports --- netlib/http/authentication.py | 2 -- netlib/http/http1/protocol.py | 4 ---- netlib/http/semantics.py | 4 ---- netlib/websockets/frame.py | 5 ++--- netlib/websockets/protocol.py | 5 ++--- test/http/http1/test_protocol.py | 1 - test/http/test_semantics.py | 10 ++++------ test/test_utils.py | 1 - test/tservers.py | 3 ++- test/websockets/test_websockets.py | 4 +++- 10 files changed, 13 insertions(+), 26 deletions(-) diff --git a/netlib/http/authentication.py b/netlib/http/authentication.py index 9a227010d..29b9eb3c2 100644 --- a/netlib/http/authentication.py +++ b/netlib/http/authentication.py @@ -2,7 +2,6 @@ from __future__ import (absolute_import, print_function, division) from argparse import Action, ArgumentTypeError import binascii -from .. import http def parse_http_basic_auth(s): words = s.split() @@ -37,7 +36,6 @@ class NullProxyAuth(object): """ Clean up authentication headers, so they're not passed upstream. """ - pass def authenticate(self, headers_): """ diff --git a/netlib/http/http1/protocol.py b/netlib/http/http1/protocol.py index 31e9cc850..c797e930d 100644 --- a/netlib/http/http1/protocol.py +++ b/netlib/http/http1/protocol.py @@ -1,14 +1,10 @@ from __future__ import (absolute_import, print_function, division) -import binascii -import collections import string import sys -import urlparse import time from netlib import odict, utils, tcp, http from netlib.http import semantics -from .. import status_codes from ..exceptions import * class TCPHandler(object): diff --git a/netlib/http/semantics.py b/netlib/http/semantics.py index 974fe6e6a..15add9577 100644 --- a/netlib/http/semantics.py +++ b/netlib/http/semantics.py @@ -1,8 +1,4 @@ from __future__ import (absolute_import, print_function, division) -import binascii -import collections -import string -import sys import urllib import urlparse diff --git a/netlib/websockets/frame.py b/netlib/websockets/frame.py index 49d8ee10a..ad4ad0eec 100644 --- a/netlib/websockets/frame.py +++ b/netlib/websockets/frame.py @@ -1,12 +1,11 @@ from __future__ import absolute_import -import base64 -import hashlib import os import struct import io from .protocol import Masker -from netlib import utils, odict, tcp +from netlib import tcp +from netlib import utils DEFAULT = object() diff --git a/netlib/websockets/protocol.py b/netlib/websockets/protocol.py index 29b4db3db..8169309a2 100644 --- a/netlib/websockets/protocol.py +++ b/netlib/websockets/protocol.py @@ -2,10 +2,9 @@ from __future__ import absolute_import import base64 import hashlib import os -import struct -import io -from netlib import utils, odict, tcp +from netlib import odict +from netlib import utils # Colleciton of utility functions that implement small portions of the RFC6455 # WebSockets Protocol Useful for building WebSocket clients and servers. diff --git a/test/http/http1/test_protocol.py b/test/http/http1/test_protocol.py index ff70b87d5..af77c55f8 100644 --- a/test/http/http1/test_protocol.py +++ b/test/http/http1/test_protocol.py @@ -1,6 +1,5 @@ import cStringIO import textwrap -import binascii from netlib import http, odict, tcp, tutils from netlib.http import semantics diff --git a/test/http/test_semantics.py b/test/http/test_semantics.py index 59364eaeb..7ef69dcff 100644 --- a/test/http/test_semantics.py +++ b/test/http/test_semantics.py @@ -1,13 +1,11 @@ -import cStringIO -import textwrap -import binascii import mock -from mock import MagicMock -from netlib import http, odict, tcp, tutils, utils +from netlib import http +from netlib import odict +from netlib import tutils +from netlib import utils from netlib.http import semantics from netlib.http.semantics import CONTENT_MISSING -from .. import tservers class TestProtocolMixin(object): @mock.patch("netlib.http.semantics.ProtocolMixin.assemble_response") diff --git a/test/test_utils.py b/test/test_utils.py index aafa1571d..27fc5cc50 100644 --- a/test/test_utils.py +++ b/test/test_utils.py @@ -1,4 +1,3 @@ -import urlparse from netlib import utils, odict, tutils diff --git a/test/tservers.py b/test/tservers.py index 3f3ea8b4b..682a9144e 100644 --- a/test/tservers.py +++ b/test/tservers.py @@ -3,7 +3,8 @@ import threading import Queue import cStringIO import OpenSSL -from netlib import tcp, certutils, tutils +from netlib import tcp +from netlib import tutils class ServerThread(threading.Thread): diff --git a/test/websockets/test_websockets.py b/test/websockets/test_websockets.py index 9fa98172c..752f2c3ea 100644 --- a/test/websockets/test_websockets.py +++ b/test/websockets/test_websockets.py @@ -2,7 +2,9 @@ import os from nose.tools import raises -from netlib import tcp, http, websockets, tutils +from netlib import tcp +from netlib import tutils +from netlib import websockets from netlib.http import status_codes from netlib.http.exceptions import * from netlib.http.http1 import HTTP1Protocol