Skip to content

Commit

Permalink
report_object -> change message_raw to be a values dict to conform wi…
Browse files Browse the repository at this point in the history
…th pipestat output schemas
  • Loading branch information
donaldcampbelljr committed Nov 20, 2023
1 parent f92d034 commit 1a677da
Showing 1 changed file with 7 additions and 22 deletions.
29 changes: 7 additions & 22 deletions pypiper/manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 1a677da

Please sign in to comment.