Skip to content

Commit a14e76a

Browse files
committed
feat(models): allowing directory handler having no extractor
1 parent cd47b7d commit a14e76a

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

Diff for: python/unblob/models.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -408,12 +408,15 @@ def get_files(self, directory: Path) -> Iterable[Path]:
408408
return [path] if path.exists() else []
409409

410410

411-
class DirectoryHandler(abc.ABC):
411+
TExtractor = TypeVar("TExtractor", bound=Union[None, Extractor])
412+
413+
414+
class DirectoryHandler(abc.ABC, Generic[TExtractor]):
412415
"""A directory type handler is responsible for searching, validating and "unblobbing" files from multiple files in a directory."""
413416

414417
NAME: str
415418

416-
EXTRACTOR: DirectoryExtractor
419+
EXTRACTOR: TExtractor
417420

418421
PATTERN: DirectoryPattern
419422

@@ -439,9 +442,6 @@ def extract(self, paths: list[Path], outdir: Path) -> Optional[ExtractResult]:
439442
return self.EXTRACTOR.extract(paths, outdir)
440443

441444

442-
TExtractor = TypeVar("TExtractor", bound=Union[None, Extractor])
443-
444-
445445
class Handler(abc.ABC, Generic[TExtractor]):
446446
"""A file type handler is responsible for searching, validating and "unblobbing" files from Blobs."""
447447

0 commit comments

Comments
 (0)