From 95bd750cdbf8810274b1b5b208e9a1cfbf8ad328 Mon Sep 17 00:00:00 2001 From: Benny Malengier Date: Thu, 11 Oct 2007 23:05:30 +0000 Subject: [PATCH] 2007-10-12 Benny Malengier * src/Filters/_FilterParser.py: avoid unknown filters crashing * src/Filters/Rules/Person/__init__.py: remove private filter list and register, not used. svn: r9154 --- ChangeLog | 4 ++++ src/Filters/Rules/Person/__init__.py | 5 ----- src/Filters/_FilterParser.py | 13 ++++--------- 3 files changed, 8 insertions(+), 14 deletions(-) diff --git a/ChangeLog b/ChangeLog index 22e49a9a4..cf7a6cba9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2007-10-12 Benny Malengier + * src/Filters/_FilterParser.py: avoid unknown filters crashing + * src/Filters/Rules/Person/__init__.py: remove private filter list and register, not used. + 2007-10-11 Benny Malengier * src/gen/db/base.py: allow check without gid creation on all objects * src/GrampsDbUtils/_ReadXML.py: on reference read, don't create gid. diff --git a/src/Filters/Rules/Person/__init__.py b/src/Filters/Rules/Person/__init__.py index 79ee52950..029ca39f5 100644 --- a/src/Filters/Rules/Person/__init__.py +++ b/src/Filters/Rules/Person/__init__.py @@ -95,8 +95,6 @@ from _RegExpName import RegExpName from _MatchIdOf import MatchIdOf from _RegExpIdOf import RegExpIdOf -# This is the name->class storage for private rule classes -private = {} #------------------------------------------------------------------------- # @@ -162,6 +160,3 @@ editor_rule_list = [ Disconnected, ] -def register(rule): - private[rule.__name__] = rule - editor_rule_list.append(rule) diff --git a/src/Filters/_FilterParser.py b/src/Filters/_FilterParser.py index c452cab1b..bee4c4dd2 100644 --- a/src/Filters/_FilterParser.py +++ b/src/Filters/_FilterParser.py @@ -96,16 +96,11 @@ class FilterParser(handler.ContentHandler): exec 'self.r = Rules.%s.%s' % ( self.namespace,last_name) except (ImportError, NameError, AttributeError ): - # Now try the private rule - try: - exec "self.r = Rules.%s.private['%s']" % ( - self.namespace,last_name) - except KeyError: - print "ERROR: Filter rule '%s' in "\ - "filter '%s' not found!"\ + print "ERROR: Filter rule '%s' in "\ + "filter '%s' not found!"\ % (save_name,self.f.get_name()) - self.r = None - return + self.r = None + return self.a = [] elif tag == "arg": self.a.append(attrs['value'])