feat: add typer & new command
Signed-off-by: Konstantin Fickel <mail@konstantinfickel.de>
This commit is contained in:
parent
e826101a24
commit
87be5c22a2
5 changed files with 248 additions and 94 deletions
15
src/streamer/query/task.py
Normal file
15
src/streamer/query/task.py
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
from streamer.parse.shard import Shard
|
||||
|
||||
|
||||
def find_by_markers(shard: Shard, has: list[str], has_not: list[str]) -> list[Shard]:
|
||||
found_shards = []
|
||||
|
||||
if any(tag in has for tag in shard.markers) and not any(
|
||||
tag in has_not for tag in shard.markers
|
||||
):
|
||||
found_shards.append(shard)
|
||||
|
||||
for child in shard.children:
|
||||
found_shards.extend(find_by_markers(child, has, has_not))
|
||||
|
||||
return found_shards
|
||||
Loading…
Add table
Add a link
Reference in a new issue