From 65f0885bd6809966f694d1ffb965401b8ab2cffc Mon Sep 17 00:00:00 2001 From: Aldo Cortesi Date: Fri, 24 Mar 2017 11:29:36 +1300 Subject: addon loader: add boot_into, which replaces returning from start() While we're here, expand test coverage for addonmanager to 100%, and promote to individual coverage. --- examples/complex/dns_spoofing.py | 4 ++-- examples/complex/har_dump.py | 2 +- examples/complex/remote_debug.py | 2 +- examples/complex/tls_passthrough.py | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) (limited to 'examples/complex') diff --git a/examples/complex/dns_spoofing.py b/examples/complex/dns_spoofing.py index 9f6af522..01e036b2 100644 --- a/examples/complex/dns_spoofing.py +++ b/examples/complex/dns_spoofing.py @@ -54,5 +54,5 @@ class Rerouter: flow.request.port = port -def load(opts): - return Rerouter() +def load(l): + l.boot_into(Rerouter()) diff --git a/examples/complex/har_dump.py b/examples/complex/har_dump.py index f9f8cd95..0515d0f5 100644 --- a/examples/complex/har_dump.py +++ b/examples/complex/har_dump.py @@ -25,7 +25,7 @@ HAR = {} SERVERS_SEEN = set() -def load(opts): +def load(l): """ Called once on script startup before any other events. """ diff --git a/examples/complex/remote_debug.py b/examples/complex/remote_debug.py index 0b7049d2..fa6f3d33 100644 --- a/examples/complex/remote_debug.py +++ b/examples/complex/remote_debug.py @@ -14,6 +14,6 @@ Usage: """ -def load(opts): +def load(l): import pydevd pydevd.settrace("localhost", port=5678, stdoutToServer=True, stderrToServer=True) diff --git a/examples/complex/tls_passthrough.py b/examples/complex/tls_passthrough.py index 3b3c8936..72c0244b 100644 --- a/examples/complex/tls_passthrough.py +++ b/examples/complex/tls_passthrough.py @@ -112,7 +112,7 @@ class TlsFeedback(TlsLayer): tls_strategy = None -def load(opts): +def load(l): global tls_strategy if len(sys.argv) == 2: tls_strategy = ProbabilisticStrategy(float(sys.argv[1])) -- cgit v1.2.3