refactor: reuse the shared helpers left copied

Copies of helpers the first pass created, replaced by the helper:
- source_yaml_file for our YAML sources (generate_db read them in the
  locale's encoding, a syntax error named no file);
- data_dir_registry_at in registry_bundles, platform_registry_at (new,
  beside load_platform_registry) in the manifest;
- DATA_DIRS_FILE for the registry path five modules spelled;
- load_optional_database, sha1_at, VERSIONS_FILE, installer_module;
- DerivedView where a cache was keyed by id() of a dict;
- count_text and series where a plural or a list was written by hand.
This commit is contained in:
Abdessamad Derraz committed 2026-11-21 10:31:29 +01:00
1 parent 32a4ca1fa1
commit 036a6ebf29
35 files changed
+141 -170

No files matched your search

+3 -2
View File
@@ -19,7 +19,8 @@ from core.cli import suggest_names
from model.cliargs import platform_arg, require_platform
from model.registry import data_dir_registry_at
from packs.datadirs import DEFAULT_REGISTRY, log, refresh_all, refresh_entry
from core.paths import DATA_DIRS_FILE
from packs.datadirs import log, refresh_all, refresh_entry
def summarize(outcomes: dict[str, bool | None], dry_run: bool) -> str:
@@ -48,7 +49,7 @@ def main() -> None:
"--platform", "-p", type=platform_arg, help="Only refresh entries for this platform"
)
parser.add_argument(
"--registry", default=DEFAULT_REGISTRY, help="Path to _data_dirs.yml"
"--registry", default=DATA_DIRS_FILE, help="Path to _data_dirs.yml"
)
args = parser.parse_args()