From 58d479f8b75e1240af4ef38af75d0142404b6ea3 Mon Sep 17 00:00:00 2001 From: BO ZHANG Date: Tue, 8 Nov 2022 17:44:06 +0800 Subject: [PATCH] added fr.is_good() to check existence of alleged files --- csst_common/file_recorder.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/csst_common/file_recorder.py b/csst_common/file_recorder.py index d01e3e6..aa9e4be 100644 --- a/csst_common/file_recorder.py +++ b/csst_common/file_recorder.py @@ -97,3 +97,7 @@ class FileRecorder(list): return f"{len(self)} alleged, " \ f"{len(self) - sum(self.to_table()['existence'])} missing, " \ f"{sum(self.to_table()['existence'])} to db" + + def is_good(self): + """ Check if all alleged files exist. """ + return all(self.to_table()['existence']) -- GitLab