Refactoring, create a src folders with the python toolchain

This commit is contained in:
stilobique committed 2026-11-08 14:22:51 +01:00
1 parent 2790d92a60
commit 33e4fe0c4e
19 files changed
+246 -122

No files matched your search

+33
View File
@@ -0,0 +1,33 @@
"""Emplacements partagés par les commandes : racine du projet QML, libfbxqml et qmlscene."""
import os
import shutil
import sys
from pathlib import Path
def _find_root() -> Path:
"""Dossier contenant manifest.json : depuis le dossier courant, sinon depuis ce module."""
for start in (Path.cwd(), Path(__file__).resolve().parent):
for folder in (start, *start.parents):
if (folder / "manifest.json").is_file() and (folder / "Jellyfin.qml").is_file():
return folder
sys.exit("Projet introuvable : lancez la commande depuis le dépôt Jellyfin-Freebox.")
PROJECT_DIR = _find_root()
def libfbxqml() -> Path:
"""libfbxqml (module fbx.application en QML pur) : ../libfbxqml, ou $LIBFBXQML."""
path = Path(os.environ.get("LIBFBXQML", PROJECT_DIR.parent / "libfbxqml"))
if not (path / "fbx").is_dir():
sys.exit("libfbxqml introuvable : git clone https://github.com/fbx/libfbxqml.git %s" % path)
return path
def qmlscene() -> str:
"""qmlscene de Qt 5 : $QMLSCENE, le PATH, ou l'emplacement Debian/Ubuntu."""
path = os.environ.get("QMLSCENE") or shutil.which("qmlscene") or "/usr/lib/qt5/bin/qmlscene"
if not os.path.exists(path) and not shutil.which(path):
sys.exit("qmlscene introuvable : sudo apt install qmlscene")
return path