From 1a677dad34ffe77dd14cff1034d02e9fde09c117 Mon Sep 17 00:00:00 2001 From: Donald Campbell <125581724+donaldcampbelljr@users.noreply.github.com> Date: Mon, 20 Nov 2023 14:41:28 -0500 Subject: [PATCH] report_object -> change message_raw to be a values dict to conform with pipestat output schemas --- pypiper/manager.py | 29 +++++++---------------------- 1 file changed, 7 insertions(+), 22 deletions(-) diff --git a/pypiper/manager.py b/pypiper/manager.py index c87ec9c..d9ae454 100644 --- a/pypiper/manager.py +++ b/pypiper/manager.py @@ -1675,29 +1675,14 @@ def report_object( anchor_text = str(key).strip() # better to use a relative path in this file # convert any absolute paths into relative paths - relative_filename = ( - os.path.relpath(filename, self.outfolder) - if os.path.isabs(filename) - else filename - ) - - if anchor_image: - relative_anchor_image = ( - os.path.relpath(anchor_image, self.outfolder) - if os.path.isabs(anchor_image) - else anchor_image - ) - else: - relative_anchor_image = "None" - message_raw = "{filename}\t{anchor_text}\t{anchor_image}\t{annotation}".format( - filename=relative_filename, - anchor_text=anchor_text, - anchor_image=relative_anchor_image, - annotation=annotation, - ) - - val = {key: message_raw.replace("\t", " ")} + values = { + "path": filename, + "thumbnail_path": anchor_image, + "title": anchor_text, + "annotation": annotation, + } + val = {key: values} reported_result = self.pipestat.report( values=val,