MCPcopy Create free account
hub / github.com/Qinbf/groundmap / filter_pages

Function filter_pages

scripts/k.py:425–444  ·  view source on GitHub ↗
(pages, filters)

Source from the content-addressed store, hash-verified

423# ============================================================
424
425def filter_pages(pages, filters):
426 out = []
427 for p in pages:
428 ok = True
429 for key, val in filters.items():
430 if val is None:
431 continue
432 if key == "type" and p.type != val:
433 ok = False
434 elif key == "status" and p.status != val:
435 ok = False
436 elif key == "confidence" and p.confidence != val:
437 ok = False
438 elif key == "tag" and val not in p.tags:
439 ok = False
440 elif key == "modified_by" and p.last_modified_by != val:
441 ok = False
442 if ok:
443 out.append(p)
444 return out
445
446
447def find_orphans(pages, backlinks):

Callers 1

_main_implFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected