mirror of
https://github.com/zhigang1992/mitmproxy.git
synced 2026-04-28 20:24:59 +08:00
Zap object base class
This commit is contained in:
@@ -10,7 +10,7 @@ from netlib import human
|
||||
from . import generators, exceptions
|
||||
|
||||
|
||||
class Settings(object):
|
||||
class Settings():
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
@@ -60,7 +60,7 @@ v_naked_literal = pp.MatchFirst(
|
||||
)
|
||||
|
||||
|
||||
class Token(object):
|
||||
class Token():
|
||||
|
||||
"""
|
||||
A token in the specification language. Tokens are immutable. The token
|
||||
|
||||
@@ -18,7 +18,7 @@ DATATYPES = dict(
|
||||
)
|
||||
|
||||
|
||||
class TransformGenerator(object):
|
||||
class TransformGenerator():
|
||||
|
||||
"""
|
||||
Perform a byte-by-byte transform another generator - that is, for each
|
||||
@@ -54,7 +54,7 @@ def rand_byte(chars):
|
||||
return bytes([random.choice(chars)])
|
||||
|
||||
|
||||
class RandomGenerator(object):
|
||||
class RandomGenerator():
|
||||
|
||||
def __init__(self, dtype, length):
|
||||
self.dtype = dtype
|
||||
@@ -73,7 +73,7 @@ class RandomGenerator(object):
|
||||
return "%s random from %s" % (self.length, self.dtype)
|
||||
|
||||
|
||||
class FileGenerator(object):
|
||||
class FileGenerator():
|
||||
|
||||
def __init__(self, path):
|
||||
self.path = path
|
||||
|
||||
@@ -53,7 +53,7 @@ class Method(base.OptionsOrValue):
|
||||
]
|
||||
|
||||
|
||||
class _HeaderMixin(object):
|
||||
class _HeaderMixin():
|
||||
unique_name = None
|
||||
|
||||
def format_header(self, key, value):
|
||||
|
||||
@@ -40,7 +40,7 @@ def get_header(val, headers):
|
||||
return None
|
||||
|
||||
|
||||
class _HeaderMixin(object):
|
||||
class _HeaderMixin():
|
||||
unique_name = None
|
||||
|
||||
def values(self, settings):
|
||||
|
||||
@@ -5,7 +5,7 @@ from netlib import strutils
|
||||
LOG_TRUNCATE = 1024
|
||||
|
||||
|
||||
class Message(object):
|
||||
class Message():
|
||||
__metaclass__ = abc.ABCMeta
|
||||
logattrs = []
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@ def write_raw(fp, lines, timestamp=True):
|
||||
fp.flush()
|
||||
|
||||
|
||||
class LogCtx(object):
|
||||
class LogCtx():
|
||||
|
||||
def __init__(self, fp, hex, timestamp, rfile, wfile):
|
||||
self.lines = []
|
||||
|
||||
@@ -34,7 +34,7 @@ class PathocError(Exception):
|
||||
pass
|
||||
|
||||
|
||||
class SSLInfo(object):
|
||||
class SSLInfo():
|
||||
|
||||
def __init__(self, certchain, cipher, alp):
|
||||
self.certchain, self.cipher, self.alp = certchain, cipher, alp
|
||||
|
||||
@@ -30,7 +30,7 @@ class PathodError(Exception):
|
||||
pass
|
||||
|
||||
|
||||
class SSLOptions(object):
|
||||
class SSLOptions():
|
||||
def __init__(
|
||||
self,
|
||||
confdir=CONFDIR,
|
||||
|
||||
@@ -4,7 +4,7 @@ from netlib.http import http1
|
||||
from .. import language
|
||||
|
||||
|
||||
class HTTPProtocol(object):
|
||||
class HTTPProtocol():
|
||||
def __init__(self, pathod_handler):
|
||||
self.pathod_handler = pathod_handler
|
||||
|
||||
|
||||
@@ -15,14 +15,14 @@ import netlib.http.request
|
||||
from .. import language
|
||||
|
||||
|
||||
class TCPHandler(object):
|
||||
class TCPHandler():
|
||||
|
||||
def __init__(self, rfile, wfile=None):
|
||||
self.rfile = rfile
|
||||
self.wfile = wfile
|
||||
|
||||
|
||||
class HTTP2StateProtocol(object):
|
||||
class HTTP2StateProtocol():
|
||||
|
||||
ERROR_CODES = utils.BiDi(
|
||||
NO_ERROR=0x0,
|
||||
@@ -403,7 +403,7 @@ class HTTP2StateProtocol(object):
|
||||
return stream_id, headers, body
|
||||
|
||||
|
||||
class HTTP2Protocol(object):
|
||||
class HTTP2Protocol():
|
||||
|
||||
def __init__(self, pathod_handler):
|
||||
self.pathod_handler = pathod_handler
|
||||
|
||||
@@ -3,7 +3,7 @@ import sys
|
||||
import netlib.utils
|
||||
|
||||
|
||||
class MemBool(object):
|
||||
class MemBool():
|
||||
|
||||
"""
|
||||
Truth-checking with a memory, for use in chained if statements.
|
||||
|
||||
Reference in New Issue
Block a user