Skip to content

Commit

Permalink
minor tweak to keep in sync with VTP-web-client
Browse files Browse the repository at this point in the history
  • Loading branch information
windoverwater committed Mar 28, 2024
1 parent baa1366 commit d01ec0f
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions src/vtp/ops/operation.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,13 +138,13 @@ def imprimir_formatting(
case "empty_line":
a_line = "<br>"
case "begin_good_box":
a_line = '<div style="border-width:2px; border-style:solid; border-color:#00f000">'
a_line = "*" * 12
case "end_good_box":
a_line = "</div>"
a_line = "*" * 12
case "begin_error_box":
a_line = '<div style="border-width:2px; border-style:solid; border-color:#f00000">'
a_line = "#" * 12
case "end_error_box":
a_line = "</div>"
a_line = "#" * 12
case _:
raise RuntimeError(
f"Error: unsupported printing construct {a_construct}"
Expand Down Expand Up @@ -175,7 +175,10 @@ def imprimir_formatting(
self.stdout_output.append(a_line)

def imprimir(
self, a_line: str, incoming_printlevel: int = Globals.get("DEFAULT_VERBOSITY")
self,
a_line: str,
incoming_printlevel: int = Globals.get("DEFAULT_VERBOSITY"),
handle_hyperlinks: bool = False,
):
"""Either prints a line of text to STDOUT or appends it to a
list, in which case the output needs to be retrieved. If
Expand All @@ -190,9 +193,10 @@ def imprimir(
# - convert an array to a table with css class=imprimir
# ZZZ
# import pdb; pdb.set_trace()
a_line = Operation._sha1_regex.sub(
r'<a href="foo/\1" target="_blank">\1</a>', a_line
)
if handle_hyperlinks:
a_line = Operation._sha1_regex.sub(
r'<a href="foo/\1" target="_blank">\1</a>', a_line
)
match incoming_printlevel:
case 1:
a_line = '<span class="error">[ERROR] </span>' + a_line
Expand Down

0 comments on commit d01ec0f

Please sign in to comment.