aboutsummaryrefslogtreecommitdiff
path: root/src/hydrilla/builder/piggybacking.py
diff options
context:
space:
mode:
authorWojtek Kosior <koszko@koszko.org>2022-09-28 11:47:29 +0200
committerWojtek Kosior <koszko@koszko.org>2022-09-29 10:47:17 +0200
commit1a1f750ccdc1d52a7b1bd648b2188fa6e7c1a4b8 (patch)
tree3268b17e5bbd172e533761d6e0b6d8076c9054d3 /src/hydrilla/builder/piggybacking.py
parent00487547c4aff6bf0c94438768191960a3369365 (diff)
downloadhaketilo-hydrilla-1a1f750ccdc1d52a7b1bd648b2188fa6e7c1a4b8.tar.gz
haketilo-hydrilla-1a1f750ccdc1d52a7b1bd648b2188fa6e7c1a4b8.zip
[builder] make builder functional again
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