From 71c6c7096577b1e14cd5598cf100df454d2e1994 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Radovan=20Garab=C3=ADk?= Date: Wed, 27 Jan 2016 10:10:58 +0100 Subject: [PATCH] ignore configuration sections without regexp --- grc | 4 ++-- grcat | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/grc b/grc index 6750d07..e0ee182 100755 --- a/grc +++ b/grc @@ -3,11 +3,11 @@ import os, re, string, sys, getopt, signal def version(): - print ("Generic Colouriser 1.9") + print ("Generic Colouriser 1.9.1rc1") sys.exit() def help(): - print("""Generic Colouriser 1.9 + print("""Generic Colouriser 1.9.1rc1 grc [options] command [args] Options:") -e --stderr redirect stderr. If this option is selected, diff --git a/grcat b/grcat index 0fd81fa..4187142 100755 --- a/grcat +++ b/grcat @@ -156,8 +156,9 @@ while not is_last: ll['colours'] = colstrings cs = ll['count'] - ll['regexp'] = re.compile(ll['regexp']).search - regexplist.append(ll) + if ll.has_key('regexp'): + ll['regexp'] = re.compile(ll['regexp']).search + regexplist.append(ll) prevcolour = colours['default'] prevcount = "more"