* src/GenericFilter.py: fixed "only one" filter rule, and matching
the descendents of a filter * src/SelectObject.py: Fix sorting order for title svn: r5145
This commit is contained in:
@@ -1,4 +1,7 @@
|
|||||||
2005-08-29 Don Allingham <don@gramps-project.org>
|
2005-08-29 Don Allingham <don@gramps-project.org>
|
||||||
|
* src/GenericFilter.py: fixed "only one" filter rule, and matching
|
||||||
|
the descendents of a filter
|
||||||
|
* src/SelectObject.py: Fix sorting order for title
|
||||||
* src/plugins/WriteGeneWeb.py: use 'replace' for 'iso-8859-1' encoding
|
* src/plugins/WriteGeneWeb.py: use 'replace' for 'iso-8859-1' encoding
|
||||||
* src/po/fr.po: fix named parameter
|
* src/po/fr.po: fix named parameter
|
||||||
* src/ImageSelect.py: fix note media object added from a gallery
|
* src/ImageSelect.py: fix note media object added from a gallery
|
||||||
|
@@ -417,7 +417,7 @@ class IsDescendantOfFilterMatch(IsDescendantOf):
|
|||||||
"""Rule that checks for a person that is a descendant
|
"""Rule that checks for a person that is a descendant
|
||||||
of someone matched by a filter"""
|
of someone matched by a filter"""
|
||||||
|
|
||||||
labels = [ _('Filter name:'), _('Inclusive:') ]
|
labels = [ _('Filter name:') ]
|
||||||
name = _('Descendants of <filter> match')
|
name = _('Descendants of <filter> match')
|
||||||
category = _('Descendant filters')
|
category = _('Descendant filters')
|
||||||
description = _("Matches people that are descendants of anybody matched by a filter")
|
description = _("Matches people that are descendants of anybody matched by a filter")
|
||||||
@@ -436,8 +436,8 @@ class IsDescendantOfFilterMatch(IsDescendantOf):
|
|||||||
first = 1
|
first = 1
|
||||||
except IndexError:
|
except IndexError:
|
||||||
first = 1
|
first = 1
|
||||||
|
|
||||||
filt = MatchesFilter(self.list)
|
filt = MatchesFilter(self.list[0:1])
|
||||||
filt.prepare(db)
|
filt.prepare(db)
|
||||||
for person_handle in db.get_person_handles(sort_handles=False):
|
for person_handle in db.get_person_handles(sort_handles=False):
|
||||||
person = db.get_person_from_handle( person_handle)
|
person = db.get_person_from_handle( person_handle)
|
||||||
@@ -725,7 +725,7 @@ class IsAncestorOfFilterMatch(IsAncestorOf):
|
|||||||
"""Rule that checks for a person that is an ancestor of
|
"""Rule that checks for a person that is an ancestor of
|
||||||
someone matched by a filter"""
|
someone matched by a filter"""
|
||||||
|
|
||||||
labels = [ _('Filter name:'), _('Inclusive:') ]
|
labels = [ _('Filter name:') ]
|
||||||
name = _('Ancestors of <filter> match')
|
name = _('Ancestors of <filter> match')
|
||||||
category = _("Ancestral filters")
|
category = _("Ancestral filters")
|
||||||
description = _("Matches people that are ancestors "
|
description = _("Matches people that are ancestors "
|
||||||
@@ -746,7 +746,7 @@ class IsAncestorOfFilterMatch(IsAncestorOf):
|
|||||||
except IndexError:
|
except IndexError:
|
||||||
first = 1
|
first = 1
|
||||||
|
|
||||||
filt = MatchesFilter(self.list)
|
filt = MatchesFilter(self.list[0:1])
|
||||||
filt.prepare(db)
|
filt.prepare(db)
|
||||||
for person_handle in db.get_person_handles(sort_handles=False):
|
for person_handle in db.get_person_handles(sort_handles=False):
|
||||||
person = db.get_person_from_handle( person_handle)
|
person = db.get_person_from_handle( person_handle)
|
||||||
@@ -1991,7 +1991,7 @@ class GenericFilter:
|
|||||||
if count:
|
if count:
|
||||||
return False
|
return False
|
||||||
count += 1
|
count += 1
|
||||||
return count != 1
|
return count == 1
|
||||||
|
|
||||||
def or_test(self,db,person):
|
def or_test(self,db,person):
|
||||||
for rule in self.flist:
|
for rule in self.flist:
|
||||||
@@ -2269,8 +2269,14 @@ class FilterParser(handler.ContentHandler):
|
|||||||
|
|
||||||
def endElement(self,tag):
|
def endElement(self,tag):
|
||||||
if tag == "rule" and self.r != None:
|
if tag == "rule" and self.r != None:
|
||||||
if len(self.r.labels) != len(self.a):
|
if len(self.r.labels) < len(self.a):
|
||||||
print "ERROR: Invalid number of arguments in filter '%s'!" %\
|
print "WARNING: Invalid number of arguments in filter '%s'!" %\
|
||||||
|
self.f.get_name()
|
||||||
|
nargs = len(self.r.labels)
|
||||||
|
rule = self.r(self.a[0:nargs])
|
||||||
|
self.f.add_rule(rule)
|
||||||
|
elif len(self.r.labels) > len(self.a):
|
||||||
|
print "ERROR: Invalid number of arguments in filter '%s'!" %\
|
||||||
self.f.get_name()
|
self.f.get_name()
|
||||||
else:
|
else:
|
||||||
rule = self.r(self.a)
|
rule = self.r(self.a)
|
||||||
|
@@ -82,7 +82,7 @@ class SelectObject:
|
|||||||
|
|
||||||
Utils.set_titles(self.top,title_label,title)
|
Utils.set_titles(self.top,title_label,title)
|
||||||
|
|
||||||
titles = [(_('Title'),4,350), (_('ID'),1,50),
|
titles = [(_('Title'),0,350), (_('ID'),1,50),
|
||||||
(_('Type'),2,70), ('Path',3,150), ('',4,0) ]
|
(_('Type'),2,70), ('Path',3,150), ('',4,0) ]
|
||||||
self.ncols = len(titles)
|
self.ncols = len(titles)
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user