diff options
author | Aldo Cortesi <aldo@nullcube.com> | 2015-05-30 12:03:28 +1200 |
---|---|---|
committer | Aldo Cortesi <aldo@nullcube.com> | 2015-05-30 12:03:28 +1200 |
commit | a05a70d8168a07c92b2a3ecbbb1958d85532efe3 (patch) | |
tree | bc2cc0b89d05e8213280a460cbf25978583c8337 /libmproxy/protocol/primitives.py | |
parent | 1a106f4080d89a236a193f2cb007a00aa195a1ad (diff) | |
download | mitmproxy-a05a70d8168a07c92b2a3ecbbb1958d85532efe3.tar.gz mitmproxy-a05a70d8168a07c92b2a3ecbbb1958d85532efe3.tar.bz2 mitmproxy-a05a70d8168a07c92b2a3ecbbb1958d85532efe3.zip |
Add coding style check, reformat.
Diffstat (limited to 'libmproxy/protocol/primitives.py')
-rw-r--r-- | libmproxy/protocol/primitives.py | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/libmproxy/protocol/primitives.py b/libmproxy/protocol/primitives.py index f9c22e1a..2f8ea3e0 100644 --- a/libmproxy/protocol/primitives.py +++ b/libmproxy/protocol/primitives.py @@ -24,6 +24,7 @@ class Error(stateobject.StateObject): msg: Message describing the error timestamp: Seconds since the epoch """ + def __init__(self, msg, timestamp=None): """ @type msg: str @@ -59,6 +60,7 @@ class Flow(stateobject.StateObject): A Flow is a collection of objects representing a single transaction. This class is usually subclassed for each protocol, e.g. HTTPFlow. """ + def __init__(self, type, client_conn, server_conn, live=None): self.type = type self.id = str(uuid.uuid4()) @@ -165,12 +167,12 @@ class Flow(stateobject.StateObject): master.handle_accept_intercept(self) - class ProtocolHandler(object): """ A ProtocolHandler implements an application-layer protocol, e.g. HTTP. See: libmproxy.protocol.http.HTTPHandler """ + def __init__(self, c): self.c = c """@type: libmproxy.proxy.server.ConnectionHandler""" @@ -209,13 +211,20 @@ class LiveConnection(object): interface with a live connection, without exposing the internals of the ConnectionHandler. """ + def __init__(self, c): self.c = c """@type: libmproxy.proxy.server.ConnectionHandler""" self._backup_server_conn = None """@type: libmproxy.proxy.connection.ServerConnection""" - def change_server(self, address, ssl=None, sni=None, force=False, persistent_change=False): + def change_server( + self, + address, + ssl=None, + sni=None, + force=False, + persistent_change=False): """ Change the server connection to the specified address. @returns: |