réorganisation du tree

This commit is contained in:
2026-03-31 23:58:23 +02:00
parent 4f2d3018b5
commit 0dfc9356fe
7 changed files with 16 additions and 36 deletions

1
.gitignore vendored
View File

@@ -1,2 +1,3 @@
*.pem
.env
venv

View File

@@ -58,7 +58,10 @@ sleep 1
#----------------------------
# 2. Installation de MariaDB x phpmyadmin
#------------------------------
read -p "Installer mariadb et phpMyAdmin ? (y/n)" db
if [ "$db" = 'y'];then
bash DB/main.sh
fi
#-------------------------------
@@ -83,7 +86,6 @@ if ! apt install python3 python3-pip python3-venv -y; then
fi
PYTHON_VERSION=$(python3 --version 2>&1)
echo " $PYTHON_VERSION installé"
echo " $PYTHON_VERSION installé"
sleep 1
@@ -98,7 +100,6 @@ VENV_LIST=()
for dir in "${SEARCH_DIRS[@]}"; do
if [ -d "$dir" ]; then
# Un venv valide contient bin/activate et bin/python
while IFS= read -r -d '' activate_path; do
venv_dir=$(dirname "$(dirname "$activate_path")")
if [ -f "$venv_dir/bin/python" ]; then
@@ -154,27 +155,24 @@ if [[ "$CREATE_VENV" =~ ^[oO]$ ]]; then
echo "Installation des dépendances depuis requirements.txt..."
"$VENV_PATH/bin/pip" install -r ./requirements.txt
echo " Dépendances installées"
echo " Dépendances installées"
else
echo " Aucun requirements.txt trouvé, installation des dépendances ignorée"
echo " Aucun requirements.txt trouvé, installation des dépendances ignorée"
fi
else
echo " Erreur lors de la création du venv à : $VENV_PATH"
echo " Erreur lors de la création du venv à : $VENV_PATH"
exit 1
fi
else
echo " Création ignorée"
echo " Création ignorée"
fi
# ----------------------------
# Fin
# ----------------------------
print_step " Configuration terminée"
print_step " Configuration terminée"
echo ""
if [ -f "./.venv_path" ]; then
echo "Venv configuré : $(cat ./.venv_path)"

View File

@@ -65,4 +65,4 @@ EOF
sleep 1
touch /var/log/loustique.log
chown ${SUDO_USER}:${SUDO_USER} /var/log/loustique.log
venv/bin/python main
venv/bin/python main.py

View File

@@ -1,22 +0,0 @@
from time import *
from gpiozero import *
from signal import pause
from log import log
def led(utilisateur):
print('led allumé')
log.info(f'led allumé par {utilisateur}')
"""
print("One button to turn on or off")
led = LED(17)
btn = Button(20, bounce_time=None)
while True:
print('turn on')
led.on()
sleep(0.2) # to avoid bouncing
btn.wait_for_press()
print('turn off')
led.off()
sleep(0.2) # to avoid bouncing
btn.wait_for_press()
"""

View File

@@ -58,7 +58,11 @@ sleep 1
#----------------------------
# 2. Installation de MariaDB x phpmyadmin
#------------------------------
read -p "Installer mariadb et phpMyAdmin ? (y/n)" db
if [ "$db" = 'y'];then
bash DB/main.sh
fi
#-------------------------------
@@ -154,27 +158,26 @@ if [[ "$CREATE_VENV" =~ ^[oO]$ ]]; then
echo "Installation des dépendances depuis requirements.txt..."
"$VENV_PATH/bin/pip" install -r ./requirements.txt
echo " Dépendances installées"
echo " Dépendances installées"
else
echo " Aucun requirements.txt trouvé, installation des dépendances ignorée"
echo " Aucun requirements.txt trouvé, installation des dépendances ignorée"
fi
else
echo " Erreur lors de la création du venv à : $VENV_PATH"
echo " Erreur lors de la création du venv à : $VENV_PATH"
exit 1
fi
else
echo " Création ignorée"
echo " Création ignorée"
fi
# ----------------------------
# Fin
# ----------------------------
print_step " Configuration terminée"
print_step " Configuration terminée"
echo ""
if [ -f "./.venv_path" ]; then
echo "Venv configuré : $(cat ./.venv_path)"

View File

@@ -65,4 +65,4 @@ EOF
sleep 1
touch /var/log/loustique.log
chown ${SUDO_USER}:${SUDO_USER} /var/log/loustique.log
venv/bin/python ./flask/main.py
venv/bin/python main.py