From 74eb4890361a440edd28fcd23f4f79a53fef0420 Mon Sep 17 00:00:00 2001 From: Sven Augustin Date: Wed, 15 Oct 2025 12:58:50 +0200 Subject: [PATCH] nicer fix print to FileHandler --- dap/accumulator.py | 2 +- dap/utils/filehandler.py | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/dap/accumulator.py b/dap/accumulator.py index 756e6a0..df37e3f 100644 --- a/dap/accumulator.py +++ b/dap/accumulator.py @@ -51,7 +51,7 @@ def accumulate(accumulator_host, accumulator_port): res_laser_on = results.get("laser_on", False) res_roi_intensities = results.get("roi_intensities", []) - print(pulse_id, res_is_good_frame, res_is_hit_frame, res_number_of_spots, res_laser_on, *res_roi_intensities, file=output.file) + print(pulse_id, res_is_good_frame, res_is_hit_frame, res_number_of_spots, res_laser_on, *res_roi_intensities, file=output) diff --git a/dap/utils/filehandler.py b/dap/utils/filehandler.py index 341ea01..17699a9 100644 --- a/dap/utils/filehandler.py +++ b/dap/utils/filehandler.py @@ -23,5 +23,9 @@ class FileHandler: if self.file: self.file.flush() + def write(self, *args, **kwargs): + if self.file: + self.file.write(*args, **kwargs) +