From 189645254b6bdf6c3db4f5d54c5a03662399d2ed Mon Sep 17 00:00:00 2001 From: "Roncero Blanco, Edgar" Date: Mon, 26 May 2025 18:26:30 +0200 Subject: [PATCH] Cleaner code, it works pretty fine --- .gitignore | 1 + {src => Program}/app.py | 0 {src => Program}/def_config.ini | 0 Run.cmd | 25 +++++++++++++++++++++++++ requirements.txt | Bin 0 -> 972 bytes src/setup_venv.cmd | 13 ------------- src/setup_venv.ps1 | 12 ------------ 7 files changed, 26 insertions(+), 25 deletions(-) rename {src => Program}/app.py (100%) rename {src => Program}/def_config.ini (100%) create mode 100644 Run.cmd create mode 100644 requirements.txt delete mode 100644 src/setup_venv.cmd delete mode 100644 src/setup_venv.ps1 diff --git a/.gitignore b/.gitignore index 64349e7..07c9010 100644 --- a/.gitignore +++ b/.gitignore @@ -182,3 +182,4 @@ cython_debug/ # ed1337x config.ini +Run.ps1 diff --git a/src/app.py b/Program/app.py similarity index 100% rename from src/app.py rename to Program/app.py diff --git a/src/def_config.ini b/Program/def_config.ini similarity index 100% rename from src/def_config.ini rename to Program/def_config.ini diff --git a/Run.cmd b/Run.cmd new file mode 100644 index 0000000..0b8aef2 --- /dev/null +++ b/Run.cmd @@ -0,0 +1,25 @@ +@echo off +setlocal + +REM Define paths +set VENV_DIR=venv +set APP_DIR=Program +set PYTHON=%VENV_DIR%\Scripts\python.exe + +REM Check for venv +if not exist %VENV_DIR% ( + echo Creating virtual environment... + python -m venv %VENV_DIR% + echo Installing dependencies... + %PYTHON% -m pip install --upgrade pip + %PYTHON% -m pip install -r requirements.txt +) else ( + echo Virtual environment found, assuming dependencies are satisfied. +) + +REM Run the app +cd /d %~dp0%APP_DIR% +..\%VENV_DIR%\Scripts\python.exe app.py + +endlocal + diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000000000000000000000000000000000000..89a33e84863350134452def1304c4173e9260a0a GIT binary patch literal 972 zcmYk5U2eia421n$sYd}dfl^+276johEg>mvD$3#8eq*x%p%rL%JTo4fzu%?xwzk?@ zJK4sT{C?*%v9Y~y3VXIEt9UtC0=4Dnz2vpDR}fQ9X|o${J0J?LetY29!+x?eT**du zbj60d1Dsb^$jZSfeWMF8mf2J!BE-f;N;HHFoDGD zj{4*9J~d?*3`Y|AQi_1KlLF#iseP`!ZD?9be_{+-hgACX`WzxGW# KIT`Z1@7X_y>5bk1 literal 0 HcmV?d00001 diff --git a/src/setup_venv.cmd b/src/setup_venv.cmd deleted file mode 100644 index 087af65..0000000 --- a/src/setup_venv.cmd +++ /dev/null @@ -1,13 +0,0 @@ -@echo off -REM Create Python virtual environment named "venv" -python -m venv venv - -REM Activate the virtual environment -call venv\Scripts\activate.bat - -REM Upgrade pip -python -m pip install --upgrade pip - -REM Install dependencies -pip install mutagen - diff --git a/src/setup_venv.ps1 b/src/setup_venv.ps1 deleted file mode 100644 index 97abb4c..0000000 --- a/src/setup_venv.ps1 +++ /dev/null @@ -1,12 +0,0 @@ -# Create Python virtual environment named "venv" -python -m venv venv - -# Activate the virtual environment -& .\venv\Scripts\Activate.ps1 - -# Upgrade pip -python -m pip install --upgrade pip - -# Install dependencies -pip install mutagen -