refactor: renombra el paquet a jail_launcher i l'app a «Jail Launcher»

This commit is contained in:
2026-06-01 17:46:09 +02:00
parent 878c403654
commit fccbdc83d5
23 changed files with 78 additions and 77 deletions
+2 -2
View File
@@ -1,6 +1,6 @@
# ---> jlauncher # ---> jail-launcher
# Datos descargados en tiempo de ejecución (clones git + cache de metadata) # Datos descargados en tiempo de ejecución (clones git + cache de metadata)
jlauncher_data/ jail_launcher_data/
# Preferencias locales del usuario # Preferencias locales del usuario
settings.json settings.json
*.dist/ *.dist/
+14 -14
View File
@@ -1,4 +1,4 @@
# jlauncher # jail-launcher
Lanzador de juegos de **jailgames**. A partir de `games.toml`, lista los juegos, los Lanzador de juegos de **jailgames**. A partir de `games.toml`, lista los juegos, los
clona/actualiza desde sus repos Gitea, lee su icono y descripción, y los compila/ejecuta. clona/actualiza desde sus repos Gitea, lee su icono y descripción, y los compila/ejecuta.
@@ -15,14 +15,14 @@ GUI en **Python + PySide6**, pensada para compilarse a binario nativo con **Nuit
```bash ```bash
pip install PySide6 pip install PySide6
python -m jlauncher python -m jail_launcher
``` ```
La app crea una carpeta `jlauncher_data/` junto al proyecto (o junto al binario, si está La app crea una carpeta `jail_launcher_data/` junto al proyecto (o junto al binario, si está
compilado) con esta estructura **anidada (Versión 1)**: compilado) con esta estructura **anidada (Versión 1)**:
``` ```
jlauncher_data/ jail_launcher_data/
<id_juego>/ <id_juego>/
repo/ # git clone del juego repo/ # git clone del juego
metadata/ metadata/
@@ -40,7 +40,7 @@ jlauncher_data/
- icono desde `release/icons/icon.png`. - icono desde `release/icons/icon.png`.
- **Juga**: si hay `build_cmd`, compila primero; luego ejecuta `run_cmd`. Para estos - **Juga**: si hay `build_cmd`, compila primero; luego ejecuta `run_cmd`. Para estos
juegos basta `run_cmd = "make run"` (compila y ejecuta), con `build_cmd` vacío. juegos basta `run_cmd = "make run"` (compila y ejecuta), con `build_cmd` vacío.
- **Esborra**: elimina la descarga local (carpeta del juego en `jlauncher_data/`), - **Esborra**: elimina la descarga local (carpeta del juego en `jail_launcher_data/`),
sin quitar el juego del `games.toml`. sin quitar el juego del `games.toml`.
Menú **Opcions**: *Amaga els jocs no descarregats* (filtro persistente) y Menú **Opcions**: *Amaga els jocs no descarregats* (filtro persistente) y
@@ -55,7 +55,7 @@ Una entrada `[[game]]` por juego. Campos:
| Campo | Obligatorio | Descripción | | Campo | Obligatorio | Descripción |
|---------------|-------------|--------------------------------------------------------------------| |---------------|-------------|--------------------------------------------------------------------|
| `id` | sí | slug → nombre de carpeta en `jlauncher_data/` | | `id` | sí | slug → nombre de carpeta en `jail_launcher_data/` |
| `name` | sí | nombre visible | | `name` | sí | nombre visible |
| `clone_url` | sí | URL de git clone / pull | | `clone_url` | sí | URL de git clone / pull |
| `run_cmd` | sí | comando que ejecuta el juego (cwd = repo) | | `run_cmd` | sí | comando que ejecuta el juego (cwd = repo) |
@@ -68,16 +68,16 @@ Una entrada `[[game]]` por juego. Campos:
`build.sh` lo hace todo: crea el `.venv`, instala dependencias (PySide6 + Nuitka + `build.sh` lo hace todo: crea el `.venv`, instala dependencias (PySide6 + Nuitka +
zstandard) y compila un único ejecutable comprimido, empaquetándolo en zstandard) y compila un único ejecutable comprimido, empaquetándolo en
`dist/jlauncher-v<versión>-<os>-<arch>.tar.gz` junto a `games.toml`. `dist/jail-launcher-v<versión>-<os>-<arch>.tar.gz` junto a `games.toml`.
```bash ```bash
./build.sh ./build.sh
# binario: dist/jlauncher (+ dist/games.toml) # binario: dist/jail-launcher (+ dist/games.toml)
``` ```
El binario crea `jlauncher_data/` y `settings.json` **junto a sí mismo** (resuelto vía El binario crea `jail_launcher_data/` y `settings.json` **junto a sí mismo** (resuelto vía
`NUITKA_ONEFILE_DIRECTORY`). El punto de entrada para empaquetar es `app.py` (desde `NUITKA_ONEFILE_DIRECTORY`). El punto de entrada para empaquetar es `app.py` (desde
fuente se ejecuta con `python -m jlauncher`). fuente se ejecuta con `python -m jail_launcher`).
### Prerequisitos del sistema (no los instala el script) ### Prerequisitos del sistema (no los instala el script)
@@ -95,8 +95,8 @@ binario suelto sino una **app nativa**:
```bash ```bash
./build.sh ./build.sh
# -> dist/jlauncher.app # -> dist/Jail Launcher.app
# -> dist/jlauncher-v<versión>-macos-<arch>.dmg (arrastrar la app a Aplicaciones) # -> dist/jail-launcher-v<versión>-macos-<arch>.dmg (arrastrar la app a Aplicaciones)
``` ```
El icono vive en `icon/`: el build usa `icon/icon.icns` para el bundle y copia El icono vive en `icon/`: el build usa `icon/icon.icns` para el bundle y copia
@@ -105,9 +105,9 @@ sustituye esos ficheros (regenerables con `icon/create_icons.py`).
A diferencia del onefile, la `.app` **no** escribe junto a sí misma (rompería al moverla a A diferencia del onefile, la `.app` **no** escribe junto a sí misma (rompería al moverla a
`/Applications`): guarda sus datos en `/Applications`): guarda sus datos en
`~/Library/Application Support/jailgames/jlauncher/` (`jlauncher_data/`, `settings.json` y `~/Library/Application Support/jailgames/jail-launcher/` (`jail_launcher_data/`, `settings.json` y
una copia editable de `games.toml`, sembrada la primera vez desde el bundle). una copia editable de `games.toml`, sembrada la primera vez desde el bundle).
La app va **sin firma Developer ID** (firma ad-hoc), así que Gatekeeper avisará la primera La app va **sin firma Developer ID** (firma ad-hoc), así que Gatekeeper avisará la primera
vez: ábrela con **clic derecho → Abrir**, o ejecuta vez: ábrela con **clic derecho → Abrir**, o ejecuta
`xattr -dr com.apple.quarantine /Applications/jlauncher.app`. `xattr -dr com.apple.quarantine "/Applications/Jail Launcher.app"`.
+3 -3
View File
@@ -1,11 +1,11 @@
"""Punto de entrada para empaquetar con Nuitka. """Punto de entrada para empaquetar con Nuitka.
Importa el paquete ``jlauncher`` con imports absolutos para que los imports relativos Importa el paquete ``jail_launcher`` con imports absolutos para que los imports relativos
internos (``from .config import …``) resuelvan correctamente al compilar. Para ejecutar internos (``from .config import …``) resuelvan correctamente al compilar. Para ejecutar
desde fuente sigue valiendo ``python -m jlauncher``. desde fuente sigue valiendo ``python -m jail_launcher``.
""" """
from jlauncher.__main__ import main from jail_launcher.__main__ import main
if __name__ == "__main__": if __name__ == "__main__":
raise SystemExit(main()) raise SystemExit(main())
+16 -16
View File
@@ -1,5 +1,5 @@
# Compila jlauncher con Nuitka y empaqueta un release para Windows. # Compila jail-launcher con Nuitka y empaqueta un release para Windows.
# - jlauncher.exe (onefile, GUI sin consola, con icono) + games.toml + .zip. # - jail-launcher.exe (onefile, GUI sin consola, con icono) + games.toml + .zip.
# Equivalente nativo de build.sh (que cubre Linux/macOS). # Equivalente nativo de build.sh (que cubre Linux/macOS).
# Requisitos del sistema (no los instala el script): # Requisitos del sistema (no los instala el script):
# - Python 3.10+ (con el launcher «py» o «python» en el PATH). # - Python 3.10+ (con el launcher «py» o «python» en el PATH).
@@ -16,12 +16,12 @@ Set-StrictMode -Version Latest
$Here = Split-Path -Parent $MyInvocation.MyCommand.Path $Here = Split-Path -Parent $MyInvocation.MyCommand.Path
Set-Location $Here Set-Location $Here
# --- Versión (leída de jlauncher/__init__.py) --------------------------------- # --- Versión (leída de jail_launcher/__init__.py) ---------------------------------
$initPath = Join-Path $Here 'jlauncher\__init__.py' $initPath = Join-Path $Here 'jail_launcher\__init__.py'
$verMatch = Select-String -Path $initPath -Pattern '^__version__\s*=\s*"([^"]*)"' | $verMatch = Select-String -Path $initPath -Pattern '^__version__\s*=\s*"([^"]*)"' |
Select-Object -First 1 Select-Object -First 1
if (-not $verMatch) { if (-not $verMatch) {
Write-Error '[build] no se pudo leer __version__ de jlauncher/__init__.py' Write-Error '[build] no se pudo leer __version__ de jail_launcher/__init__.py'
} }
$Version = $verMatch.Matches[0].Groups[1].Value $Version = $verMatch.Matches[0].Groups[1].Value
@@ -90,29 +90,29 @@ if (-not (Test-Path $IconIco)) {
} }
# --- Compilación onefile ------------------------------------------------------ # --- Compilación onefile ------------------------------------------------------
Write-Host '[build] compilando jlauncher.exe (PySide6 onefile; puede tardar varios minutos)…' Write-Host '[build] compilando jail-launcher.exe (PySide6 onefile; puede tardar varios minutos)…'
& $VenvPython -m nuitka ` & $VenvPython -m nuitka `
--onefile ` --onefile `
--assume-yes-for-downloads ` --assume-yes-for-downloads `
--enable-plugin=pyside6 ` --enable-plugin=pyside6 `
--include-package=jlauncher ` --include-package=jail_launcher `
--windows-icon-from-ico=$IconIco ` --windows-icon-from-ico=$IconIco `
--windows-console-mode=disable ` --windows-console-mode=disable `
--company-name=jailgames ` --company-name=jailgames `
--product-name=jlauncher ` --product-name=jail-launcher `
--product-version=$Version ` --product-version=$Version `
--file-version=$Version ` --file-version=$Version `
--output-dir=dist ` --output-dir=dist `
--output-filename=jlauncher ` --output-filename=jail-launcher `
--remove-output ` --remove-output `
app.py app.py
if ($LASTEXITCODE -ne 0) { if ($LASTEXITCODE -ne 0) {
Write-Error '[build] Nuitka falló.' Write-Error '[build] Nuitka falló.'
} }
$Exe = 'dist\jlauncher.exe' $Exe = 'dist\jail-launcher.exe'
if (-not (Test-Path $Exe)) { if (-not (Test-Path $Exe)) {
Write-Error '[build] Nuitka no produjo dist\jlauncher.exe' Write-Error '[build] Nuitka no produjo dist\jail-launcher.exe'
} }
# games.toml junto al .exe (la app lo lee desde ahí: base_dir junto al binario). # games.toml junto al .exe (la app lo lee desde ahí: base_dir junto al binario).
@@ -125,14 +125,14 @@ New-Item -ItemType Directory -Force -Path dist\icon | Out-Null
Copy-Item $IconPng dist\icon\icon.png -Force Copy-Item $IconPng dist\icon\icon.png -Force
# --- Empaquetado .zip --------------------------------------------------------- # --- Empaquetado .zip ---------------------------------------------------------
$ReleaseName = "jlauncher-v$Version-windows-$Arch" $ReleaseName = "jail-launcher-v$Version-windows-$Arch"
$Zip = "dist\$ReleaseName.zip" $Zip = "dist\$ReleaseName.zip"
Write-Host "[build] empaquetando release $ReleaseName.zip…" Write-Host "[build] empaquetando release $ReleaseName.zip…"
Compress-Archive -Path dist\jlauncher.exe, dist\games.toml, dist\icon ` Compress-Archive -Path dist\jail-launcher.exe, dist\games.toml, dist\icon `
-DestinationPath $Zip -Force -DestinationPath $Zip -Force
Write-Host '[build] hecho:' Write-Host '[build] hecho:'
Get-Item dist\jlauncher.exe, dist\games.toml, $Zip | Get-Item dist\jail-launcher.exe, dist\games.toml, $Zip |
Format-Table -AutoSize Name, @{Name = 'Size'; Expression = { '{0:N0} B' -f $_.Length } } Format-Table -AutoSize Name, @{Name = 'Size'; Expression = { '{0:N0} B' -f $_.Length } }
Write-Host '[build] el binario crea jlauncher_data\ y settings.json junto a sí mismo.' Write-Host '[build] el binario crea jail_launcher_data\ y settings.json junto a sí mismo.'
Write-Host '[build] distribuir: descomprimir el .zip (jlauncher.exe + games.toml + icon\ juntos).' Write-Host '[build] distribuir: descomprimir el .zip (jail-launcher.exe + games.toml + icon\ juntos).'
+23 -22
View File
@@ -1,16 +1,16 @@
#!/usr/bin/env bash #!/usr/bin/env bash
# Compila jlauncher con Nuitka y empaqueta un release. # Compila jail-launcher con Nuitka y empaqueta un release.
# - Linux: binario onefile + tar.gz. # - Linux: binario onefile + tar.gz.
# - macOS: jlauncher.app (con icono) dentro de un .dmg arrastrable a /Applications. # - macOS: «Jail Launcher.app» (con icono) dentro de un .dmg arrastrable a /Applications.
# Requisitos del sistema (no los instala el script): ver README (compilador C, git…). # Requisitos del sistema (no los instala el script): ver README (compilador C, git…).
set -euo pipefail set -euo pipefail
HERE="$(cd "$(dirname "$0")" && pwd)" HERE="$(cd "$(dirname "$0")" && pwd)"
cd "$HERE" cd "$HERE"
VERSION="$(sed -n 's/^__version__[[:space:]]*=[[:space:]]*"\([^"]*\)".*/\1/p' jlauncher/__init__.py | head -n1)" VERSION="$(sed -n 's/^__version__[[:space:]]*=[[:space:]]*"\([^"]*\)".*/\1/p' jail_launcher/__init__.py | head -n1)"
if [ -z "$VERSION" ]; then if [ -z "$VERSION" ]; then
echo "[build] no se pudo leer __version__ de jlauncher/__init__.py" >&2 echo "[build] no se pudo leer __version__ de jail_launcher/__init__.py" >&2
exit 1 exit 1
fi fi
ARCH="$(uname -m)" ARCH="$(uname -m)"
@@ -52,28 +52,29 @@ if [ "$OS" = "darwin" ]; then
exit 1 exit 1
fi fi
echo "[build] compilando jlauncher.app (PySide6; puede tardar varios minutos)…" echo "[build] compilando «Jail Launcher.app» (PySide6; puede tardar varios minutos)…"
.venv/bin/python -m nuitka \ .venv/bin/python -m nuitka \
--standalone \ --standalone \
--macos-create-app-bundle \ --macos-create-app-bundle \
--macos-app-icon="$ICON_ICNS" \ --macos-app-icon="$ICON_ICNS" \
--macos-app-name="Jail Launcher" \ --macos-app-name="Jail Launcher" \
--macos-app-version="$VERSION" \ --macos-app-version="$VERSION" \
--macos-signed-app-name=com.jailgames.jlauncher \ --macos-signed-app-name=com.jailgames.jail-launcher \
--company-name=jailgames \ --company-name=jailgames \
--product-name=jlauncher \ --product-name=jail-launcher \
--product-version="$VERSION" \ --product-version="$VERSION" \
--assume-yes-for-downloads \ --assume-yes-for-downloads \
--enable-plugin=pyside6 \ --enable-plugin=pyside6 \
--include-package=jlauncher \ --include-package=jail_launcher \
--output-dir=dist \ --output-dir=dist \
--output-filename=jlauncher \ --output-filename=jail-launcher \
--remove-output \ --remove-output \
app.py app.py
# Según la versión, Nuitka nombra el bundle a partir del script de entrada # Según la versión, Nuitka nombra el bundle a partir del script de entrada
# (app.py -> app.app). Lo normalizamos a jlauncher.app. # (app.py -> app.app). Lo normalizamos a «Jail Launcher.app» (nombre visible en
APP="dist/jlauncher.app" # Finder/Dock; el ejecutable interno sigue siendo jail-launcher).
APP="dist/Jail Launcher.app"
if [ ! -d "$APP" ]; then if [ ! -d "$APP" ]; then
PRODUCED="$(find dist -maxdepth 1 -name '*.app' | head -n1)" PRODUCED="$(find dist -maxdepth 1 -name '*.app' | head -n1)"
if [ -z "$PRODUCED" ]; then if [ -z "$PRODUCED" ]; then
@@ -91,35 +92,35 @@ if [ "$OS" = "darwin" ]; then
# Bundle ad-hoc (sin Developer ID): quitamos quarantine para abrir sin fricción local. # Bundle ad-hoc (sin Developer ID): quitamos quarantine para abrir sin fricción local.
xattr -dr com.apple.quarantine "$APP" 2>/dev/null || true xattr -dr com.apple.quarantine "$APP" 2>/dev/null || true
DMG="dist/jlauncher-v${VERSION}-macos-${ARCH}.dmg" DMG="dist/jail-launcher-v${VERSION}-macos-${ARCH}.dmg"
echo "[build] empaquetando ${DMG}" echo "[build] empaquetando ${DMG}"
STAGE="$(mktemp -d)" STAGE="$(mktemp -d)"
cp -R "$APP" "$STAGE/" cp -R "$APP" "$STAGE/"
ln -s /Applications "$STAGE/Applications" ln -s /Applications "$STAGE/Applications"
rm -f "$DMG" rm -f "$DMG"
hdiutil create -volname "jlauncher" -srcfolder "$STAGE" \ hdiutil create -volname "Jail Launcher" -srcfolder "$STAGE" \
-ov -format UDZO "$DMG" >/dev/null -ov -format UDZO "$DMG" >/dev/null
rm -rf "$STAGE" rm -rf "$STAGE"
echo "[build] hecho:" echo "[build] hecho:"
du -sh "$APP" | sed 's/^/[build] /' du -sh "$APP" | sed 's/^/[build] /'
ls -lh "$DMG" ls -lh "$DMG"
echo "[build] la app guarda datos en ~/Library/Application Support/jailgames/jlauncher/." echo "[build] la app guarda datos en ~/Library/Application Support/jailgames/jail-launcher/."
echo "[build] distribuir: el .dmg (arrastrar jlauncher.app a Aplicaciones)." echo "[build] distribuir: el .dmg (arrastrar «Jail Launcher.app» a Aplicaciones)."
echo "[build] sin firma Developer ID: primera apertura con clic derecho → Abrir." echo "[build] sin firma Developer ID: primera apertura con clic derecho → Abrir."
else else
# ------------------------------------------------------------------------- # -------------------------------------------------------------------------
# Linux (y resto): binario onefile + tar.gz # Linux (y resto): binario onefile + tar.gz
# ------------------------------------------------------------------------- # -------------------------------------------------------------------------
RELEASE_NAME="jlauncher-v${VERSION}-${OS}-${ARCH}" RELEASE_NAME="jail-launcher-v${VERSION}-${OS}-${ARCH}"
echo "[build] compilando (PySide6 onefile; puede tardar varios minutos)…" echo "[build] compilando (PySide6 onefile; puede tardar varios minutos)…"
.venv/bin/python -m nuitka \ .venv/bin/python -m nuitka \
--onefile \ --onefile \
--assume-yes-for-downloads \ --assume-yes-for-downloads \
--enable-plugin=pyside6 \ --enable-plugin=pyside6 \
--include-package=jlauncher \ --include-package=jail_launcher \
--output-dir=dist \ --output-dir=dist \
--output-filename=jlauncher \ --output-filename=jail-launcher \
--remove-output \ --remove-output \
--lto=yes \ --lto=yes \
app.py app.py
@@ -128,10 +129,10 @@ else
cp games.toml dist/games.toml cp games.toml dist/games.toml
echo "[build] empaquetando release ${RELEASE_NAME}.tar.gz…" echo "[build] empaquetando release ${RELEASE_NAME}.tar.gz…"
tar -czf "dist/${RELEASE_NAME}.tar.gz" -C dist jlauncher games.toml tar -czf "dist/${RELEASE_NAME}.tar.gz" -C dist jail-launcher games.toml
echo "[build] hecho:" echo "[build] hecho:"
ls -lh "dist/jlauncher" "dist/games.toml" "dist/${RELEASE_NAME}.tar.gz" ls -lh "dist/jail-launcher" "dist/games.toml" "dist/${RELEASE_NAME}.tar.gz"
echo "[build] el binario crea jlauncher_data/ y settings.json junto a sí mismo." echo "[build] el binario crea jail_launcher_data/ y settings.json junto a sí mismo."
echo "[build] distribuir: descomprimir el tar.gz (jlauncher + games.toml juntos)." echo "[build] distribuir: descomprimir el tar.gz (jail-launcher + games.toml juntos)."
fi fi
+3 -3
View File
@@ -1,7 +1,7 @@
# Configuración de jlauncher — lista de juegos. # Configuración de jail-launcher — lista de juegos.
# #
# Campos por juego ([[game]]): # Campos por juego ([[game]]):
# id (obligatorio) slug interno → nombre de carpeta en jlauncher_data/ # id (obligatorio) slug interno → nombre de carpeta en jail_launcher_data/
# name (obligatorio) nombre visible en la lista # name (obligatorio) nombre visible en la lista
# clone_url (obligatorio) URL para git clone / git pull # clone_url (obligatorio) URL para git clone / git pull
# run_cmd (obligatorio) comando que ejecuta el juego (cwd = repo clonado) # run_cmd (obligatorio) comando que ejecuta el juego (cwd = repo clonado)
@@ -15,7 +15,7 @@
# Otros pills (topics, descripción, fecha de lanzamiento, versión) salen # Otros pills (topics, descripción, fecha de lanzamiento, versión) salen
# automáticamente de Gitea / git; no hace falta escribirlos aquí. # automáticamente de Gitea / git; no hace falta escribirlos aquí.
data_dir = "jlauncher_data" data_dir = "jail_launcher_data"
[[game]] [[game]]
id = "coffee_crisis" id = "coffee_crisis"
+3
View File
@@ -0,0 +1,3 @@
"""jail-launcher — lanzador de juegos jailgames."""
__version__ = "1.0.5"
@@ -15,7 +15,7 @@ from .ui.theme import apply_theme
def main() -> int: def main() -> int:
app = QApplication(sys.argv) app = QApplication(sys.argv)
app.setApplicationName("jlauncher") app.setApplicationName("jail-launcher")
# No fixem applicationDisplayName: a Windows/X11 Qt l'afegeix al títol de la # No fixem applicationDisplayName: a Windows/X11 Qt l'afegeix al títol de la
# finestra ("títol - displayName") i duplicaria «Jail Launcher», que ja surt # finestra ("títol - displayName") i duplicaria «Jail Launcher», que ja surt
# a WINDOW_TITLE. El nom de l'app al menú de macOS ve del bundle (Nuitka). # a WINDOW_TITLE. El nom de l'app al menú de macOS ve del bundle (Nuitka).
@@ -31,7 +31,7 @@ class Game:
@dataclass @dataclass
class Config: class Config:
data_dir: str = "jlauncher_data" data_dir: str = "jail_launcher_data"
games: list[Game] = field(default_factory=list) games: list[Game] = field(default_factory=list)
@@ -80,4 +80,4 @@ def load_config(path: Path) -> Config:
if not games: if not games:
raise ValueError("games.toml no define ningún [[game]]") raise ValueError("games.toml no define ningún [[game]]")
return Config(data_dir=raw.get("data_dir", "jlauncher_data"), games=games) return Config(data_dir=raw.get("data_dir", "jail_launcher_data"), games=games)
@@ -3,7 +3,7 @@
Compilado con Nuitka, ``__compiled__`` existe. En modo ``--onefile`` la carpeta del Compilado con Nuitka, ``__compiled__`` existe. En modo ``--onefile`` la carpeta del
binario real la expone ``NUITKA_ONEFILE_DIRECTORY`` (Nuitka 4.x); con versiones que usan binario real la expone ``NUITKA_ONEFILE_DIRECTORY`` (Nuitka 4.x); con versiones que usan
``NUITKA_ONEFILE_BINARY`` tomamos su carpeta; si no, ``sys.executable`` (standalone). ``NUITKA_ONEFILE_BINARY`` tomamos su carpeta; si no, ``sys.executable`` (standalone).
Ejecutando desde fuente usamos la raíz del proyecto (la carpeta que contiene ``jlauncher``). Ejecutando desde fuente usamos la raíz del proyecto (la carpeta que contiene ``jail_launcher``).
""" """
from __future__ import annotations from __future__ import annotations
@@ -17,7 +17,7 @@ CONFIG_NAME = "games.toml"
# Carpeta de soporte en macOS cuando corremos como .app: ~/Library/Application Support/… # Carpeta de soporte en macOS cuando corremos como .app: ~/Library/Application Support/…
APP_SUPPORT_VENDOR = "jailgames" APP_SUPPORT_VENDOR = "jailgames"
APP_SUPPORT_APP = "jlauncher" APP_SUPPORT_APP = "jail-launcher"
def is_compiled() -> bool: def is_compiled() -> bool:
@@ -26,7 +26,7 @@ def is_compiled() -> bool:
def base_dir() -> Path: def base_dir() -> Path:
"""Carpeta base junto a la que viven games.toml y jlauncher_data.""" """Carpeta base junto a la que viven games.toml y jail_launcher_data."""
if is_compiled(): if is_compiled():
directory = os.environ.get("NUITKA_ONEFILE_DIRECTORY") directory = os.environ.get("NUITKA_ONEFILE_DIRECTORY")
if directory: if directory:
@@ -35,14 +35,14 @@ def base_dir() -> Path:
if binary: if binary:
return Path(binary).resolve().parent return Path(binary).resolve().parent
return Path(sys.executable).resolve().parent return Path(sys.executable).resolve().parent
# Desde fuente: raíz del proyecto = padre del paquete jlauncher/ # Desde fuente: raíz del proyecto = padre del paquete jail_launcher/
return Path(__file__).resolve().parent.parent return Path(__file__).resolve().parent.parent
def macos_app_bundle() -> Path | None: def macos_app_bundle() -> Path | None:
"""Ruta del .app si corremos como bundle de macOS (``…/jlauncher.app``); si no, None. """Ruta del .app si corremos como bundle de macOS (``…/jail-launcher.app``); si no, None.
En un app bundle el ejecutable vive en ``/jlauncher.app/Contents/MacOS/jlauncher``, En un app bundle el ejecutable vive en ``/jail-launcher.app/Contents/MacOS/jail-launcher``,
dentro de un árbol no escribible al instalarse en ``/Applications``. Detectarlo nos dentro de un árbol no escribible al instalarse en ``/Applications``. Detectarlo nos
deja redirigir datos y settings a ``~/Library/Application Support``. deja redirigir datos y settings a ``~/Library/Application Support``.
""" """
@@ -106,7 +106,7 @@ def config_file() -> Path:
return base_dir() / CONFIG_NAME return base_dir() / CONFIG_NAME
def data_root(data_dir: str = "jlauncher_data") -> Path: def data_root(data_dir: str = "jail_launcher_data") -> Path:
"""Carpeta raíz de datos; se crea si no existe.""" """Carpeta raíz de datos; se crea si no existe."""
root = writable_base() / data_dir root = writable_base() / data_dir
root.mkdir(parents=True, exist_ok=True) root.mkdir(parents=True, exist_ok=True)
+1
View File
@@ -0,0 +1 @@
"""Componentes de interfaz de jail-launcher."""
-3
View File
@@ -1,3 +0,0 @@
"""jlauncher — lanzador de juegos jailgames."""
__version__ = "1.0.5"
-1
View File
@@ -1 +0,0 @@
"""Componentes de interfaz de jlauncher."""
+3 -3
View File
@@ -1,5 +1,5 @@
[project] [project]
name = "jlauncher" name = "jail-launcher"
version = "1.0.4" version = "1.0.4"
description = "Lanzador de juegos jailgames: clona, compila y ejecuta repos Gitea" description = "Lanzador de juegos jailgames: clona, compila y ejecuta repos Gitea"
requires-python = ">=3.11" requires-python = ">=3.11"
@@ -8,11 +8,11 @@ dependencies = [
] ]
[project.scripts] [project.scripts]
jlauncher = "jlauncher.__main__:main" jail-launcher = "jail_launcher.__main__:main"
[build-system] [build-system]
requires = ["setuptools>=68"] requires = ["setuptools>=68"]
build-backend = "setuptools.build_meta" build-backend = "setuptools.build_meta"
[tool.setuptools] [tool.setuptools]
packages = ["jlauncher", "jlauncher.ui"] packages = ["jail_launcher", "jail_launcher.ui"]