diff options
author | Thomas Kriechbaumer <thomas@kriechbaumer.name> | 2015-06-18 18:12:11 +0200 |
---|---|---|
committer | Thomas Kriechbaumer <thomas@kriechbaumer.name> | 2015-06-18 18:15:22 +0200 |
commit | 7a3623a14ee2ffa021c1a2a8f337826e055b328d (patch) | |
tree | 7abdfdba135ea1f6022a8a72b1c52371f76fbea2 /libpathod/pathoc.py | |
parent | 90aeda47aead50110ee4a0a29b01edd170539818 (diff) | |
download | mitmproxy-7a3623a14ee2ffa021c1a2a8f337826e055b328d.tar.gz mitmproxy-7a3623a14ee2ffa021c1a2a8f337826e055b328d.tar.bz2 mitmproxy-7a3623a14ee2ffa021c1a2a8f337826e055b328d.zip |
fix pep8 whitespace
Diffstat (limited to 'libpathod/pathoc.py')
-rw-r--r-- | libpathod/pathoc.py | 74 |
1 files changed, 39 insertions, 35 deletions
diff --git a/libpathod/pathoc.py b/libpathod/pathoc.py index 6b040214..0627f8ca 100644 --- a/libpathod/pathoc.py +++ b/libpathod/pathoc.py @@ -26,6 +26,7 @@ class PathocError(Exception): class SSLInfo(object): + def __init__(self, certchain, cipher, alp): self.certchain, self.cipher, self.alp = certchain, cipher, alp @@ -66,6 +67,7 @@ class SSLInfo(object): class Response(object): + def __init__( self, httpversion, @@ -85,6 +87,7 @@ class Response(object): class WebsocketFrameReader(threading.Thread): + def __init__( self, rfile, @@ -143,6 +146,7 @@ class WebsocketFrameReader(threading.Thread): class Pathoc(tcp.TCPClient): + def __init__( self, address, @@ -157,23 +161,23 @@ class Pathoc(tcp.TCPClient): # HTTP/2 use_http2=False, http2_skip_connection_preface=False, - http2_framedump = False, + http2_framedump=False, # Websockets - ws_read_limit = None, + ws_read_limit=None, # Network - timeout = None, + timeout=None, # Output control - showreq = False, - showresp = False, - explain = False, - hexdump = False, - ignorecodes = (), - ignoretimeout = False, - showsummary = False, - fp = sys.stdout + showreq=False, + showresp=False, + explain=False, + hexdump=False, + ignorecodes=(), + ignoretimeout=False, + showsummary=False, + fp=sys.stdout ): """ spec: A request specification @@ -222,11 +226,11 @@ class Pathoc(tcp.TCPClient): self.protocol = None self.settings = language.Settings( - is_client = True, - staticdir = os.getcwd(), - unconstrained_file_access = True, - request_host = self.address.host, - protocol = self.protocol, + is_client=True, + staticdir=os.getcwd(), + unconstrained_file_access=True, + request_host=self.address.host, + protocol=self.protocol, ) def log(self): @@ -323,8 +327,8 @@ class Pathoc(tcp.TCPClient): while True: try: frm = self.ws_framereader.frames_queue.get( - timeout = timeout, - block = True if timeout != 0 else False + timeout=timeout, + block=True if timeout != 0 else False ) except Queue.Empty: if finish: @@ -394,7 +398,7 @@ class Pathoc(tcp.TCPClient): ) resp.append(self.sslinfo) resp = Response(*resp) - except http.HttpError, v: + except http.HttpError as v: log("Invalid server response: %s" % v) raise except tcp.NetLibTimeout: @@ -455,22 +459,22 @@ def main(args): # pragma: nocover playlist = random.choice(args.requests) p = Pathoc( (args.host, args.port), - ssl = args.ssl, - sni = args.sni, - sslversion = args.sslversion, - clientcert = args.clientcert, - ciphers = args.ciphers, - use_http2 = args.use_http2, - http2_skip_connection_preface = args.http2_skip_connection_preface, - http2_framedump = args.http2_framedump, - showreq = args.showreq, - showresp = args.showresp, - explain = args.explain, - hexdump = args.hexdump, - ignorecodes = args.ignorecodes, - timeout = args.timeout, - ignoretimeout = args.ignoretimeout, - showsummary = True + ssl=args.ssl, + sni=args.sni, + sslversion=args.sslversion, + clientcert=args.clientcert, + ciphers=args.ciphers, + use_http2=args.use_http2, + http2_skip_connection_preface=args.http2_skip_connection_preface, + http2_framedump=args.http2_framedump, + showreq=args.showreq, + showresp=args.showresp, + explain=args.explain, + hexdump=args.hexdump, + ignorecodes=args.ignorecodes, + timeout=args.timeout, + ignoretimeout=args.ignoretimeout, + showsummary=True ) trycount = 0 try: |