mirror of
https://github.com/Abdess/retroarch_system.git
synced 2026-12-02 06:18:51 -06:00
refactor: make names shared across modules public
This commit is contained in:
1 parent
c3b67d5485
commit
61e302d8f6
45 files changed
+653
-653
No files matched your search
@@ -32,7 +32,7 @@ from profiling.repos import (
|
||||
)
|
||||
|
||||
|
||||
def _resolve_project_words(
|
||||
def resolve_project_words(
|
||||
refs: list, tree_order: Callable[[], Iterable[list[str] | None]],
|
||||
link_order: Callable[[], Iterable[Iterable[str]]] = lambda: (),
|
||||
) -> list:
|
||||
@@ -60,7 +60,7 @@ def _resolve_project_words(
|
||||
return out
|
||||
|
||||
|
||||
def _path_roles(refs: list) -> dict[str, set[str]]:
|
||||
def cited_path_roles(refs: list) -> dict[str, set[str]]:
|
||||
"""The roles each cited path is written under across the profile."""
|
||||
roles: dict[str, set[str]] = {}
|
||||
for *_, parts, _citation in refs:
|
||||
@@ -70,7 +70,7 @@ def _path_roles(refs: list) -> dict[str, set[str]]:
|
||||
return roles
|
||||
|
||||
|
||||
def _check_build_refs(
|
||||
def check_build_refs(
|
||||
profile: dict,
|
||||
deferred: list[tuple[Citation, dict]],
|
||||
views: list[RepoView],
|
||||
@@ -120,7 +120,7 @@ def _check_build_refs(
|
||||
return results
|
||||
|
||||
|
||||
def _gather_refs(
|
||||
def gather_refs(
|
||||
profile: dict, text: str | None
|
||||
) -> tuple[list, list[tuple[Citation, dict]]]:
|
||||
"""The citations to anchor, and the refs read at a shipped build instead.
|
||||
@@ -175,7 +175,7 @@ def _gather_refs(
|
||||
return refs, deferred
|
||||
|
||||
|
||||
def _cited_dirs(refs: list) -> set[str]:
|
||||
def cited_directories(refs: list) -> set[str]:
|
||||
"""Directories the profile already cites, deepest first, to settle a bare
|
||||
filename that several trees of one repository carry."""
|
||||
cited_dirs: set[str] = set()
|
||||
@@ -202,7 +202,7 @@ def _unanswered_skip(profile: dict) -> str:
|
||||
)
|
||||
|
||||
|
||||
def _readable_views(
|
||||
def readable_views(
|
||||
profile: dict, report: ProfileReport, cache_dir: str, offline: bool
|
||||
) -> list[RepoView] | None:
|
||||
"""The repositories to read, None once the report says why it is skipped."""
|
||||
@@ -251,7 +251,7 @@ def _readable_views(
|
||||
return views
|
||||
|
||||
|
||||
def _record_revisions(
|
||||
def record_revisions(
|
||||
profile: dict, report: ProfileReport, views: list[RepoView],
|
||||
cache_dir: str, offline: bool,
|
||||
) -> dict[tuple[str, str], str]:
|
||||
|
||||
@@ -42,13 +42,13 @@ from profiling.repos import (
|
||||
reads_own_revision,
|
||||
)
|
||||
from profiling.reportinputs import (
|
||||
_check_build_refs,
|
||||
_cited_dirs,
|
||||
_gather_refs,
|
||||
_path_roles,
|
||||
_readable_views,
|
||||
_record_revisions,
|
||||
_resolve_project_words,
|
||||
check_build_refs,
|
||||
cited_directories,
|
||||
gather_refs,
|
||||
cited_path_roles,
|
||||
readable_views,
|
||||
record_revisions,
|
||||
resolve_project_words,
|
||||
)
|
||||
|
||||
|
||||
@@ -635,14 +635,14 @@ def build_report(
|
||||
) -> ProfileReport:
|
||||
"""Confront one profile with its upstream."""
|
||||
report = ProfileReport(name=name, entries=[], counts={})
|
||||
refs, deferred = _gather_refs(profile, text)
|
||||
path_roles = _path_roles(refs)
|
||||
cited_dirs = _cited_dirs(refs)
|
||||
refs, deferred = gather_refs(profile, text)
|
||||
path_roles = cited_path_roles(refs)
|
||||
cited_dirs = cited_directories(refs)
|
||||
|
||||
views = _readable_views(profile, report, cache_dir, offline)
|
||||
views = readable_views(profile, report, cache_dir, offline)
|
||||
if views is None:
|
||||
return report
|
||||
tagged = _record_revisions(profile, report, views, cache_dir, offline)
|
||||
tagged = record_revisions(profile, report, views, cache_dir, offline)
|
||||
|
||||
# A profile carrying no source_ref still has a pin worth writing and a
|
||||
# version worth checking, so the revisions above are resolved first.
|
||||
@@ -653,10 +653,10 @@ def build_report(
|
||||
resolver = _Resolver(
|
||||
name, profile, cache_dir, offline, views, report, tagged, path_roles, cited_dirs
|
||||
)
|
||||
refs = _resolve_project_words(
|
||||
refs = resolve_project_words(
|
||||
refs, resolver.trees_in_order, resolver.gitlinks_in_order
|
||||
)
|
||||
report.build_refs = _check_build_refs(profile, deferred, views, resolver.fetch_from)
|
||||
report.build_refs = check_build_refs(profile, deferred, views, resolver.fetch_from)
|
||||
_judge_refs(resolver, refs, report)
|
||||
return report
|
||||
|
||||
|
||||
Reference in new issue
Block a user