1
0
Fork 1
mirror of https://gitlab.postmarketos.org/postmarketOS/pmbootstrap.git synced 2025-07-13 11:29:46 +03:00

pmb: Add lots of type hints (MR 2464)

This commit is contained in:
Newbyte 2024-10-29 23:06:59 +01:00
parent d05d57b37e
commit 225d8b30a0
No known key found for this signature in database
GPG key ID: 5AE7F5513E0885CB
71 changed files with 566 additions and 325 deletions

View file

@ -9,7 +9,7 @@ from pmb.meta import Cache
@Cache(skip_extras=False)
def pkgrepo_paths(skip_extras=False) -> list[Path]:
def pkgrepo_paths(skip_extras: bool = False) -> list[Path]:
config = get_context().config
paths = list(map(lambda x: Path(x), config.aports))
if not paths:
@ -32,7 +32,7 @@ def pkgrepo_default_path() -> Path:
return pkgrepo_paths(skip_extras=True)[0]
def pkgrepo_names(skip_exras=False) -> list[str]:
def pkgrepo_names(skip_exras: bool = False) -> list[str]:
"""
Return a list of all the package repository names.
"""
@ -78,7 +78,7 @@ def pkgrepo_glob_one(path: str) -> Path | None:
return None
def pkgrepo_iglob(path: str, recursive=False) -> Generator[Path, None, None]:
def pkgrepo_iglob(path: str, recursive: bool = False) -> Generator[Path, None, None]:
"""
Yield each matching glob over each aports repository.
"""
@ -91,7 +91,7 @@ def pkgrepo_iglob(path: str, recursive=False) -> Generator[Path, None, None]:
yield pdir
def pkgrepo_iter_package_dirs(skip_extra_repos=False) -> Generator[Path, None, None]:
def pkgrepo_iter_package_dirs(skip_extra_repos: bool = False) -> Generator[Path, None, None]:
"""
Yield each matching glob over each aports repository.
Detect duplicates within the same aports repository but otherwise