Use setenv in launcher scripts, add requirements.txt and missing .sh scripts

platz.bat/platz.sh now derive PLATZ via setenv instead of hardcoded
paths, matching the Standard Programm Template already applied to
setenv/install_py/activate_venv/get_cmd. Added the missing .sh
counterparts to those .bat scripts, an empty requirements.txt for
install_py to install (project only uses the stdlib), and ignore
entries for .venv/, out/, .vscode/, *.swp.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
Michael Stangl
2026-07-09 11:57:05 +02:00
parent bd87b3df46
commit e8911df7e9
16 changed files with 246 additions and 66 deletions
+20
View File
@@ -0,0 +1,20 @@
@echo off
REM ================================================================
REM TEST - Python Virtual Environment aktivieren
REM ================================================================
call "%~dp0setenv.bat"
if not exist "%PLATZ%\.venv" (
echo FEHLER: Virtual environment nicht gefunden.
echo Bitte zuerst bin\install_py.bat ausfuehren.
exit /b 1
)
call "%PLATZ%\.venv\Scripts\activate.bat"
echo Virtuelle Umgebung aktiviert.
echo Python-Version:
python --version
echo.
echo Installierte Pakete:
pip list
+20
View File
@@ -0,0 +1,20 @@
#!/bin/bash
# ================================================================
# Python Virtual Environment aktivieren
# ================================================================
source "$(dirname "${BASH_SOURCE[0]}")/setenv.sh"
if [ ! -d "$PLATZ/.venv" ]; then
echo "FEHLER: Virtual environment nicht gefunden."
echo "Bitte zuerst bin/install_py.sh ausfuehren."
return 1 2>/dev/null || exit 1
fi
source "$PLATZ/.venv/bin/activate"
echo "Virtuelle Umgebung aktiviert."
echo "Python-Version:"
python --version
echo ""
echo "Installierte Pakete:"
pip list
+7
View File
@@ -0,0 +1,7 @@
@echo off
REM ================================================================
REM TEST - Shell mit gesetzten Umgebungsvariablen oeffnen
REM ================================================================
call "%~dp0setenv.bat"
start cmd /k "echo TEST Umgebung aktiv. && echo PLATZ=%PLATZ%"
+7
View File
@@ -0,0 +1,7 @@
#!/bin/bash
# ================================================================
# Shell mit gesetzten Umgebungsvariablen oeffnen
# ================================================================
source "$(dirname "${BASH_SOURCE[0]}")/setenv.sh"
exec "$SHELL"
+21
View File
@@ -0,0 +1,21 @@
@echo off
REM ================================================================
REM TEST - Python Virtual Environment einrichten
REM ================================================================
call "%~dp0setenv.bat"
if not exist "%PLATZ%\.venv" (
echo Initialisiere Python virtual environment...
py -m venv "%PLATZ%\.venv" --upgrade-deps
echo Erfolgreich.
call "%PLATZ%\.venv\Scripts\activate.bat"
echo Installiere erforderliche Python Packages...
pip install -r "%PLATZ%\requirements.txt" -q
echo Erfolgreich.
deactivate
) else (
echo Erforderliche Python Packages bereits installiert!
)
+20
View File
@@ -0,0 +1,20 @@
#!/bin/bash
# ================================================================
# Python Virtual Environment einrichten
# ================================================================
source "$(dirname "${BASH_SOURCE[0]}")/setenv.sh"
if [ ! -d "$PLATZ/.venv" ]; then
echo "Initialisiere Python virtual environment..."
python3 -m venv "$PLATZ/.venv" --upgrade-deps
echo "Erfolgreich."
source "$PLATZ/.venv/bin/activate"
echo "Installiere erforderliche Python Packages..."
pip install -r "$PLATZ/requirements.txt" -q
echo "Erfolgreich."
deactivate
else
echo "Erforderliche Python Packages bereits installiert!"
fi
+8
View File
@@ -0,0 +1,8 @@
@echo off
REM ================================================================
REM Startet das Sitzplatzprogramm
REM ================================================================
call "%~dp0setenv.bat"
python "%PLATZ_LIBS%\platz.py"
+8
View File
@@ -0,0 +1,8 @@
#!/bin/bash
# ================================================================
# Startet das Sitzplatzprogramm
# ================================================================
source "$(dirname "${BASH_SOURCE[0]}")/setenv.sh"
python "$PLATZ_LIBS/platz.py"
-17
View File
@@ -1,17 +0,0 @@
#!/bin/bash
# -------------------------------------
# Wo ist das Programm hinkopiert
export PLATZ=/Users/sm/develop/python/platz
echo $PLATZ
# -------------------------------------
# Umgebung setzen
export PLATZ_CFG=$PLATZ/cfg
export PLATZ_LIBS=$PLATZ/libs
export PLATZ_WORK=$PLATZ/work
# Wo sind die Pythonskripte ?
export PYTHONPATH=$PYTHONPATH:$PLATZ_LIBS
# Startet das Sitzplatzprogramm
python $PLATZ_LIBS/platz.py
-21
View File
@@ -1,21 +0,0 @@
echo off
REM Hier die Umgebung anpassen
REM -------------------------------------
REM Wo ist das Programm hinkopiert
set PLATZ=h:\develop\python\platz
REM Wo liegt der Interpreter
set PYTHONSHELL=l:\tools\i486_nt\python24
REM -------------------------------------
REM Umgebung setzen
set PLATZ_CFG=%PLATZ%\cfg
set PLATZ_LIBS=%PLATZ%\libs
set PLATZ_WORK=%PLATZ%\work
set PATH=%PYTHONSHELL%;%PATH%
REM Wo sind die Pythonskripte ?
set PYTHONPATH=%PLATZ_LIBS%
REM Startet das Sitzplatzprogramm
python %PLATZ_LIBS%\platz.py
+35
View File
@@ -0,0 +1,35 @@
@echo off
REM -------------------------------------
REM Wo ist das Programm hinkopiert
for %%I in ("%~dp0..") do set PLATZ=%%~fI
echo %PLATZ%
REM -------------------------------------
REM Umgebung setzen
set PLATZ_BIN=%PLATZ%\bin
set PLATZ_CFG=%PLATZ%\cfg
set PLATZ_LIBS=%PLATZ%\libs
set PLATZ_WORK=%PLATZ%\work
set PLATZ_IN=%PLATZ%\in
set PLATZ_OUT=%PLATZ%\out
REM Wo sind die Pythonskripte ?
if "%PYTHONPATH%"=="" (
set PYTHONPATH=%PLATZ_LIBS%
) else (
echo %PYTHONPATH% | find /I "%PLATZ_LIBS%" > nul
if errorlevel 1 set PYTHONPATH=%PYTHONPATH%;%PLATZ_LIBS%
)
if not exist "%PLATZ_WORK%" mkdir "%PLATZ_WORK%"
if not exist "%PLATZ_OUT%" mkdir "%PLATZ_OUT%"
echo PLATZ=%PLATZ%
echo PLATZ_BIN=%PLATZ_BIN%
echo PLATZ_CFG=%PLATZ_CFG%
echo PLATZ_LIBS=%PLATZ_LIBS%
echo PLATZ_WORK=%PLATZ_WORK%
echo PLATZ_IN=%PLATZ_IN%
echo PLATZ_OUT=%PLATZ_OUT%
echo PYTHONPATH=%PYTHONPATH%
+32
View File
@@ -0,0 +1,32 @@
#!/bin/bash
# -------------------------------------
# Wo ist das Programm hinkopiert
export PLATZ="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
echo $PLATZ
# -------------------------------------
# Umgebung setzen
export PLATZ_BIN=$PLATZ/bin
export PLATZ_CFG=$PLATZ/cfg
export PLATZ_LIBS=$PLATZ/libs
export PLATZ_WORK=$PLATZ/work
export PLATZ_IN=$PLATZ/in
export PLATZ_OUT=$PLATZ/out
# Wo sind die Pythonskripte ?
case ":$PYTHONPATH:" in
*":$PLATZ_LIBS:"*) ;;
*) export PYTHONPATH=$PYTHONPATH:$PLATZ_LIBS ;;
esac
mkdir -p "$PLATZ_WORK"
mkdir -p "$PLATZ_OUT"
echo PLATZ=$PLATZ
echo PLATZ_BIN=$PLATZ_BIN
echo PLATZ_CFG=$PLATZ_CFG
echo PLATZ_LIBS=$PLATZ_LIBS
echo PLATZ_WORK=$PLATZ_WORK
echo PLATZ_IN=$PLATZ_IN
echo PLATZ_OUT=$PLATZ_OUT
echo PYTHONPATH=$PYTHONPATH