diff options
author | Maximilian Hils <git@maximilianhils.com> | 2015-05-31 01:51:31 +0200 |
---|---|---|
committer | Maximilian Hils <git@maximilianhils.com> | 2015-05-31 01:51:31 +0200 |
commit | ec92fca8c030fe5971a034a658033f70965b990a (patch) | |
tree | ef9a2049eeab539d13e1f9662fd51220ab4ee817 /libmproxy/controller.py | |
parent | 0f8e8ee1ad667c8d747d5876f9b630ecbc01d7e9 (diff) | |
parent | a05a70d8168a07c92b2a3ecbbb1958d85532efe3 (diff) | |
download | mitmproxy-ec92fca8c030fe5971a034a658033f70965b990a.tar.gz mitmproxy-ec92fca8c030fe5971a034a658033f70965b990a.tar.bz2 mitmproxy-ec92fca8c030fe5971a034a658033f70965b990a.zip |
Merge branch 'master' of github.com:mitmproxy/mitmproxy
Diffstat (limited to 'libmproxy/controller.py')
-rw-r--r-- | libmproxy/controller.py | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/libmproxy/controller.py b/libmproxy/controller.py index 9ca89184..98a3aec7 100644 --- a/libmproxy/controller.py +++ b/libmproxy/controller.py @@ -1,11 +1,14 @@ from __future__ import absolute_import -import Queue, threading +import Queue +import threading + class DummyReply: """ A reply object that does nothing. Useful when we need an object to seem like it has a channel, and during testing. """ + def __init__(self): self.acked = False @@ -19,6 +22,7 @@ class Reply: This object is used to respond to the message through the return channel. """ + def __init__(self, obj): self.obj = obj self.q = Queue.Queue() @@ -67,11 +71,13 @@ class Slave(threading.Thread): Slaves get a channel end-point through which they can send messages to the master. """ + def __init__(self, channel, server): self.channel, self.server = channel, server self.server.set_channel(channel) threading.Thread.__init__(self) - self.name = "SlaveThread (%s:%s)" % (self.server.address.host, self.server.address.port) + self.name = "SlaveThread (%s:%s)" % ( + self.server.address.host, self.server.address.port) def run(self): self.server.serve_forever() @@ -81,6 +87,7 @@ class Master(object): """ Masters get and respond to messages from slaves. """ + def __init__(self, server): """ server may be None if no server is needed. |