mirror of
https://github.com/Abdess/retroarch_system.git
synced 2026-11-30 13:28:51 -06:00
refactor: read data dirs and inherits in one place
This commit is contained in:
1 parent
7be8a7cd7b
commit
67cb99606d
12 files changed
+73
-61
No files matched your search
@@ -16,9 +16,7 @@ from collections.abc import Callable, Iterator
|
||||
from pathlib import Path
|
||||
|
||||
from core.artifacts import file_lock as _file_lock, set_plain_mode
|
||||
from core.cli import InputMissing
|
||||
from core.github import github_token
|
||||
from model.sources import source_yaml_file
|
||||
from model.registry import VERSIONS_FILE, load_versions
|
||||
|
||||
|
||||
@@ -35,14 +33,6 @@ DOWNLOAD_RETRY_WAITS = (5, 20)
|
||||
_TRANSIENT = (urllib.error.URLError, OSError, tarfile.TarError, zipfile.BadZipFile, EOFError)
|
||||
|
||||
|
||||
def load_registry(registry_path: str = DEFAULT_REGISTRY) -> dict[str, dict]:
|
||||
path = Path(registry_path)
|
||||
if not path.exists():
|
||||
raise InputMissing(f"Registry not found: {registry_path}")
|
||||
data = source_yaml_file(path) or {}
|
||||
return data.get("data_directories", {})
|
||||
|
||||
|
||||
def cache_lock(
|
||||
cache_dir: str | Path, shared: bool = False
|
||||
) -> contextlib.AbstractContextManager[None]:
|
||||
|
||||
Reference in new issue
Block a user