From 093cd82b06d587896c8e08bed309d052c73e41e6 Mon Sep 17 00:00:00 2001 From: Marius Mauch Date: Fri, 18 May 2007 17:16:55 +0000 Subject: Enable elog functionality for the python side of portage svn path=/main/trunk/; revision=6548 --- pym/portage/elog/filtering.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 pym/portage/elog/filtering.py (limited to 'pym/portage/elog/filtering.py') diff --git a/pym/portage/elog/filtering.py b/pym/portage/elog/filtering.py new file mode 100644 index 000000000..f4748fede --- /dev/null +++ b/pym/portage/elog/filtering.py @@ -0,0 +1,17 @@ +# elog/messages.py - elog core functions +# Copyright 2006-2007 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Id: __init__.py 6458 2007-04-30 02:31:30Z genone $ + +def filter_loglevels(logentries, loglevels): + # remove unwanted entries from all logentries + rValue = {} + loglevels = map(str.upper, loglevels) + for phase in logentries.keys(): + for msgtype, msgcontent in logentries[phase]: + if msgtype.upper() in loglevels or "*" in loglevels: + if not rValue.has_key(phase): + rValue[phase] = [] + rValue[phase].append((msgtype, msgcontent)) + return rValue + -- cgit v1.2.3-1-g7c22