mirror of
https://github.com/Abdess/retroarch_system.git
synced 2026-11-24 18:47:53 -06:00
refactor: read the demo facts in demovariants
This commit is contained in:
1 parent
416299b6e0
commit
9a6003c22f
5 files changed
+19
-18
No files matched your search
@@ -101,6 +101,19 @@ def load_facts() -> dict:
|
||||
return json.loads(FACTS.read_text(encoding="utf-8"))
|
||||
|
||||
|
||||
def demo_facts(variant: str = "default") -> dict:
|
||||
"""What an installer demo shows, as make_demo.py measured it: one entry
|
||||
per variant (default, handheld)."""
|
||||
facts = json.loads(FACTS.read_text(encoding="utf-8"))
|
||||
return facts[variant]
|
||||
|
||||
|
||||
def demo_description(facts: dict | None = None) -> str:
|
||||
"""The demo in words, for a reader who cannot see it: the alt text
|
||||
make_demo.py wrote from what it measured."""
|
||||
return str((facts or demo_facts())["alt"])
|
||||
|
||||
|
||||
def write_facts(facts: dict) -> None:
|
||||
"""demo.json, one entry per variant recorded so far, in VARIANTS order."""
|
||||
ordered = {name: facts[name] for name in VARIANTS if name in facts}
|
||||
|
||||
@@ -12,7 +12,7 @@ from model.profiles import unique_emulator_profiles
|
||||
from model.registry import load_platform_registry
|
||||
from sitegen import markup
|
||||
from sitegen.install import platform_display
|
||||
from sitegen.readme import demo_description, demo_facts
|
||||
from sitegen.demovariants import demo_description, demo_facts
|
||||
|
||||
|
||||
# Home page
|
||||
|
||||
@@ -27,6 +27,7 @@ from model.systems import system_index
|
||||
from resolve.review import LARGE_FILE_ISSUE_URL
|
||||
from sitegen.config import REPO_SLUG, REPO_URL, SITE_URL, UPLOAD_ROOT
|
||||
from sitegen.coverage import platform_coverages
|
||||
from sitegen.demovariants import demo_description
|
||||
from sitegen.extraction import extract_targets
|
||||
from sitegen.releasepacks import download_links, release_totals
|
||||
|
||||
@@ -91,7 +92,6 @@ def collection_line(total_files: int, comp: dict) -> str:
|
||||
|
||||
|
||||
# The installer demo (scripts/make_demo.py): the recording and what it shows.
|
||||
DEMO_DIR = REPO_ROOT / "docs_assets" / "demo"
|
||||
DEMO_GIF = "docs_assets/demo/install.gif"
|
||||
REPO_PATH = "../.."
|
||||
REPO = REPO_SLUG
|
||||
@@ -123,19 +123,6 @@ def clone_line(db: dict) -> str:
|
||||
)
|
||||
|
||||
|
||||
def demo_facts(variant: str = "default") -> dict:
|
||||
"""What an installer demo shows, as make_demo.py measured it: one entry
|
||||
per variant (default, handheld)."""
|
||||
facts = json.loads((DEMO_DIR / "demo.json").read_text(encoding="utf-8"))
|
||||
return facts[variant]
|
||||
|
||||
|
||||
def demo_description(facts: dict | None = None) -> str:
|
||||
"""The demo in words, for a reader who cannot see it: the alt text
|
||||
make_demo.py wrote from what it measured."""
|
||||
return str((facts or demo_facts())["alt"])
|
||||
|
||||
|
||||
def _existing_contributor_block(readme_path: str = "README.md") -> list[str]:
|
||||
"""The contributors already published, read back from the file.
|
||||
|
||||
|
||||
Reference in new issue
Block a user