diff options
author | Aldo Cortesi <aldo@nullcube.com> | 2017-03-16 07:53:19 +1300 |
---|---|---|
committer | Aldo Cortesi <aldo@corte.si> | 2017-03-16 08:50:29 +1300 |
commit | 169068c7ec97ae0dfb64cfa5e5b1588c6e62297d (patch) | |
tree | d33b3900b01c87c0fb13258ccde43e1c1238f57b /mitmproxy/master.py | |
parent | ef582333ff432e11e696b95d7da456d8b6eae5cd (diff) | |
download | mitmproxy-169068c7ec97ae0dfb64cfa5e5b1588c6e62297d.tar.gz mitmproxy-169068c7ec97ae0dfb64cfa5e5b1588c6e62297d.tar.bz2 mitmproxy-169068c7ec97ae0dfb64cfa5e5b1588c6e62297d.zip |
Clean up addonmanager interface
Clarify the plethora of invocation methods we've sprouted, correct some usages
in the codebase.
Diffstat (limited to 'mitmproxy/master.py')
-rw-r--r-- | mitmproxy/master.py | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/mitmproxy/master.py b/mitmproxy/master.py index 69359de6..19d069bc 100644 --- a/mitmproxy/master.py +++ b/mitmproxy/master.py @@ -65,8 +65,7 @@ class Master: """ level: debug, info, warn, error """ - with self.handlecontext(): - self.addons("log", log.LogEntry(e, level)) + self.addons.trigger("log", log.LogEntry(e, level)) def start(self): self.should_exit.clear() @@ -86,9 +85,8 @@ class Master: def tick(self, timeout): if self.first_tick: self.first_tick = False - self.addons.invoke_all_with_context("running") - with self.handlecontext(): - self.addons("tick") + self.addons.trigger("running") + self.addons.trigger("tick") changed = False try: mtype, obj = self.event_queue.get(timeout=timeout) |