From a647b30365593a4a3056fcf6936f5441ab9eda88 Mon Sep 17 00:00:00 2001 From: Aldo Cortesi Date: Mon, 17 Oct 2016 17:29:45 +1300 Subject: python3: clean up class brackets --- pathod/language/base.py | 4 ++-- pathod/language/generators.py | 6 +++--- pathod/language/http.py | 2 +- pathod/language/http2.py | 2 +- pathod/language/message.py | 2 +- pathod/log.py | 2 +- pathod/pathoc.py | 2 +- pathod/pathod.py | 2 +- pathod/protocols/http.py | 2 +- pathod/protocols/http2.py | 6 +++--- pathod/utils.py | 2 +- 11 files changed, 16 insertions(+), 16 deletions(-) (limited to 'pathod') diff --git a/pathod/language/base.py b/pathod/language/base.py index 4483c3df..11f0899d 100644 --- a/pathod/language/base.py +++ b/pathod/language/base.py @@ -10,7 +10,7 @@ from netlib import human from . import generators, exceptions -class Settings(): +class Settings: def __init__( self, @@ -60,7 +60,7 @@ v_naked_literal = pp.MatchFirst( ) -class Token(): +class Token: """ A token in the specification language. Tokens are immutable. The token diff --git a/pathod/language/generators.py b/pathod/language/generators.py index 6a543907..4e19ecd9 100644 --- a/pathod/language/generators.py +++ b/pathod/language/generators.py @@ -18,7 +18,7 @@ DATATYPES = dict( ) -class TransformGenerator(): +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(): +class RandomGenerator: def __init__(self, dtype, length): self.dtype = dtype @@ -73,7 +73,7 @@ class RandomGenerator(): return "%s random from %s" % (self.length, self.dtype) -class FileGenerator(): +class FileGenerator: def __init__(self, path): self.path = path diff --git a/pathod/language/http.py b/pathod/language/http.py index 1f1a3db3..8b5fa828 100644 --- a/pathod/language/http.py +++ b/pathod/language/http.py @@ -53,7 +53,7 @@ class Method(base.OptionsOrValue): ] -class _HeaderMixin(): +class _HeaderMixin: unique_name = None def format_header(self, key, value): diff --git a/pathod/language/http2.py b/pathod/language/http2.py index 7cb82916..35fc5ba8 100644 --- a/pathod/language/http2.py +++ b/pathod/language/http2.py @@ -40,7 +40,7 @@ def get_header(val, headers): return None -class _HeaderMixin(): +class _HeaderMixin: unique_name = None def values(self, settings): diff --git a/pathod/language/message.py b/pathod/language/message.py index 7a8594d6..03b4a2cf 100644 --- a/pathod/language/message.py +++ b/pathod/language/message.py @@ -5,7 +5,7 @@ from netlib import strutils LOG_TRUNCATE = 1024 -class Message(): +class Message: __metaclass__ = abc.ABCMeta logattrs = [] diff --git a/pathod/log.py b/pathod/log.py index 05934fd3..37100bb1 100644 --- a/pathod/log.py +++ b/pathod/log.py @@ -13,7 +13,7 @@ def write_raw(fp, lines, timestamp=True): fp.flush() -class LogCtx(): +class LogCtx: def __init__(self, fp, hex, timestamp, rfile, wfile): self.lines = [] diff --git a/pathod/pathoc.py b/pathod/pathoc.py index 008308ca..1f81ed59 100644 --- a/pathod/pathoc.py +++ b/pathod/pathoc.py @@ -34,7 +34,7 @@ class PathocError(Exception): pass -class SSLInfo(): +class SSLInfo: def __init__(self, certchain, cipher, alp): self.certchain, self.cipher, self.alp = certchain, cipher, alp diff --git a/pathod/pathod.py b/pathod/pathod.py index f67ad04e..fe8635ea 100644 --- a/pathod/pathod.py +++ b/pathod/pathod.py @@ -30,7 +30,7 @@ class PathodError(Exception): pass -class SSLOptions(): +class SSLOptions: def __init__( self, confdir=CONFDIR, diff --git a/pathod/protocols/http.py b/pathod/protocols/http.py index 5ac8516f..17930320 100644 --- a/pathod/protocols/http.py +++ b/pathod/protocols/http.py @@ -4,7 +4,7 @@ from netlib.http import http1 from .. import language -class HTTPProtocol(): +class HTTPProtocol: def __init__(self, pathod_handler): self.pathod_handler = pathod_handler diff --git a/pathod/protocols/http2.py b/pathod/protocols/http2.py index 42f1a1a0..dcd17eba 100644 --- a/pathod/protocols/http2.py +++ b/pathod/protocols/http2.py @@ -15,14 +15,14 @@ import netlib.http.request from .. import language -class TCPHandler(): +class TCPHandler: def __init__(self, rfile, wfile=None): self.rfile = rfile self.wfile = wfile -class HTTP2StateProtocol(): +class HTTP2StateProtocol: ERROR_CODES = utils.BiDi( NO_ERROR=0x0, @@ -403,7 +403,7 @@ class HTTP2StateProtocol(): return stream_id, headers, body -class HTTP2Protocol(): +class HTTP2Protocol: def __init__(self, pathod_handler): self.pathod_handler = pathod_handler diff --git a/pathod/utils.py b/pathod/utils.py index 07b6933e..2d077c48 100644 --- a/pathod/utils.py +++ b/pathod/utils.py @@ -3,7 +3,7 @@ import sys import netlib.utils -class MemBool(): +class MemBool: """ Truth-checking with a memory, for use in chained if statements. -- cgit v1.2.3