Removes the flow from the underlying store and the view.
(self, flows: Sequence[mitmproxy.flow.Flow])
| 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]: |