Pfadfeststellung ist nur noch in manage_interpreter.bat. Aufrufende Skripte etwas umgebaut
This commit is contained in:
@@ -1,10 +1,18 @@
|
||||
@echo off
|
||||
REM ~dp0 steht für das Verzeichnis, in der diese Datei liegt
|
||||
setlocal
|
||||
SET "MANAGE=%~dp0manage_interpreter.bat"
|
||||
|
||||
call setenv.bat
|
||||
CALL "%MANAGE%" activate
|
||||
if errorlevel 1 (
|
||||
echo ERROR: Failed to activate Python environment
|
||||
exit /b 1
|
||||
)
|
||||
|
||||
REM Beispielaufruf mit Parametern:
|
||||
REM --in: Ordner mit .par-Dateien (optional. Standard: Input)
|
||||
REM --out: Zielverzeichnis (optional. Standard: Work)
|
||||
pushd "%PROJECT%"
|
||||
|
||||
python %PROJECT_LIB%\create_assemblies.py %*
|
||||
"%VIRTUAL_ENV%\Scripts\python.exe" -m lib.create_assemblies %*
|
||||
set PYTHON_EXIT=%ERRORLEVEL%
|
||||
|
||||
popd
|
||||
CALL "%MANAGE%" deactivate
|
||||
exit /b %PYTHON_EXIT%
|
||||
|
||||
@@ -1,6 +1,18 @@
|
||||
@echo off
|
||||
REM ~dp0 steht für das Verzeichnis, in der diese Datei liegt
|
||||
setlocal
|
||||
SET "MANAGE=%~dp0manage_interpreter.bat"
|
||||
|
||||
call setenv.bat
|
||||
CALL "%MANAGE%" activate
|
||||
if errorlevel 1 (
|
||||
echo ERROR: Failed to activate Python environment
|
||||
exit /b 1
|
||||
)
|
||||
|
||||
python "%PROJECT_LIB%\diff_dimensions.py" %*
|
||||
pushd "%PROJECT%"
|
||||
|
||||
"%VIRTUAL_ENV%\Scripts\python.exe" -m lib.diff_dimensions %*
|
||||
set PYTHON_EXIT=%ERRORLEVEL%
|
||||
|
||||
popd
|
||||
CALL "%MANAGE%" deactivate
|
||||
exit /b %PYTHON_EXIT%
|
||||
|
||||
@@ -23,4 +23,4 @@ set /p TOLERANCE=Gib die Toleranz ein (Standard: %DEFAULT_TOLERANCE%):
|
||||
if "%TOLERANCE%"=="" set "TOLERANCE=%DEFAULT_TOLERANCE%"
|
||||
|
||||
REM Aufruf des Skripts mit den eingegebenen oder Standardwerten
|
||||
call diff_dimensions.bat --type %TYPE% --json_2d %JSON2D% --json_dimensions %JSONDIM% --tolerance %TOLERANCE%
|
||||
call "%~dp0diff_dimensions.bat" --type %TYPE% --json_2d %JSON2D% --json_dimensions %JSONDIM% --tolerance %TOLERANCE%
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
@echo off
|
||||
call setenv.bat
|
||||
call "%~dp0setenv.bat"
|
||||
start
|
||||
|
||||
|
||||
@@ -1,10 +1,18 @@
|
||||
@echo off
|
||||
REM ~dp0 steht für das Verzeichnis, in der diese Datei liegt
|
||||
setlocal
|
||||
SET "MANAGE=%~dp0manage_interpreter.bat"
|
||||
|
||||
call setenv.bat
|
||||
CALL "%MANAGE%" activate
|
||||
if errorlevel 1 (
|
||||
echo ERROR: Failed to activate Python environment
|
||||
exit /b 1
|
||||
)
|
||||
|
||||
REM Beispielaufruf mit Parametern:
|
||||
REM --in: Ordner mit .asm-Dateien (optional. Standard: Work)
|
||||
REM --out: Zielverzeichnis (optional. Standard: Work\stl_export)
|
||||
pushd "%PROJECT%"
|
||||
|
||||
python %PROJECT_LIB%\read_variables.py %*
|
||||
"%VIRTUAL_ENV%\Scripts\python.exe" -m lib.read_variables %*
|
||||
set PYTHON_EXIT=%ERRORLEVEL%
|
||||
|
||||
popd
|
||||
CALL "%MANAGE%" deactivate
|
||||
exit /b %PYTHON_EXIT%
|
||||
|
||||
@@ -0,0 +1,35 @@
|
||||
@echo off
|
||||
CALL "%~dp0setenv.bat"
|
||||
|
||||
IF /I "%1"=="activate" GOTO activate
|
||||
IF /I "%1"=="deactivate" GOTO deactivate
|
||||
IF /I "%1"=="activate_interpreter" GOTO activate
|
||||
IF /I "%1"=="deactivate_interpreter" GOTO deactivate
|
||||
GOTO :eof
|
||||
|
||||
|
||||
:activate
|
||||
REM Interpreter wählen
|
||||
IF DEFINED NETWORK_PYTHON (
|
||||
SET PYTHON_EXE=%NETWORK_PYTHON%\python.exe
|
||||
) ELSE (
|
||||
SET PYTHON_EXE=python
|
||||
)
|
||||
|
||||
REM venv sicherstellen
|
||||
IF NOT EXIST "%PROJECT%\.venv" (
|
||||
"%PYTHON_EXE%" -m venv "%PROJECT%\.venv"
|
||||
)
|
||||
|
||||
REM venv aktivieren
|
||||
CALL "%PROJECT%\.venv\Scripts\activate.bat"
|
||||
|
||||
REM Interpreter festnageln
|
||||
SET VIRTUAL_ENV_PYTHON=%PYTHON_EXE%
|
||||
GOTO :eof
|
||||
|
||||
|
||||
:deactivate
|
||||
CALL "%PROJECT%\.venv\Scripts\deactivate.bat"
|
||||
SET VIRTUAL_ENV_PYTHON=
|
||||
GOTO :eof
|
||||
@@ -1,10 +1,18 @@
|
||||
@echo off
|
||||
REM ~dp0 steht für das Verzeichnis, in der diese Datei liegt
|
||||
setlocal
|
||||
SET "MANAGE=%~dp0manage_interpreter.bat"
|
||||
|
||||
call setenv.bat
|
||||
CALL "%MANAGE%" activate
|
||||
if errorlevel 1 (
|
||||
echo ERROR: Failed to activate Python environment
|
||||
exit /b 1
|
||||
)
|
||||
|
||||
REM Beispielaufruf mit Parametern:
|
||||
REM --in: Ordner mit .asm-Dateien (optional. Standard: Work)
|
||||
REM --out: Zielverzeichnis (optional. Standard: Work\stl_export)
|
||||
pushd "%PROJECT%"
|
||||
|
||||
python %PROJECT_LIB%\save_stl.py %*
|
||||
"%VIRTUAL_ENV%\Scripts\python.exe" -m lib.save_stl %*
|
||||
set PYTHON_EXIT=%ERRORLEVEL%
|
||||
|
||||
popd
|
||||
CALL "%MANAGE%" deactivate
|
||||
exit /b %PYTHON_EXIT%
|
||||
|
||||
+8
-11
@@ -1,17 +1,14 @@
|
||||
@echo off
|
||||
REM ~dp0 steht für das Verzeichnis, in der diese Datei liegt
|
||||
REM ~dp0 steht für das Verzeichnis, in der diese Datei liegt
|
||||
pushd %~dp0\..
|
||||
|
||||
REM for /f "delims=" %%i in ('git rev-parse --show-toplevel') do set SSG_RD_DIR=%%i
|
||||
set PROJECT=%cd%
|
||||
|
||||
|
||||
set PROJECT_DIR=%cd%
|
||||
|
||||
set PROJECT_BIN=%PROJECT_DIR%\bin
|
||||
set PROJECT_LIB=%PROJECT_DIR%\lib
|
||||
set PROJECT_WORK=%PROJECT_DIR%\work
|
||||
set PROJECT_DATA=%PROJECT_DIR%\data
|
||||
set PROJECT_INPUT=%PROJECT_DIR%\input
|
||||
set PROJECT_BIN=%PROJECT%\bin
|
||||
set PROJECT_LIB=%PROJECT%\lib
|
||||
set PROJECT_WORK=%PROJECT%\work
|
||||
set PROJECT_DATA=%PROJECT%\data
|
||||
set PROJECT_INPUT=%PROJECT%\input
|
||||
set PROJECT_TEMPLATE=\\ssg.local\freigaben\RuleDesigner\Templates\CreateAssemblies
|
||||
|
||||
if not exist %PROJECT_WORK% mkdir %PROJECT_WORK%
|
||||
@@ -23,4 +20,4 @@ set PROJECT_JSON_TEFBOGEN=%SSG_RD_DIR%\SVGs\Omniflo\python\TEFBogen\json
|
||||
set PROJECT_JSON_TEFWEICHE=%SSG_RD_DIR%\SVGs\Omniflo\python\TEFWeiche\json
|
||||
|
||||
popd
|
||||
goto :eof
|
||||
goto :eof
|
||||
|
||||
Binary file not shown.
Reference in New Issue
Block a user