2007-10-12 Benny Malengier <benny.malengier@gramps-project.org>

* src/Filters/_FilterParser.py: avoid unknown filters crashing
	* src/Filters/Rules/Person/__init__.py: remove private filter list and register, not used.


svn: r9154
This commit is contained in:
Benny Malengier 2007-10-11 23:05:30 +00:00
parent 054e251754
commit 95bd750cdb
3 changed files with 8 additions and 14 deletions

View File

@ -1,3 +1,7 @@
2007-10-12 Benny Malengier <benny.malengier@gramps-project.org>
* 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 <benny.malengier@gramps-project.org>
* src/gen/db/base.py: allow check without gid creation on all objects
* src/GrampsDbUtils/_ReadXML.py: on reference read, don't create gid.

View File

@ -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)

View File

@ -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'])