imager: run thumbsup after every picture taken

This commit is contained in:
Romain Bazile 2020-12-03 14:30:59 +01:00
parent ee3d96cff7
commit a03f3fb6aa

View file

@ -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