From 31c91a246acb4d8438baec2ec4e1cf5004812dcd Mon Sep 17 00:00:00 2001 From: Romain Bazile Date: Fri, 5 Nov 2021 17:19:17 +0100 Subject: [PATCH] imager: remove problematic characters from image path --- scripts/planktoscope/imager/__init__.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/scripts/planktoscope/imager/__init__.py b/scripts/planktoscope/imager/__init__.py index bc29cbd..c37a034 100644 --- a/scripts/planktoscope/imager/__init__.py +++ b/scripts/planktoscope/imager/__init__.py @@ -109,7 +109,7 @@ class ImagerProcess(multiprocessing.Process): logger.exception( f"A second exception has occured when starting up raspimjpeg: {e}" ) - logger.error(f"This error can't be recovered from, terminating now") + logger.error("This error can't be recovered from, terminating now") raise e if self.__camera.sensor_name == "IMX219": # Camera v2.1 @@ -279,6 +279,7 @@ class ImagerProcess(multiprocessing.Process): self.imager_client.client.publish("status/imager", '{"status":"Busy"}') def __message_settings(self, last_message): + # TODO simplify this method, move timeout error check inside self.__camera.resolution/iso/etc. if self.__imager.state.name == "stop": if "settings" not in last_message: logger.error( @@ -559,8 +560,8 @@ class ImagerProcess(multiprocessing.Process): self.__export_path = os.path.join( self.__base_path, self.__global_metadata["object_date"], - str(self.__global_metadata["sample_id"]).replace(" ", "_"), - str(self.__global_metadata["acq_id"]).replace(" ", "_"), + str(self.__global_metadata["sample_id"]).replace(" ", "_").strip("'"), + str(self.__global_metadata["acq_id"]).replace(" ", "_").strip("'"), ) if os.path.exists(self.__export_path):