okami.mom/strata

git clone https://git.nkp.pet/okami.mom/strata

Niko1221Version 0.2.15 / Control 0.1.61: app and Terminal 0.2.15, Control 0.1.61; every engine package stays 0.1.60 (the v0.2.14 files, carried by absolute url)e39a52e33

main
1.1 KiB29 linesraw
1"""Terminal clients for the shared Strata server."""
2
3import re
4from pathlib import Path
5
6SCHEMA_VERSION = 1
7
8#: The version people are told: the Strata app's own (apps/desktop/src-tauri/Cargo.toml `version`; tests/terminal/test_tuiqa_version.py keeps the
9#: two equal, except for a Terminal-only release such as 0.2.3.1 or 0.2.4, whose app stays 0.2.3). `version()` below is the files' build number, which the engine-compatibility checks compare, so it stays numeric.
10PRODUCT_VERSION = "0.2.15"
11
12
13def version() -> str:
14    """The terminal's version: the VERSION file of an archive, else the source tree's CMake project version."""
15    root = Path(__file__).resolve().parents[1]
16    try:
17        text = (root / "VERSION").read_text(encoding="utf-8").strip()
18        if text:
19            return text
20    except OSError:
21        pass
22    try:
23        m = re.search(r"^\s*project\([^)]*?VERSION\s+([0-9]+(?:\.[0-9]+)+)",
24                      (root / "CMakeLists.txt").read_text(encoding="utf-8", errors="replace"), re.MULTILINE)
25        if m:
26            return m.group(1)
27    except OSError:
28        pass
29    return "unknown"