Self-updates and program list from the repo

This commit is contained in:
sarah committed 2026-10-09 10:38:21 +02:00
1 parent d9da8438c2
commit e4272bd606
9 files changed
+416 -15

No files matched your search

+14
View File
@@ -40,6 +40,20 @@ def _Get(Url: str) -> bytes:
raise SourceError(f"Couldn't reach {Url}: {Error}") from Error
def GetBytes(Url: str) -> bytes:
return _Get(Url)
def GetJson(Url: str):
"""A JSON API response (e.g. Gitea's latest release), or SourceError."""
import json
try:
return json.loads(_Get(Url))
except ValueError as Error:
raise SourceError(f"{Url} didn't return JSON: {Error}") from Error
def _RepoUrl(GitUrl: str) -> str:
return GitUrl.rstrip("/").removesuffix(".git")