From a03f3fb6aafdb6b81e6056987754ca33a59bae81 Mon Sep 17 00:00:00 2001 From: Romain Bazile Date: Thu, 3 Dec 2020 14:30:59 +0100 Subject: [PATCH] imager: run thumbsup after every picture taken --- scripts/planktoscope/imager.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/scripts/planktoscope/imager.py b/scripts/planktoscope/imager.py index 361654a..3d0cb6e 100644 --- a/scripts/planktoscope/imager.py +++ b/scripts/planktoscope/imager.py @@ -8,6 +8,9 @@ from loguru import logger # Library to get date and time for folder name and filename import datetime +# Subprocess is used to update the gallery folder +import subprocess # nosec + # Library to be able to sleep for a given duration import time @@ -678,6 +681,11 @@ class ImagerProcess(multiprocessing.Process): f'{{"status":"Image {self.__img_done + 1}/{self.__img_goal} has been imaged to {filename}"}}', ) + # Update the gallery with the new image + subprocess.Popen( + "thumbsup --config /home/pi/PlanktonScope/scripts/thumbsup/config.json".split() + ) # nosec + # Increment the counter self.__img_done += 1