2006-07-23 Alex Roitman <shura@gramps-project.org>
* src/Filters/Rules/Person/_IsLessThanNthGenerationDescendantOf.py (IsLessThanNthGenerationDescendantOf.init_list): Use new API. * src/Filters/Rules/Person/_IsSiblingOfFilterMatch.py (IsSiblingOfFilterMatch.init_list): Use new API. * src/Filters/Rules/Person/_RelationshipPathBetween.py (RelationshipPathBetween.desc_list): Use new API. * src/Filters/Rules/Person/_HaveChildren.py (HaveChildren.apply): Use new API. * src/Filters/Rules/Person/_IsMoreThanNthGenerationDescendantOf.py (IsMoreThanNthGenerationDescendantOf.init_list): Use new API. * src/Filters/Rules/__init__.py: Expose Rule for plugin filters. * src/Filters/Rules/Person/_IsDescendantOf.py (IsDescendantOf.init_list): Use new API. * src/Filters/Rules/Person/_HasRelationship.py (HasRelationship.apply): Use new API. svn: r7060
This commit is contained in:
parent
48247e45ed
commit
7c028d4691
17
ChangeLog
17
ChangeLog
@ -1,3 +1,20 @@
|
|||||||
|
2006-07-23 Alex Roitman <shura@gramps-project.org>
|
||||||
|
* src/Filters/Rules/Person/_IsLessThanNthGenerationDescendantOf.py
|
||||||
|
(IsLessThanNthGenerationDescendantOf.init_list): Use new API.
|
||||||
|
* src/Filters/Rules/Person/_IsSiblingOfFilterMatch.py
|
||||||
|
(IsSiblingOfFilterMatch.init_list): Use new API.
|
||||||
|
* src/Filters/Rules/Person/_RelationshipPathBetween.py
|
||||||
|
(RelationshipPathBetween.desc_list): Use new API.
|
||||||
|
* src/Filters/Rules/Person/_HaveChildren.py (HaveChildren.apply):
|
||||||
|
Use new API.
|
||||||
|
* src/Filters/Rules/Person/_IsMoreThanNthGenerationDescendantOf.py
|
||||||
|
(IsMoreThanNthGenerationDescendantOf.init_list): Use new API.
|
||||||
|
* src/Filters/Rules/__init__.py: Expose Rule for plugin filters.
|
||||||
|
* src/Filters/Rules/Person/_IsDescendantOf.py
|
||||||
|
(IsDescendantOf.init_list): Use new API.
|
||||||
|
* src/Filters/Rules/Person/_HasRelationship.py
|
||||||
|
(HasRelationship.apply): Use new API.
|
||||||
|
|
||||||
2006-07-22 Don Allingham <don@gramps-project.org>
|
2006-07-22 Don Allingham <don@gramps-project.org>
|
||||||
* src/Filters/Rules/Person/__init__.py: add register function
|
* src/Filters/Rules/Person/__init__.py: add register function
|
||||||
* configure.in: bump up version number
|
* configure.in: bump up version number
|
||||||
|
@ -57,7 +57,7 @@ class HasRelationship(Rule):
|
|||||||
# count children and look for a relationship type match
|
# count children and look for a relationship type match
|
||||||
for f_id in person.get_family_handle_list():
|
for f_id in person.get_family_handle_list():
|
||||||
f = db.get_family_from_handle(f_id)
|
f = db.get_family_from_handle(f_id)
|
||||||
cnt = cnt + len(f.get_child_handle_list())
|
cnt = cnt + len(f.get_child_ref_list())
|
||||||
if self.list[1] and int(self.list[1]) == f.get_relationship():
|
if self.list[1] and int(self.list[1]) == f.get_relationship():
|
||||||
rel_type = 1
|
rel_type = 1
|
||||||
|
|
||||||
|
@ -47,4 +47,4 @@ class HaveChildren(Rule):
|
|||||||
def apply(self,db,person):
|
def apply(self,db,person):
|
||||||
for family_handle in person.get_family_handle_list():
|
for family_handle in person.get_family_handle_list():
|
||||||
family = db.get_family_from_handle(family_handle)
|
family = db.get_family_from_handle(family_handle)
|
||||||
return len(family.get_child_handle_list()) > 0
|
return len(family.get_child_ref_list()) > 0
|
||||||
|
@ -79,5 +79,6 @@ class IsDescendantOf(Rule):
|
|||||||
for fam_id in person.get_family_handle_list():
|
for fam_id in person.get_family_handle_list():
|
||||||
fam = self.db.get_family_from_handle(fam_id)
|
fam = self.db.get_family_from_handle(fam_id)
|
||||||
if fam:
|
if fam:
|
||||||
for child_handle in fam.get_child_handle_list():
|
for child_ref in fam.get_child_ref_list():
|
||||||
self.init_list(self.db.get_person_from_handle(child_handle),0)
|
self.init_list(
|
||||||
|
self.db.get_person_from_handle(child_ref.ref),0)
|
||||||
|
@ -75,5 +75,6 @@ class IsLessThanNthGenerationDescendantOf(Rule):
|
|||||||
|
|
||||||
for fam_id in person.get_family_handle_list():
|
for fam_id in person.get_family_handle_list():
|
||||||
fam = self.db.get_family_from_handle(fam_id)
|
fam = self.db.get_family_from_handle(fam_id)
|
||||||
for child_handle in fam.get_child_handle_list():
|
for child_ref in fam.get_child_ref_list():
|
||||||
self.init_list(self.db.get_person_from_handle(child_handle),gen+1)
|
self.init_list(
|
||||||
|
self.db.get_person_from_handle(child_ref.ref),gen+1)
|
||||||
|
@ -73,5 +73,6 @@ class IsMoreThanNthGenerationDescendantOf(Rule):
|
|||||||
|
|
||||||
for fam_id in person.get_family_handle_list():
|
for fam_id in person.get_family_handle_list():
|
||||||
fam = self.db.get_family_from_handle(fam_id)
|
fam = self.db.get_family_from_handle(fam_id)
|
||||||
for child_handle in fam.get_child_handle_list():
|
for child_ref in fam.get_child_ref_list():
|
||||||
self.init_list(self.db.get_person_from_handle(child_handle),gen+1)
|
self.init_list(
|
||||||
|
self.db.get_person_from_handle(child_ref.ref),gen+1)
|
||||||
|
@ -71,6 +71,6 @@ class IsSiblingOfFilterMatch(Rule):
|
|||||||
fam_id = person.get_main_parents_family_handle()
|
fam_id = person.get_main_parents_family_handle()
|
||||||
fam = self.db.get_family_from_handle(fam_id)
|
fam = self.db.get_family_from_handle(fam_id)
|
||||||
if fam:
|
if fam:
|
||||||
for child_handle in fam.get_child_handle_list():
|
for child_ref in fam.get_child_ref_list():
|
||||||
if child_handle != person.handle:
|
if child_ref.ref != person.handle:
|
||||||
self.map[child_handle] = 1
|
self.map[child_ref.ref] = 1
|
||||||
|
@ -71,9 +71,9 @@ class RelationshipPathBetween(Rule):
|
|||||||
for fam_id in p.get_family_handle_list():
|
for fam_id in p.get_family_handle_list():
|
||||||
fam = self.db.get_family_from_handle(fam_id)
|
fam = self.db.get_family_from_handle(fam_id)
|
||||||
if fam:
|
if fam:
|
||||||
for child_handle in fam.get_child_handle_list():
|
for child_ref in fam.get_child_ref_list():
|
||||||
if child_handle:
|
if child_ref.ref:
|
||||||
self.desc_list(child_handle,map,0)
|
self.desc_list(child_ref.ref,map,0)
|
||||||
|
|
||||||
def apply_filter(self,rank,handle,plist,pmap):
|
def apply_filter(self,rank,handle,plist,pmap):
|
||||||
person = self.db.get_person_from_handle(handle)
|
person = self.db.get_person_from_handle(handle)
|
||||||
|
@ -26,6 +26,10 @@ Package providing filter rules for GRAMPS.
|
|||||||
|
|
||||||
__author__ = "Don Allingham"
|
__author__ = "Don Allingham"
|
||||||
|
|
||||||
|
# Need to expose this to be available for filter plugins:
|
||||||
|
# the plugins should say: from Filters.Rules import Rule
|
||||||
|
from _Rule import Rule
|
||||||
|
|
||||||
from _Everything import Everything
|
from _Everything import Everything
|
||||||
from _HasGrampsId import HasGrampsId
|
from _HasGrampsId import HasGrampsId
|
||||||
from _IsPrivate import IsPrivate
|
from _IsPrivate import IsPrivate
|
||||||
|
Loading…
Reference in New Issue
Block a user