diff --git a/csst_common/pipeline.py b/csst_common/pipeline.py index 6f6695553283716494f6d370a2f7908641aaeb79..3b763afe281a199c488107932458901ecd0fb04e 100644 --- a/csst_common/pipeline.py +++ b/csst_common/pipeline.py @@ -289,6 +289,13 @@ class Message: for d in dlist: f.write(self.dict2msg(d) + "\n") + def preview(self, dlist: list[dict]) -> str: + """Preview messages.""" + s = "" + for d in dlist: + s += self.dict2msg(d) + "\n" + print(s) + @staticmethod def dict2msg(d: dict): """Convert `dict` to JSON format string."""