Skip to content

Commit

Permalink
added SKIP and OK tokens for reports
Browse files Browse the repository at this point in the history
  • Loading branch information
giumas committed Nov 3, 2024
1 parent 78305c5 commit 5a8ab3a
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 5 deletions.
4 changes: 3 additions & 1 deletion examples/app/report/ex_report.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,9 @@
r += "OK"

r += "Check 2 [CHECK]"
r += "An issue"
r += "[SKIP] An issue"
r += "[ERROR] An issue"
r += "[WARNING] An issue"

r += "Section 2 [SKIP_SEC]"

Expand Down
2 changes: 1 addition & 1 deletion hyo2/abc2/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
logger.addHandler(logging.NullHandler())

name = "ABC"
__version__ = "2.3.11"
__version__ = "2.3.12"
__license__ = "LGPLv3 license"
__copyright__ = "Copyright 2024 University of New Hampshire, Center for Coastal and Ocean Mapping"

Expand Down
20 changes: 17 additions & 3 deletions hyo2/abc2/app/report/report.py
Original file line number Diff line number Diff line change
Expand Up @@ -376,21 +376,35 @@ def print_page_template():
if first_item == "[ERROR]":
if use_colors:
painter.setPen(red_pen)
painter.drawText(row_area, lc_flags, content_item)
painter.drawText(row_area, lc_flags, content_item[len("[ERROR] "):])
if use_colors:
painter.setPen(black_pen)

elif first_item == "[WARNING]":
if use_colors:
painter.setPen(orange_pen)
painter.drawText(row_area, lc_flags, content_item)
painter.drawText(row_area, lc_flags, content_item[len("[WARNING] "):])
if use_colors:
painter.setPen(black_pen)

elif first_item == "[INFO]":
if use_colors:
painter.setPen(magenta_pen)
painter.drawText(row_area, lc_flags, content_item)
painter.drawText(row_area, lc_flags, content_item[len("[INFO] "):])
if use_colors:
painter.setPen(black_pen)

elif first_item == "[SKIP]":
if use_colors:
painter.setPen(gray_pen)
painter.drawText(row_area, lc_flags, content_item[len("[SKIP] "):])
if use_colors:
painter.setPen(black_pen)

elif first_item == "[OK]":
if use_colors:
painter.setPen(gray_pen)
painter.drawText(row_area, lc_flags, content_item[len("[OK] "):])
if use_colors:
painter.setPen(black_pen)

Expand Down

0 comments on commit 5a8ab3a

Please sign in to comment.