aboutsummaryrefslogtreecommitdiffstats
path: root/examples/simple/io_write_dumpfile.py
diff options
context:
space:
mode:
Diffstat (limited to 'examples/simple/io_write_dumpfile.py')
-rw-r--r--examples/simple/io_write_dumpfile.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/examples/simple/io_write_dumpfile.py b/examples/simple/io_write_dumpfile.py
index a0956e33..cf7c4f52 100644
--- a/examples/simple/io_write_dumpfile.py
+++ b/examples/simple/io_write_dumpfile.py
@@ -7,18 +7,19 @@ to multiple files in parallel.
"""
import random
import sys
-from mitmproxy import io
+from mitmproxy import io, http
+import typing # noqa
class Writer:
- def __init__(self, path):
+ def __init__(self, path: str) -> None:
if path == "-":
- f = sys.stdout
+ f = sys.stdout # type: typing.IO[typing.Any]
else:
f = open(path, "wb")
self.w = io.FlowWriter(f)
- def response(self, flow):
+ def response(self, flow: http.HTTPFlow) -> None:
if random.choice([True, False]):
self.w.add(flow)