refactor: move leaf modules into packages

core: hashing, artifacts, ziptools, deterministic_zip, romdir, sect233r1,
crypto_verify, paths (REPO_ROOT). model: safeparse (needs yaml),
dumpcatalog, largefiles, alternatives. resolve: nativemode, validation,
launchers, slot, truth, gamedata, and exporter/baseline.py and
exporter/candidates.py as resolve/reconcile.py and resolve/categories.py,
which truth and gamedata read.

Every importer follows. Modules one level deeper read the repository
root from core.paths instead of __file__.
This commit is contained in:
Abdessamad Derraz committed 2026-11-18 10:50:45 +01:00
1 parent 23d8a770f1
commit c784aef883
167 files changed
+412 -434

No files matched your search

+1 -1
View File
@@ -50,7 +50,7 @@ from dataclasses import dataclass, field
from pathlib import Path
from typing import IO
from ..artifacts import write_if_changed
from core.artifacts import write_if_changed
from ..common import load_emulator_profiles, run_cli
from .romset_dat_importer import (
LISTXML_CHUNK,
+2 -2
View File
@@ -19,8 +19,8 @@ from pathlib import Path
from common import load_target_config, yaml_load
from hashing import cut_md5_owner
from safeparse import yaml_load_upstream
from core.hashing import cut_md5_owner
from model.safeparse import yaml_load_upstream
from .base_scraper import (
BaseScraper,
+1 -1
View File
@@ -31,7 +31,7 @@ import shlex
import urllib.error
import urllib.request
from safeparse import yaml_load_upstream
from model.safeparse import yaml_load_upstream
from .base_scraper import BaseScraper, BiosRequirement, fetch_github_latest_version
from .batocera_scraper import (
+1 -1
View File
@@ -14,7 +14,7 @@ from __future__ import annotations
import json
from collections.abc import Iterable, Mapping
from safeparse import parse_untrusted_xml
from model.safeparse import parse_untrusted_xml
# system -> [(emulator, [core, ...]), ...], both in the list's order.
SystemEmulators = dict[str, list[tuple[str, list[str]]]]
+1 -1
View File
@@ -39,7 +39,7 @@ from pathlib import Path
if (_SCRIPTS_DIR := str(Path(__file__).resolve().parents[1])) not in sys.path:
sys.path.insert(0, _SCRIPTS_DIR)
from artifacts import copy_stream_atomic, write_if_changed, write_text_atomic
from core.artifacts import copy_stream_atomic, write_if_changed, write_text_atomic
from common import parse_untrusted_xml
from region import REGIONS, WORLD
from region_audit import NOINTRO
+1 -1
View File
@@ -24,7 +24,7 @@ if (_SCRIPTS_DIR := str(Path(__file__).resolve().parents[2])) not in sys.path:
sys.path.insert(0, _SCRIPTS_DIR)
import upstream
from safeparse import yaml_load
from model.safeparse import yaml_load
CACHE_DIR = upstream.CACHE_DIR
+1 -1
View File
@@ -15,7 +15,7 @@ import yaml
from . import Fetcher, SourceError, load_sources, scrape_setup
from upstream import UpstreamError
from artifacts import write_text_atomic
from core.artifacts import write_text_atomic
from ..base_scraper import _PlatformDumper
DEFAULT_DIR = Path("platforms") / "romfolders"
+1 -1
View File
@@ -31,7 +31,7 @@ import shlex
from collections import Counter
from collections.abc import Iterator
from safeparse import parse_untrusted_xml, yaml_load_upstream
from model.safeparse import parse_untrusted_xml, yaml_load_upstream
from . import Fetcher, SourceError, register
+1 -1
View File
@@ -51,7 +51,7 @@ from ..common import (
load_platform_config,
run_cli,
)
from ..dumpcatalog import build_snapshot, load_provenance_snapshots, write_snapshot
from model.dumpcatalog import build_snapshot, load_provenance_snapshots, write_snapshot
from .logiqx_parser import LogiqxDat, parse_logiqx
MAX_MEMBER_SIZE = 200 * 1024 * 1024
@@ -27,7 +27,7 @@ from datetime import datetime, timezone
import yaml
from safeparse import yaml_load_upstream
from model.safeparse import yaml_load_upstream
from . import BaseTargetScraper
from ..base_scraper import github_headers