Refactoring: move all apps inside a sub folder
This commit is contained in:
1 parent
33e4fe0c4e
commit
b1ca2a7cff
41 files changed
+54
-45
No files matched your search
@@ -1,4 +1,8 @@
|
||||
"""Emplacements partagés par les commandes : racine du projet QML, libfbxqml et qmlscene."""
|
||||
"""Emplacements partagés par les commandes : dépôt, application QML, libfbxqml et qmlscene.
|
||||
|
||||
REPO_DIR : racine du dépôt (outils, dist/, deploy.log) ;
|
||||
APP_DIR : REPO_DIR/app, seul dossier envoyé au Freebox Player (manifest.json, QML, images).
|
||||
"""
|
||||
import os
|
||||
import shutil
|
||||
import sys
|
||||
@@ -6,20 +10,21 @@ from pathlib import Path
|
||||
|
||||
|
||||
def _find_root() -> Path:
|
||||
"""Dossier contenant manifest.json : depuis le dossier courant, sinon depuis ce module."""
|
||||
"""Dossier contenant app/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():
|
||||
if (folder / "app" / "manifest.json").is_file() and (folder / "pyproject.toml").is_file():
|
||||
return folder
|
||||
sys.exit("Projet introuvable : lancez la commande depuis le dépôt Jellyfin-Freebox.")
|
||||
|
||||
|
||||
PROJECT_DIR = _find_root()
|
||||
REPO_DIR = _find_root()
|
||||
APP_DIR = REPO_DIR / "app"
|
||||
|
||||
|
||||
def libfbxqml() -> Path:
|
||||
"""libfbxqml (module fbx.application en QML pur) : ../libfbxqml, ou $LIBFBXQML."""
|
||||
path = Path(os.environ.get("LIBFBXQML", PROJECT_DIR.parent / "libfbxqml"))
|
||||
path = Path(os.environ.get("LIBFBXQML", REPO_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
|
||||
|
||||
Reference in new issue
Block a user