* src/GenericFilter.py (HasAttribute.apply): Make work when no value

is given; (HasFamilyAttribute.apply): Make work when no value is given.


svn: r4117
This commit is contained in:
Alex Roitman 2005-03-04 15:15:20 +00:00
parent e777c67ec1
commit 43ffb556fd
2 changed files with 6 additions and 2 deletions

View File

@ -1,3 +1,7 @@
2005-03-04 Alex Roitman <shura@alex.neuro.umn.edu>
* src/GenericFilter.py (HasAttribute.apply): Make work when no value
is given; (HasFamilyAttribute.apply): Make work when no value is given.
2005-03-03 Alex Roitman <shura@alex.neuro.umn.edu> 2005-03-03 Alex Roitman <shura@alex.neuro.umn.edu>
* src/GenericFilter.py (HasAttribute.apply): Fix the rule. * src/GenericFilter.py (HasAttribute.apply): Fix the rule.
(HasFamilyAttribute.apply): Fix the rule. (HasFamilyAttribute.apply): Fix the rule.

View File

@ -1243,7 +1243,7 @@ class HasAttribute(Rule):
p = db.get_person_from_handle(p_id) p = db.get_person_from_handle(p_id)
for attr in p.get_attribute_list(): for attr in p.get_attribute_list():
name_match = self.list[0] == attr.get_type() name_match = self.list[0] == attr.get_type()
value_match = self.list[1] and\ value_match = \
attr.get_value().upper().find(self.list[1].upper()) != -1 attr.get_value().upper().find(self.list[1].upper()) != -1
if name_match and value_match: if name_match and value_match:
return 1 return 1
@ -1270,7 +1270,7 @@ class HasFamilyAttribute(Rule):
f = db.get_family_from_handle(f_id) f = db.get_family_from_handle(f_id)
for attr in f.get_attribute_list(): for attr in f.get_attribute_list():
name_match = self.list[0] == attr.get_type() name_match = self.list[0] == attr.get_type()
value_match = self.list[1] and\ value_match = \
attr.get_value().upper().find(self.list[1].upper()) != -1 attr.get_value().upper().find(self.list[1].upper()) != -1
if name_match and value_match: if name_match and value_match:
return 1 return 1