aboutsummaryrefslogtreecommitdiff
path: root/src/hydrilla/builder/piggybacking.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/hydrilla/builder/piggybacking.py')
-rw-r--r--src/hydrilla/builder/piggybacking.py17
1 files changed, 11 insertions, 6 deletions
diff --git a/src/hydrilla/builder/piggybacking.py b/src/hydrilla/builder/piggybacking.py
index f732f3d..3e4084f 100644
--- a/src/hydrilla/builder/piggybacking.py
+++ b/src/hydrilla/builder/piggybacking.py
@@ -33,8 +33,9 @@ software system backends.
# Enable using with Python 3.7.
from __future__ import annotations
+import typing as t
+
from pathlib import Path, PurePosixPath
-from typing import Optional, Iterable
from ..translations import smart_gettext as _
from .common_errors import *
@@ -49,9 +50,13 @@ class Piggybacked:
'resource_must_depend' (read-only)
'package_license_files' (read-only)
"""
- def __init__(self, archives: dict[str, Path]={}, roots: dict[str, Path]={},
- package_license_files: list[PurePosixPath]=[],
- resource_must_depend: list[dict]=[]):
+ def __init__(
+ self,
+ archives: dict[str, Path] = {},
+ roots: dict[str, Path] = {},
+ package_license_files: list[PurePosixPath] = [],
+ resource_must_depend: list[dict] = []
+ ) -> None:
"""
Initialize this Piggybacked object.
@@ -77,7 +82,7 @@ class Piggybacked:
self.package_license_files = package_license_files
self.resource_must_depend = resource_must_depend
- def resolve_file(self, file_ref_name: PurePosixPath) -> Optional[Path]:
+ def resolve_file(self, file_ref_name: PurePosixPath) -> t.Optional[Path]:
"""
'file_ref_name' is a path as may appear in an index.json file. Check if
the file belongs to one of the roots we have and return either a path
@@ -107,7 +112,7 @@ class Piggybacked:
return path
- def archive_files(self) -> Iterable[tuple[PurePosixPath, Path]]:
+ def archive_files(self) -> t.Iterator[tuple[PurePosixPath, Path]]:
"""
Yield all archive files in use. Each yielded tuple holds file's desired
path relative to the piggybacked archives directory to be created and