refactor(evidence): migrate acquisition and preprocessing (#30)
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
"""Evidence acquisition operations over the credential-free source contract."""
|
||||
|
||||
from collections.abc import Iterable
|
||||
|
||||
from tht.evidence.contracts import AcquiredDocument, EvidenceSource, SourceObject
|
||||
|
||||
|
||||
def discover(source: EvidenceSource) -> Iterable[SourceObject]:
|
||||
"""Discover source objects without changing source-defined laziness or ordering."""
|
||||
return source.discover()
|
||||
|
||||
|
||||
def acquire(source: EvidenceSource, item: SourceObject) -> AcquiredDocument:
|
||||
"""Acquire one discovered object, preserving the source's classified failures."""
|
||||
return source.acquire(item)
|
||||
|
||||
|
||||
__all__ = ["acquire", "discover"]
|
||||
Reference in New Issue
Block a user