Zap object base class

This commit is contained in:
Aldo Cortesi
2016-10-17 17:11:21 +13:00
parent 666c59cbfb
commit fb22f2ff4f
65 changed files with 115 additions and 114 deletions

View File

@@ -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

View File

@@ -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

View File

@@ -53,7 +53,7 @@ class Method(base.OptionsOrValue):
]
class _HeaderMixin(object):
class _HeaderMixin():
unique_name = None
def format_header(self, key, value):

View File

@@ -40,7 +40,7 @@ def get_header(val, headers):
return None
class _HeaderMixin(object):
class _HeaderMixin():
unique_name = None
def values(self, settings):

View File

@@ -5,7 +5,7 @@ from netlib import strutils
LOG_TRUNCATE = 1024
class Message(object):
class Message():
__metaclass__ = abc.ABCMeta
logattrs = []

View File

@@ -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 = []

View File

@@ -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

View File

@@ -30,7 +30,7 @@ class PathodError(Exception):
pass
class SSLOptions(object):
class SSLOptions():
def __init__(
self,
confdir=CONFDIR,

View File

@@ -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

View File

@@ -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

View File

@@ -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.