diff --git a/docs/dev/testing.rst b/docs/dev/testing.rst index c9ed51644..315b9bc90 100644 --- a/docs/dev/testing.rst +++ b/docs/dev/testing.rst @@ -25,7 +25,7 @@ Should give output something like this: > mitmproxy/controller 69 0 100% > mitmproxy/dump 150 0 100% > mitmproxy/encoding 39 0 100% - > mitmproxy/filt 201 0 100% + > mitmproxy/flowfilter 201 0 100% > mitmproxy/flow 891 0 100% > mitmproxy/proxy 427 0 100% > mitmproxy/script 27 0 100% diff --git a/mitmproxy/builtins/filestreamer.py b/mitmproxy/builtins/filestreamer.py index 554277535..3436e0760 100644 --- a/mitmproxy/builtins/filestreamer.py +++ b/mitmproxy/builtins/filestreamer.py @@ -11,13 +11,13 @@ class FileStreamer: self.stream = None self.active_flows = set() # type: Set[models.Flow] - def start_stream_to_path(self, path, mode, filt): + def start_stream_to_path(self, path, mode, flt): path = os.path.expanduser(path) try: f = open(path, mode) except IOError as v: return str(v) - self.stream = io.FilteredFlowWriter(f, filt) + self.stream = io.FilteredFlowWriter(f, flt) self.active_flows = set() def configure(self, options, updated): diff --git a/mitmproxy/flow/state.py b/mitmproxy/flow/state.py index 759e53e45..1ade4309b 100644 --- a/mitmproxy/flow/state.py +++ b/mitmproxy/flow/state.py @@ -67,17 +67,17 @@ class FlowView(FlowList): def _build(self, flows, flt=None): if flt: - self.filt = flt - self._list = list(filter(self.filt, flows)) + self.filter = flt + self._list = list(filter(self.filter, flows)) def _add(self, f): - if self.filt(f): + if self.filter(f): self._list.append(f) def _update(self, f): if f not in self._list: self._add(f) - elif not self.filt(f): + elif not self.filter(f): self._remove(f) def _remove(self, f): @@ -187,12 +187,12 @@ class State(object): self.flows = FlowStore() self.view = FlowView(self.flows, None) - # These are compiled filt expressions: + # These are compiled filter expressions: self.intercept = None @property def filter_txt(self): - return getattr(self.view.filt, "pattern", None) + return getattr(self.view.filter, "pattern", None) def flow_count(self): return len(self.flows) diff --git a/test/mitmproxy/test_dump.py b/test/mitmproxy/test_dump.py index 644a3d549..00b181667 100644 --- a/test/mitmproxy/test_dump.py +++ b/test/mitmproxy/test_dump.py @@ -10,12 +10,12 @@ class TestDumpMaster(mastertest.MasterTest): mastertest.MasterTest.dummy_cycle(self, master, n, content) return master.options.tfile.getvalue() - def mkmaster(self, filt, **options): + def mkmaster(self, flt, **options): if "verbosity" not in options: options["verbosity"] = 0 if "flow_detail" not in options: options["flow_detail"] = 0 - o = dump.Options(filtstr=filt, tfile=StringIO(), **options) + o = dump.Options(filtstr=flt, tfile=StringIO(), **options) return dump.DumpMaster(None, o) def test_basic(self):