mirror of
https://github.com/ankitects/anki.git
synced 2025-09-19 14:32:22 -04:00

* PEP8 scheduler/base.py * PEP8 _backend/__init__.py * PEP8 _backend/genbackend.py * PEP8 _backend/genfluent.py * PEP8 scheduler/__init__.py * PEP8 __init__.py * PEP8 _legacy.py * PEP8 syncserver/__init__.py - Make 'ip' a good name - Overrule `global col` being identified as a constant * PEP8 syncserver/__main__.py * PEP8 buildinfo.py * Implement `DeprecatedNamesMixin` for modules * PEP8 browser.py * PEP8 config.py * PEP8 consts.py * PEP8 db.py * Format * Improve AttributeError for DeprecatedNamesMixin * print the line that imported/referenced the legacy module attr (dae) * DeprecatedNamesMixinStandalone -> ...ForModule
23 lines
611 B
Python
23 lines
611 B
Python
# Copyright: Ankitects Pty Ltd and contributors
|
|
# License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
|
|
|
# pylint: enable=invalid-name
|
|
|
|
from importlib.resources import open_text
|
|
|
|
|
|
def _get_build_info() -> dict[str, str]:
|
|
info = {}
|
|
with open_text("anki", "buildinfo.txt") as file:
|
|
for line in file.readlines():
|
|
elems = line.split()
|
|
if len(elems) == 2:
|
|
key, val = elems
|
|
info[key] = val
|
|
|
|
return info
|
|
|
|
|
|
_buildinfo = _get_build_info()
|
|
buildhash = _buildinfo["STABLE_BUILDHASH"]
|
|
version = _buildinfo["STABLE_VERSION"]
|