refactor: read declared hashes with one helper

core.hashing.declared_hash_lists gives an entry's declared values per
field in the order written, and declared_hashes builds its sets on it.
The gap page, the doubled-destination report and the file lookup used
their own copies of that reader. The wanted page keeps its filters on
top of it. sitegen.lookup.hash_pairs replaces sorted_hash_values for
the lookup, the data exports and the structured data. The one-field
aliases parse_md5_list and reconcile.hash_values are gone, and
model.profiles reads HASH_FIELDS instead of a fourth tuple.
This commit is contained in:
Abdessamad Derraz committed 2026-11-21 10:29:37 +01:00
1 parent ea68e85c06
commit 02969dda06
30 files changed
+176 -195

No files matched your search

+2 -4
View File
@@ -7,6 +7,7 @@ import sys
from pathlib import Path
from core.cli import InputMissing, suggest_names
from core.hashing import HASH_FIELDS
from model.alternatives import derive_member_requirements
from model.profilekinds import is_emulator as is_emulator
from model.profilekinds import lists_files as lists_files
@@ -235,9 +236,6 @@ def load_emulator_profiles(
return profiles
_HASH_FIELDS = ("crc32", "md5", "sha1", "sha256")
def _normalize_hash_fields(node: object) -> None:
"""Coerce hash values to str in place.
@@ -246,7 +244,7 @@ def _normalize_hash_fields(node: object) -> None:
"""
if isinstance(node, dict):
for key, val in node.items():
if key in _HASH_FIELDS:
if key in HASH_FIELDS:
if isinstance(val, int):
node[key] = str(val)
elif isinstance(val, list):