view: add id-based flow selection

This commit is contained in:
Maximilian Hils 2021-08-12 10:18:56 +02:00
parent 94172594b3
commit 8866cc31bd

View File

@ -9,6 +9,7 @@ The View:
removed from the store. removed from the store.
""" """
import collections import collections
import re
import typing import typing
import blinker import blinker
@ -449,6 +450,9 @@ class View(collections.abc.Sequence):
return [i for i in self._store.values() if i.marked] return [i for i in self._store.values() if i.marked]
elif flow_spec == "@unmarked": elif flow_spec == "@unmarked":
return [i for i in self._store.values() if not i.marked] return [i for i in self._store.values() if not i.marked]
elif re.match(r"@[0-9a-f\-,]{36,}", flow_spec):
ids = flow_spec[1:].split(",")
return [i for i in self._store.values() if i.id in ids]
else: else:
filt = flowfilter.parse(flow_spec) filt = flowfilter.parse(flow_spec)
if not filt: if not filt: