Add changelog viewer to runtime info
This commit is contained in:
@@ -25,6 +25,7 @@ PROJECT_ROOT = Path(__file__).resolve().parent
|
||||
ANI_CLI = os.environ.get("ANI_CLI_BIN") or shutil.which("ani-cli") or "ani-cli"
|
||||
APP_NAME = "ani-cli-web"
|
||||
VERSION_FILE = PROJECT_ROOT / "VERSION"
|
||||
CHANGELOG_FILE = PROJECT_ROOT / "CHANGELOG.md"
|
||||
ALLANIME_BASE = "allanime.day"
|
||||
ALLANIME_API = f"https://api.{ALLANIME_BASE}"
|
||||
ALLANIME_REFERER = "https://allmanga.to"
|
||||
@@ -87,6 +88,13 @@ def load_app_version(default="0.0.0"):
|
||||
return version or default
|
||||
|
||||
|
||||
def load_project_text_file(path, default=""):
|
||||
try:
|
||||
return Path(path).read_text(encoding="utf-8")
|
||||
except OSError:
|
||||
return default
|
||||
|
||||
|
||||
VERSION = load_app_version()
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user