From b60a519330b62f3eb26598a506d1682a51c5c414 Mon Sep 17 00:00:00 2001 From: yh202109 Date: Sat, 13 Jul 2024 15:23:02 -0400 Subject: [PATCH] v0.2.20 --- mtbp3/health/ectd.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/mtbp3/health/ectd.py b/mtbp3/health/ectd.py index 7792d0e2..915d7983 100644 --- a/mtbp3/health/ectd.py +++ b/mtbp3/health/ectd.py @@ -62,6 +62,11 @@ def find_section_given_words(self, words, outfmt='simple', include='up', to_righ out_colored = [] for row in out: for word in words: + try: + start = row.lower().index(word.lower()) + end = start + len(word) + except ValueError: + continue start = row.lower().index(word.lower()) end = start + len(word) row = row[:start] + f"\033[91m{row[start:end]}\033[0m" + row[end:]