MCPcopy
hub / github.com/mitmproxy/mitmproxy / remove

Method remove

mitmproxy/addons/view.py:429–446  ·  view source on GitHub ↗

Removes the flow from the underlying store and the view.

(self, flows: Sequence[mitmproxy.flow.Flow])

Source from the content-addressed store, hash-verified

427
428 @command.command("view.flows.remove")
429 def remove(self, flows: Sequence[mitmproxy.flow.Flow]) -> None:
430 """
431 Removes the flow from the underlying store and the view.
432 """
433 for f in flows:
434 if f.id in self._store:
435 if f.killable:
436 f.kill()
437 if f in self._view:
438 # We manually pass the index here because multiple flows may have the same
439 # sorting key, and we cannot reconstruct the index from that.
440 idx = self._view.index(f)
441 self._view.remove(f)
442 self.sig_view_remove.send(flow=f, index=idx)
443 del self._store[f.id]
444 self.sig_store_remove.send(flow=f)
445 if len(flows) > 1:
446 logging.log(ALERT, "Removed %s flows" % len(flows))
447
448 @command.command("view.flows.resolve")
449 def resolve(self, flow_spec: str) -> Sequence[mitmproxy.flow.Flow]:

Callers 15

test_removeFunction · 0.95
test_focusFunction · 0.95
test_settingsFunction · 0.95
test_simpleFunction · 0.45
__init__Method · 0.45
test_flow_duplicateMethod · 0.45
test_removeFunction · 0.45
signFunction · 0.45
mkcertFunction · 0.45
generate.pyFile · 0.45
test_script_deletionMethod · 0.45
test_nonexistentMethod · 0.45

Calls 4

killMethod · 0.45
indexMethod · 0.45
sendMethod · 0.45
logMethod · 0.45

Tested by 11

test_removeFunction · 0.76
test_focusFunction · 0.76
test_settingsFunction · 0.76
test_simpleFunction · 0.36
__init__Method · 0.36
test_flow_duplicateMethod · 0.36
test_removeFunction · 0.36
test_script_deletionMethod · 0.36
test_nonexistentMethod · 0.36
test_nonexistentMethod · 0.36