From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id B7D481582EF for ; Sat, 08 Feb 2025 22:54:38 +0000 (UTC) Received: from lists.gentoo.org (bobolink.gentoo.org [140.211.166.189]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: relay-lists.gentoo.org@gentoo.org) by smtp.gentoo.org (Postfix) with ESMTPSA id 922FF34308C for ; Sat, 08 Feb 2025 22:54:38 +0000 (UTC) Received: from bobolink.gentoo.org (localhost [127.0.0.1]) by bobolink.gentoo.org (Postfix) with ESMTP id 03651110471; Sat, 08 Feb 2025 22:54:37 +0000 (UTC) Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by bobolink.gentoo.org (Postfix) with ESMTPS id E87811103CB for ; Sat, 08 Feb 2025 22:54:36 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 9657434308C for ; Sat, 08 Feb 2025 22:54:36 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id F000526E2 for ; Sat, 08 Feb 2025 22:54:34 +0000 (UTC) From: "Sebastian Pipping" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Sebastian Pipping" Message-ID: <1739052502.0193e1980dda46ee8a6811822f41a3baadb90a50.sping@gentoo> Subject: [gentoo-commits] proj/elogv:master commit in: / X-VCS-Repository: proj/elogv X-VCS-Files: elogv X-VCS-Directories: / X-VCS-Committer: sping X-VCS-Committer-Name: Sebastian Pipping X-VCS-Revision: 0193e1980dda46ee8a6811822f41a3baadb90a50 X-VCS-Branch: master Date: Sat, 08 Feb 2025 22:54:34 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: f1ebf000-81aa-4abe-a56a-042f9f4901ed X-Archives-Hash: 4af173a18edb2ed4d3fc8b8a23aeeffc commit: 0193e1980dda46ee8a6811822f41a3baadb90a50 Author: Alfred Wingate protonmail com> AuthorDate: Sat Feb 1 04:59:35 2025 +0000 Commit: Sebastian Pipping gentoo org> CommitDate: Sat Feb 8 22:08:22 2025 +0000 URL: https://gitweb.gentoo.org/proj/elogv.git/commit/?id=0193e198 elogv: match QA class of logs and give it an appropriate colour Signed-off-by: Alfred Wingate protonmail.com> elogv | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/elogv b/elogv index ca0ddf0..3853505 100755 --- a/elogv +++ b/elogv @@ -141,7 +141,7 @@ you can use these keys to control the behavior of the program: """ ) -(normal, selected, einfo, elog, ewarn, eerror) = range(6) +(normal, selected, einfo, elog, ewarn, eerror, eqawarn) = range(7) (PATH, CAT, PN, DATE, CLASS) = range(5) # Character used to print the class of an elog @@ -224,6 +224,8 @@ class ElogViewer: curses.init_pair(ewarn, curses.COLOR_YELLOW, curses.COLOR_BLACK) curses.init_pair(eerror, curses.COLOR_RED, curses.COLOR_BLACK) curses.init_pair(elog, curses.COLOR_MAGENTA, curses.COLOR_BLACK) + # Normally eqawarn color would be orange/brown but this isnt an option in curses. + curses.init_pair(eqawarn, curses.COLOR_YELLOW, curses.COLOR_BLACK) except curses.error: # e.g. with "TERM=vt100 elogv" invokation pass @@ -555,7 +557,7 @@ class ElogViewer: Get the highest elog class in a file """ with self.open(filepath) as f: - classes = re.findall("LOG:|INFO:|WARN:|ERROR:", f.read()) + classes = re.findall("LOG:|INFO:|WARN:|ERROR:|QA:", f.read()) if "ERROR:" in classes: return eerror @@ -563,6 +565,8 @@ class ElogViewer: return ewarn elif "LOG:" in classes: return elog + elif "QA:" in classes: + return eqawarn else: return einfo @@ -611,6 +615,8 @@ class ElogViewer: self.log_win.addstr(x[: self.width - 2], curses.color_pair(eerror)) elif x.startswith("LOG:"): self.log_win.addstr(x[: self.width - 2], curses.color_pair(elog)) + elif x.startswith("QA:"): + self.log_win.addstr(x[: self.width - 2], curses.color_pair(eqawarn)) else: # Strip embedded color codes x = re.sub(ansi_code, "", x)