aboutsummaryrefslogtreecommitdiffstats
path: root/netlib
diff options
context:
space:
mode:
authorAldo Cortesi <aldo@nullcube.com>2016-10-17 17:29:45 +1300
committerAldo Cortesi <aldo@nullcube.com>2016-10-17 17:37:08 +1300
commita647b30365593a4a3056fcf6936f5441ab9eda88 (patch)
tree079b18790be5dfcc9a88f19e282b57088574d223 /netlib
parentfb22f2ff4f75783ba786935c93b75f372ede21f5 (diff)
downloadmitmproxy-a647b30365593a4a3056fcf6936f5441ab9eda88.tar.gz
mitmproxy-a647b30365593a4a3056fcf6936f5441ab9eda88.tar.bz2
mitmproxy-a647b30365593a4a3056fcf6936f5441ab9eda88.zip
python3: clean up class brackets
Diffstat (limited to 'netlib')
-rw-r--r--netlib/certutils.py4
-rw-r--r--netlib/exceptions.py2
-rw-r--r--netlib/http/authentication.py4
-rw-r--r--netlib/http/message.py2
-rw-r--r--netlib/socks.py10
-rw-r--r--netlib/tcp.py10
-rw-r--r--netlib/tutils.py2
-rw-r--r--netlib/utils.py4
-rw-r--r--netlib/websockets/frame.py4
-rw-r--r--netlib/websockets/masker.py2
-rw-r--r--netlib/wsgi.py8
11 files changed, 26 insertions, 26 deletions
diff --git a/netlib/certutils.py b/netlib/certutils.py
index 6f834466..340376d7 100644
--- a/netlib/certutils.py
+++ b/netlib/certutils.py
@@ -155,7 +155,7 @@ def dummy_cert(privkey, cacert, commonname, sans):
# return current.value
-class CertStoreEntry():
+class CertStoreEntry:
def __init__(self, cert, privatekey, chain_file):
self.cert = cert
@@ -163,7 +163,7 @@ class CertStoreEntry():
self.chain_file = chain_file
-class CertStore():
+class CertStore:
"""
Implements an in-memory certificate store.
diff --git a/netlib/exceptions.py b/netlib/exceptions.py
index 2cef77cb..1787cb72 100644
--- a/netlib/exceptions.py
+++ b/netlib/exceptions.py
@@ -16,7 +16,7 @@ class NetlibException(Exception):
super(NetlibException, self).__init__(message)
-class Disconnect():
+class Disconnect:
"""Immediate EOF"""
diff --git a/netlib/http/authentication.py b/netlib/http/authentication.py
index ea24f754..efaa7f53 100644
--- a/netlib/http/authentication.py
+++ b/netlib/http/authentication.py
@@ -23,7 +23,7 @@ def assemble_http_basic_auth(scheme, username, password):
return scheme + " " + v
-class NullProxyAuth():
+class NullProxyAuth:
"""
No proxy auth at all (returns empty challange headers)
@@ -90,7 +90,7 @@ class BasicProxyAuth(BasicAuth):
AUTH_HEADER = 'Proxy-Authorization'
-class PassMan():
+class PassMan:
def test(self, username_, password_token_):
return False
diff --git a/netlib/http/message.py b/netlib/http/message.py
index 9927daee..e693db1d 100644
--- a/netlib/http/message.py
+++ b/netlib/http/message.py
@@ -283,7 +283,7 @@ class Message(basetypes.Serializable):
self.content = body
-class decoded():
+class decoded:
"""
Deprecated: You can now directly use :py:attr:`content`.
:py:attr:`raw_content` has the encoded content.
diff --git a/netlib/socks.py b/netlib/socks.py
index 41fde1cc..5b28a8cd 100644
--- a/netlib/socks.py
+++ b/netlib/socks.py
@@ -52,7 +52,7 @@ USERNAME_PASSWORD_VERSION = utils.BiDi(
)
-class ClientGreeting():
+class ClientGreeting:
__slots__ = ("ver", "methods")
def __init__(self, ver, methods):
@@ -89,7 +89,7 @@ class ClientGreeting():
f.write(self.methods.tostring())
-class ServerGreeting():
+class ServerGreeting:
__slots__ = ("ver", "method")
def __init__(self, ver, method):
@@ -117,7 +117,7 @@ class ServerGreeting():
f.write(struct.pack("!BB", self.ver, self.method))
-class UsernamePasswordAuth():
+class UsernamePasswordAuth:
__slots__ = ("ver", "username", "password")
def __init__(self, ver, username, password):
@@ -147,7 +147,7 @@ class UsernamePasswordAuth():
f.write(self.password.encode())
-class UsernamePasswordAuthResponse():
+class UsernamePasswordAuthResponse:
__slots__ = ("ver", "status")
def __init__(self, ver, status):
@@ -170,7 +170,7 @@ class UsernamePasswordAuthResponse():
f.write(struct.pack("!BB", self.ver, self.status))
-class Message():
+class Message:
__slots__ = ("ver", "msg", "atyp", "addr")
def __init__(self, ver, msg, atyp, addr):
diff --git a/netlib/tcp.py b/netlib/tcp.py
index a0e0b69d..05ceef5a 100644
--- a/netlib/tcp.py
+++ b/netlib/tcp.py
@@ -72,7 +72,7 @@ sslversion_choices = {
}
-class SSLKeyLogger():
+class SSLKeyLogger:
def __init__(self, filename):
self.filename = filename
@@ -111,7 +111,7 @@ log_ssl_key = SSLKeyLogger.create_logfun(
os.getenv("MITMPROXY_SSLKEYLOGFILE") or os.getenv("SSLKEYLOGFILE"))
-class _FileLike():
+class _FileLike:
BLOCKSIZE = 1024 * 32
def __init__(self, o):
@@ -426,7 +426,7 @@ def close_socket(sock):
sock.close()
-class _Connection():
+class _Connection:
rbufsize = -1
wbufsize = -1
@@ -574,7 +574,7 @@ class _Connection():
return context
-class ConnectionCloser():
+class ConnectionCloser:
def __init__(self, conn):
self.conn = conn
self._canceled = False
@@ -888,7 +888,7 @@ class Counter:
self._count -= 1
-class TCPServer():
+class TCPServer:
request_queue_size = 20
def __init__(self, address):
diff --git a/netlib/tutils.py b/netlib/tutils.py
index 3fbe58b9..d22fdd1c 100644
--- a/netlib/tutils.py
+++ b/netlib/tutils.py
@@ -72,7 +72,7 @@ def raises(expected_exception, obj=None, *args, **kwargs):
raise AssertionError("No exception raised. Return value: {}".format(ret))
-class RaisesContext():
+class RaisesContext:
def __init__(self, expected_exception):
self.expected_exception = expected_exception
diff --git a/netlib/utils.py b/netlib/utils.py
index 190dda83..1a18dfcd 100644
--- a/netlib/utils.py
+++ b/netlib/utils.py
@@ -20,7 +20,7 @@ def getbit(byte, offset):
return bool(byte & mask)
-class BiDi():
+class BiDi:
"""
A wee utility class for keeping bi-directional mappings, like field
@@ -49,7 +49,7 @@ class BiDi():
return self.values.get(n, default)
-class Data():
+class Data:
def __init__(self, name):
m = importlib.import_module(name)
diff --git a/netlib/websockets/frame.py b/netlib/websockets/frame.py
index e2ff8906..eb7d9ccd 100644
--- a/netlib/websockets/frame.py
+++ b/netlib/websockets/frame.py
@@ -43,7 +43,7 @@ CLOSE_REASON = utils.BiDi(
)
-class FrameHeader():
+class FrameHeader:
def __init__(
self,
@@ -193,7 +193,7 @@ class FrameHeader():
return False
-class Frame():
+class Frame:
"""
Represents a single WebSockets frame.
Constructor takes human readable forms of the frame components.
diff --git a/netlib/websockets/masker.py b/netlib/websockets/masker.py
index 66407df6..f4f489a6 100644
--- a/netlib/websockets/masker.py
+++ b/netlib/websockets/masker.py
@@ -1,7 +1,7 @@
from __future__ import absolute_import
-class Masker():
+class Masker:
"""
Data sent from the server must be masked to prevent malicious clients
from sending data over the wire in predictable patterns.
diff --git a/netlib/wsgi.py b/netlib/wsgi.py
index 86b5ce40..07e0c9db 100644
--- a/netlib/wsgi.py
+++ b/netlib/wsgi.py
@@ -8,20 +8,20 @@ import io
from netlib import http, tcp, strutils
-class ClientConn():
+class ClientConn:
def __init__(self, address):
self.address = tcp.Address.wrap(address)
-class Flow():
+class Flow:
def __init__(self, address, request):
self.client_conn = ClientConn(address)
self.request = request
-class Request():
+class Request:
def __init__(self, scheme, method, path, http_version, headers, content):
self.scheme, self.method, self.path = scheme, method, path
@@ -47,7 +47,7 @@ def date_time_string():
return s
-class WSGIAdaptor():
+class WSGIAdaptor:
def __init__(self, app, domain, port, sversion):
self.app, self.domain, self.port, self.sversion = app, domain, port, sversion