From af86d7d8bcfaf8308ac5b66e010ab48db97c331c Mon Sep 17 00:00:00 2001 From: Xavier Gouchet Date: Wed, 14 Oct 2015 08:52:40 +0200 Subject: [PATCH] Feature : Global ignore list (Issue #79) Ignore list is read from an environment variable named PIDCAT_IGNORED_TAGS. Multiple tags can be set, separated by a semicolon. eg: on *nix systems just type the following in a terminal $ export PIDCAT_IGNORED_TAGS="art;dalvikvm" --- pidcat.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/pidcat.py b/pidcat.py index efaa078..7a99b69 100755 --- a/pidcat.py +++ b/pidcat.py @@ -24,6 +24,7 @@ import argparse import sys import re +import os import subprocess from subprocess import PIPE @@ -128,6 +129,8 @@ def indent_wrap(message): 'DEBUG': YELLOW, } +ENV_IGNORED_TAGS = os.getenv('PIDCAT_IGNORED_TAGS',"").split(';') + def allocate_color(tag): # this will allocate a unique format for the given tag # since we dont have very many colors, we always keep track of the LRU @@ -330,7 +333,9 @@ def tag_in_tags_regex(tag, tags): continue if args.tag and not tag_in_tags_regex(tag, args.tag): continue - + if tag_in_tags_regex(tag, ENV_IGNORED_TAGS): + continue + linebuf = '' if args.tag_width > 0: