* src/Filters/Rules/Person/_HasFamilyEvent.py (apply): Use new API.

* src/Filters/Rules/Person/_PersonWithIncompleteEvent.py
	(apply): Do not double-handle birth and death events.


svn: r7124
This commit is contained in:
Alex Roitman 2006-08-04 22:41:51 +00:00
parent 4a647bdc55
commit 5cb55bb60e
3 changed files with 10 additions and 4 deletions

View File

@ -1,4 +1,7 @@
2006-08-04 Alex Roitman <shura@gramps-project.org>
* src/Filters/Rules/Person/_HasFamilyEvent.py (apply): Use new API.
* src/Filters/Rules/Person/_PersonWithIncompleteEvent.py
(apply): Do not double-handle birth and death events.
* src/Filters/Rules/Person/_IsWitness.py: Rewrite with new API.
* src/FilterEditor/_FilterEditor.py (__init__): Remove unneeded
argument, namespace is enough to get the filter class via factory;

View File

@ -33,6 +33,7 @@ from gettext import gettext as _
#
#-------------------------------------------------------------------------
import DateHandler
from RelLib import EventType
from Filters.Rules._Rule import Rule
from Filters.Rules._RuleUtils import date_cmp
@ -70,8 +71,11 @@ class HasFamilyEvent(Rule):
event_handle = event_ref.ref
event = db.get_event_from_handle(event_handle)
val = 1
if self.list[0] and event.get_type() != self.list[0]:
val = 0
if self.list[0]:
specified_type = EventType()
specified_type.set_from_xml_str(self.list[0])
if event.type != specified_type:
val = 0
v = self.list[3]
if v and event.get_description().upper().find(v.upper())==-1:
val = 0

View File

@ -45,8 +45,7 @@ class PersonWithIncompleteEvent(Rule):
category = _('Event filters')
def apply(self,db,person):
for event_ref in person.get_event_ref_list() + \
[person.get_birth_ref(), person.get_death_ref()]:
for event_ref in person.get_event_ref_list():
if event_ref:
event = db.get_event_from_handle(event_ref.ref)
if not event.get_place_handle():