From b33612a7a17f64dfded726f1c676f8a09b3affab Mon Sep 17 00:00:00 2001 From: Martin Hawlisch Date: Fri, 8 Apr 2005 18:52:05 +0000 Subject: [PATCH] * src/GenericFilter.py (FilterParser.startElement): Catch non existing filter rule and print an error message svn: r4325 --- gramps2/ChangeLog | 3 +++ gramps2/src/GenericFilter.py | 5 ++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/gramps2/ChangeLog b/gramps2/ChangeLog index e0bb0d3fb..69fcd4021 100644 --- a/gramps2/ChangeLog +++ b/gramps2/ChangeLog @@ -9,6 +9,9 @@ * src/PeopleModel.py (column_death_place): Use "Burial" and "Cremation" events + * src/GenericFilter.py (FilterParser.startElement): Catch non existing + filter rule and print an error message + 2005-04-08 Richard Taylor * src/Utils.py (probably_alive): fix some bugs and added checking of ancestors. diff --git a/gramps2/src/GenericFilter.py b/gramps2/src/GenericFilter.py index 6f195a084..53669edd5 100644 --- a/gramps2/src/GenericFilter.py +++ b/gramps2/src/GenericFilter.py @@ -2336,7 +2336,10 @@ class FilterParser(handler.ContentHandler): cname = attrs['class'] name = unicode(_(cname)) self.a = [] - self.cname = tasks[name] + if name in tasks: + self.cname = tasks[name] + else: + print "ERROR: Filter rule '%s' in filter '%s' not found!" % (name,self.f.get_name()) elif tag == "arg": self.a.append(attrs['value'])