Replace "get_note()" calls with "get_note_list()" in filters that use it.

svn: r8748
This commit is contained in:
Brian Matherly 2007-07-20 12:16:34 +00:00
parent 50fe8cb60b
commit e3068f3185
5 changed files with 27 additions and 9 deletions

View File

@ -1,3 +1,10 @@
2007-07-20 Brian Matherly <brian@gramps-project.org>
* src/Filters/Rules/_HasNoteSubstrBase.py:
* src/Filters/Rules/Person/_HasNoteMatchingSubstringOf.py:
* src/Filters/Rules/Person/_HasNote.py:
* src/Filters/Rules/_HasNoteRegexBase.py:
Replace "get_note()" calls with "get_note_list()" in filters that use it.
2007-07-20 Brian Matherly <brian@gramps-project.org> 2007-07-20 Brian Matherly <brian@gramps-project.org>
* src/ToolTips.py (RepositoryTip:get_tip): * src/ToolTips.py (RepositoryTip:get_tip):
* src/plugins/WriteGeneWeb.py (write_family, write_note_of_person): * src/plugins/WriteGeneWeb.py (write_family, write_note_of_person):

View File

@ -45,4 +45,4 @@ class HasNote(Rule):
category = _('General filters') category = _('General filters')
def apply(self,db,person): def apply(self,db,person):
return bool(person.get_note()) return bool(person.get_note_list())

View File

@ -46,7 +46,10 @@ class HasNoteMatchingSubstringOf(Rule):
category = _('General filters') category = _('General filters')
def apply(self,db,person): def apply(self,db,person):
n = person.get_note() notelist = person.get_note_list()
if n: for notehandle in notelist:
return n.upper().find(self.list[0].upper()) != -1 note = db.get_note_from_handle(notehandle)
n = note.get(False)
if n.upper().find(self.list[0].upper()) != -1:
return True
return False return False

View File

@ -56,5 +56,10 @@ class HasNoteRegexBase(Rule):
self.match = re.compile('') self.match = re.compile('')
def apply(self,db,person): def apply(self,db,person):
n = unicode(person.get_note()) notelist = person.get_note_list()
return self.match.match(n) != None for notehandle in notelist:
note = db.get_note_from_handle(notehandle)
n = unicode(note.get(False))
if self.match.match(n) != None:
return True
return False

View File

@ -46,7 +46,10 @@ class HasNoteSubstrBase(Rule):
category = _('General filters') category = _('General filters')
def apply(self,db,person): def apply(self,db,person):
n = unicode(person.get_note()) notelist = person.get_note_list()
if n: for notehandle in notelist:
return n.upper().find(self.list[0].upper()) != -1 note = db.get_note_from_handle(notehandle)
n = unicode(note.get(False))
if n.upper().find(self.list[0].upper()) != -1:
return True
return False return False