mirror of
https://github.com/Abdess/retroarch_system.git
synced 2026-12-03 06:48:52 -06:00
refactor: one naming style per package
This commit is contained in:
1 parent
60c904b8f2
commit
88ea3d58ad
35 files changed
+168
-168
No files matched your search
File renamed without changes.
@@ -12,7 +12,7 @@ from pathlib import Path
|
||||
from core import upstream
|
||||
from core.paths import REPO_ROOT
|
||||
from scripts.scraper import game_dat_importer
|
||||
from scripts.scraper.datfetch import is_tracked_dat, label_version
|
||||
from scripts.scraper.dat_fetch import is_tracked_dat, label_version
|
||||
from scripts.scraper.redump_dat_scraper import fetch_snapshot
|
||||
from freshness.findings import (
|
||||
FBNEO_RECIPES, MAME_RECIPES, NO_INTRO_GAMES, OK, REDUMP_GAMES, SKIPPED, STALE, UNKNOWN,
|
||||
|
||||
@@ -14,7 +14,7 @@ def check_source_paths(profiles: dict) -> Finding:
|
||||
"""The site links a cited path only where source-paths.json records it
|
||||
in the tree the profile pins. A recorded tree no profile pins any more,
|
||||
or a pinned tree the record lacks, means a pin moved or a profile was
|
||||
added and `sitesources.py --fetch` was not run after it. Every tree a run
|
||||
added and `site_sources.py --fetch` was not run after it. Every tree a run
|
||||
tries is recorded, read or not, so a lacking one was never tried."""
|
||||
from sitegen import sources as sitegen_sources
|
||||
|
||||
@@ -34,7 +34,7 @@ def check_source_paths(profiles: dict) -> Finding:
|
||||
"source-paths.json",
|
||||
STALE if problems else OK,
|
||||
local=f"{len(recorded)} trees",
|
||||
detail=(", ".join(problems) + ": run python scripts/sitesources.py --fetch") if problems
|
||||
detail=(", ".join(problems) + ": run python scripts/site_sources.py --fetch") if problems
|
||||
else "every pinned tree is recorded, and only those",
|
||||
)
|
||||
|
||||
|
||||
@@ -220,7 +220,7 @@ def load_emulator_profiles(
|
||||
emu_path = Path(emulators_dir)
|
||||
if not emu_path.is_dir():
|
||||
# Read as "no emulator", a mistyped --emulators-dir built a pack
|
||||
# without any core file marked OK, and sitesources wrote {} over
|
||||
# without any core file marked OK, and site_sources wrote {} over
|
||||
# source-paths.json, both exiting 0.
|
||||
raise InputMissing(f"no emulator profile directory at {emulators_dir}")
|
||||
for f in source_yaml_paths(emu_path):
|
||||
|
||||
@@ -15,7 +15,7 @@ from core import upstream
|
||||
from model.platforms import load_platform_config
|
||||
from model.profiles import load_emulator_profiles
|
||||
from model.registry import list_registered_platforms
|
||||
from profiling import version_basis
|
||||
from profiling import versionbasis
|
||||
from profiling.anchoring import REVIEW_STATUSES
|
||||
from profiling.rebase import pending_recale, pin_blockers
|
||||
from profiling.reports import ProfileReport, SkipKind
|
||||
@@ -37,7 +37,7 @@ def apply_readings(document: dict, readings: list) -> tuple[object, dict | None]
|
||||
if isinstance(version, dict):
|
||||
version = dict(version)
|
||||
for reading in readings:
|
||||
if reading.status not in (version_basis.MATCH, version_basis.DRIFT):
|
||||
if reading.status not in (versionbasis.MATCH, versionbasis.DRIFT):
|
||||
continue
|
||||
if reading.mode:
|
||||
if not isinstance(version, dict):
|
||||
@@ -190,7 +190,7 @@ def bump_commit(
|
||||
new_text = _set_pin(
|
||||
new_text, document, "upstream_commit", report.upstream_head, "source_commit"
|
||||
)
|
||||
readings = version_basis.check(expected, cache_dir, offline, recompute=True)
|
||||
readings = versionbasis.check(expected, cache_dir, offline, recompute=True)
|
||||
refused = version_refusal(readings)
|
||||
if refused:
|
||||
return Bump(False, f"{refused}, its pin is not advanced")
|
||||
@@ -207,11 +207,11 @@ def bump_commit(
|
||||
def version_refusal(readings: list) -> str | None:
|
||||
"""Why the version at a new pin cannot be stated, or None."""
|
||||
for reading in readings:
|
||||
if reading.status == version_basis.NO_BASIS:
|
||||
if reading.status == versionbasis.NO_BASIS:
|
||||
return "no version_basis says where its version is read"
|
||||
if reading.status == version_basis.UNREADABLE:
|
||||
if reading.status == versionbasis.UNREADABLE:
|
||||
return f"core_version cannot be read at the new pin: {reading.where}"
|
||||
if reading.status == version_basis.UNCHECKED:
|
||||
if reading.status == versionbasis.UNCHECKED:
|
||||
return f"core_version is {reading.where}, not read from the code at a pin"
|
||||
return None
|
||||
|
||||
|
||||
@@ -29,7 +29,7 @@ from profiling.sourcepaths import record_write
|
||||
from profiling.triage import (
|
||||
PROGRESS_SECONDS, Progress, print_interrupted, print_triage, score_reports, scored_to_dict,
|
||||
)
|
||||
from profiling.version_basis import VersionTag, version_tags
|
||||
from profiling.versionbasis import VersionTag, version_tags
|
||||
from profiling.versions import (
|
||||
VersionReport,
|
||||
check_version,
|
||||
|
||||
@@ -33,7 +33,7 @@ def refresh_source_paths(args: argparse.Namespace, written: set[str]) -> None:
|
||||
"""Rebuild the site's record of cited source paths after a write.
|
||||
|
||||
Each bump left website/src/data/source-paths.json behind its pins, and
|
||||
the site's freshness test stayed red until someone ran sitesources.py
|
||||
the site's freshness test stayed red until someone ran site_sources.py
|
||||
--fetch by hand. A run that writes nothing, or makes no request, leaves
|
||||
it alone. The record describes the repository's profiles: a pass over
|
||||
another tree prints the command for it instead of reducing the record
|
||||
@@ -44,7 +44,7 @@ def refresh_source_paths(args: argparse.Namespace, written: set[str]) -> None:
|
||||
if Path(args.emulators_dir).resolve() != (REPO_ROOT / EMULATORS_DIR).resolve():
|
||||
print(
|
||||
f"source paths not refreshed: {args.emulators_dir} is not the repository's "
|
||||
f"{EMULATORS_DIR}/: run python scripts/sitesources.py --fetch "
|
||||
f"{EMULATORS_DIR}/: run python scripts/site_sources.py --fetch "
|
||||
f"--emulators-dir {args.emulators_dir} --cache-dir {args.cache_dir} "
|
||||
"--output <record> to record them",
|
||||
file=sys.stderr,
|
||||
@@ -66,7 +66,7 @@ def refresh_source_paths(args: argparse.Namespace, written: set[str]) -> None:
|
||||
except ArtifactLockBusy as exc:
|
||||
# The profiles are written: only the record waits for the other run.
|
||||
print(
|
||||
f"source paths not refreshed ({exc}): run python scripts/sitesources.py "
|
||||
f"source paths not refreshed ({exc}): run python scripts/site_sources.py "
|
||||
"--fetch once it finishes",
|
||||
file=sys.stderr,
|
||||
)
|
||||
|
||||
@@ -10,7 +10,7 @@ from dataclasses import dataclass, field
|
||||
|
||||
from core import upstream
|
||||
from profiling.reports import ProfileReport, report_to_dict, triage_state
|
||||
from profiling.version_basis import version_repo, version_tags
|
||||
from profiling.versionbasis import version_repo, version_tags
|
||||
from profiling.versions import VersionReport, check_version
|
||||
|
||||
|
||||
|
||||
File renamed without changes.
@@ -9,19 +9,19 @@ from collections import Counter
|
||||
from dataclasses import asdict
|
||||
from pathlib import Path
|
||||
|
||||
from profiling import version_basis
|
||||
from profiling import versionbasis
|
||||
from profiling.bump import write_version
|
||||
from profiling.worktree import refuse_dirty_tree
|
||||
from profiling.yamledit import YamlWriteError
|
||||
|
||||
|
||||
def format_reading(name: str, reading: version_basis.Reading) -> str:
|
||||
def format_reading(name: str, reading: versionbasis.Reading) -> str:
|
||||
"""One reading as a line: its status, the version said, and where it was read."""
|
||||
mode = f"[{reading.mode}] " if reading.mode else ""
|
||||
kind = f"{reading.kind} " if reading.kind else ""
|
||||
if reading.status == version_basis.DRIFT:
|
||||
if reading.status == versionbasis.DRIFT:
|
||||
said = f"declared {reading.declared}, code {reading.read}"
|
||||
elif reading.status == version_basis.MATCH:
|
||||
elif reading.status == versionbasis.MATCH:
|
||||
said = str(reading.read)
|
||||
else:
|
||||
said = f"declared {reading.declared}"
|
||||
@@ -36,13 +36,13 @@ def run_versions(args: argparse.Namespace, profiles: dict, selected: dict) -> No
|
||||
rows = []
|
||||
failed = False
|
||||
for name, profile in selected.items():
|
||||
readings = version_basis.check(
|
||||
readings = versionbasis.check(
|
||||
profile, args.cache_dir, args.offline, profiles, recompute=args.set_version
|
||||
)
|
||||
for reading in readings:
|
||||
counts[reading.status] += 1
|
||||
rows.append({"profile": name, **asdict(reading)})
|
||||
if not args.as_json and (not args.changed_only or reading.status != version_basis.MATCH):
|
||||
if not args.as_json and (not args.changed_only or reading.status != versionbasis.MATCH):
|
||||
print(format_reading(name, reading))
|
||||
if args.set_version:
|
||||
path = Path(args.emulators_dir) / f"{name}.yml"
|
||||
@@ -54,7 +54,7 @@ def run_versions(args: argparse.Namespace, profiles: dict, selected: dict) -> No
|
||||
except YamlWriteError as exc:
|
||||
print(f"{name}: write refused: {exc}", file=sys.stderr)
|
||||
failed = True
|
||||
elif any(r.status in version_basis.FAILING for r in readings):
|
||||
elif any(r.status in versionbasis.FAILING for r in readings):
|
||||
failed = True
|
||||
if args.as_json:
|
||||
print(json.dumps(rows, indent=2))
|
||||
|
||||
@@ -6,7 +6,7 @@ import re
|
||||
from dataclasses import dataclass
|
||||
|
||||
from core import upstream
|
||||
from profiling.version_basis import VersionTag, declared
|
||||
from profiling.versionbasis import VersionTag, declared
|
||||
|
||||
|
||||
@dataclass(frozen=True)
|
||||
|
||||
@@ -199,7 +199,7 @@ def _rule_failure(
|
||||
if check not in skip and not content_fits({"validation": [check], check: spec}, local_path):
|
||||
return _CONTENT_REASONS[check]
|
||||
if rule["crypto"] - skip:
|
||||
from core.crypto_verify import check_crypto_validation
|
||||
from core.cryptoverify import check_crypto_validation
|
||||
|
||||
return check_crypto_validation(local_path, filename, bios_dir)
|
||||
return None
|
||||
@@ -527,7 +527,7 @@ def check_file_validation(
|
||||
|
||||
# Signature/crypto checks (3DS RSA, AES)
|
||||
if entry["crypto_only"]:
|
||||
from core.crypto_verify import check_crypto_validation
|
||||
from core.cryptoverify import check_crypto_validation
|
||||
|
||||
crypto_reason = check_crypto_validation(local_path, filename, bios_dir)
|
||||
if crypto_reason:
|
||||
|
||||
@@ -61,7 +61,7 @@ from .fbneo_parser import zip_name
|
||||
from .clex import DriverSourceError, blank_comments, call_args, call_span
|
||||
from .listxml import Opener, attrs, iter_elements, open_listxml, rom_members
|
||||
from model.mamerelease import mame_tag
|
||||
from .datfetch import MAME_LISTXML_URL, api_json, cached_pack, fetch_pack
|
||||
from .dat_fetch import MAME_LISTXML_URL, api_json, cached_pack, fetch_pack
|
||||
|
||||
SCHEMA_VERSION = 1
|
||||
DEFAULT_OUTPUT = Path("games") / "arcade"
|
||||
|
||||
File renamed without changes.
@@ -58,7 +58,7 @@ from .mame_devices import (
|
||||
)
|
||||
from .listxml import open_listxml
|
||||
from model.mamerelease import mame_tag, mame_version
|
||||
from .datfetch import fetch_pack
|
||||
from .dat_fetch import fetch_pack
|
||||
from .sparse_clone import fresh_cache, remove_clone, sparse_clone
|
||||
from .mame_parser import parse_mame_source_tree
|
||||
from core.paths import EMULATORS_DIR, PLATFORMS_DIR, REPO_ROOT
|
||||
|
||||
@@ -50,7 +50,7 @@ from model.database import load_database
|
||||
from model.dumpcatalog import build_snapshot, load_provenance_snapshots, write_snapshot
|
||||
from resolve.localfile import variant_base_name
|
||||
from .base_scraper import BlobMismatchError, fetch_github_latest_version
|
||||
from .datfetch import fetch_pack, mame_label
|
||||
from .dat_fetch import fetch_pack, mame_label
|
||||
from .listxml import (
|
||||
Opener,
|
||||
iter_dat_documents,
|
||||
|
||||
File renamed without changes.
File renamed without changes.
Reference in new issue
Block a user