2008-03-06 Douglas S. Blank <dblank@cs.brynmawr.edu>

* src/plugins/SameSurnames.py:
	* src/plugins/DefaultGramplets.py:
	* src/plugins/FilterByName.py:
	Fixes for proper surname grouping; fix for all of a person's name



svn: r10200
This commit is contained in:
Doug Blank 2008-03-06 12:33:02 +00:00
parent 8401d18738
commit 9175b40cb4
4 changed files with 23 additions and 13 deletions

View File

@ -1,3 +1,9 @@
2008-03-06 Douglas S. Blank <dblank@cs.brynmawr.edu>
* src/plugins/SameSurnames.py:
* src/plugins/DefaultGramplets.py:
* src/plugins/FilterByName.py:
Fixes for proper surname grouping; fix for all of a person's name
2008-03-05 Douglas S. Blank <dblank@cs.brynmawr.edu>
* src/plugins/FilterByName.py (run):
fixed a couple of missing translations; name counts were slightly off

View File

@ -219,9 +219,11 @@ class TopSurnamesGramplet(Gramplet):
for person_handle in people:
person = self.dbstate.db.get_person_from_handle(person_handle)
if person:
surname = person.get_primary_name().get_surname().strip()
surnames[surname] = surnames.get(surname, 0) + 1
representative_handle[surname] = person_handle
allnames = [person.get_primary_name()] + person.get_alternate_names()
for name in allnames:
surname = name.get_group_name().strip()
surnames[surname] = surnames.get(surname, 0) + 1
representative_handle[surname] = person_handle
if cnt % 350 == 0:
yield True
cnt += 1
@ -294,9 +296,11 @@ class SurnameCloudGramplet(Gramplet):
for person_handle in people:
person = self.dbstate.db.get_person_from_handle(person_handle)
if person:
surname = person.get_primary_name().get_surname().strip()
surnames[surname] = surnames.get(surname, 0) + 1
representative_handle[surname] = person_handle
allnames = [person.get_primary_name()] + person.get_alternate_names()
for name in allnames:
surname = name.get_group_name().strip()
surnames[surname] = surnames.get(surname, 0) + 1
representative_handle[surname] = person_handle
if cnt % 350 == 0:
yield True
cnt += 1
@ -599,10 +603,10 @@ class StatsGramplet(Gramplet):
person = database.get_person_from_handle(person_handle)
names = [person.get_primary_name()] + person.get_alternate_names()
for name in names:
if name.get_first_name() == "" or name.get_surname() == "":
if name.get_first_name() == "" or name.get_group_name() == "":
incomp_names = incomp_names + 1
if name.get_surname() not in namelist:
namelist.append(name.get_surname())
if name.get_group_name() not in namelist:
namelist.append(name.get_group_name())
if ((not person.get_main_parents_family_handle()) and
(not len(person.get_family_handle_list()))):
disconnected = disconnected + 1

View File

@ -87,7 +87,7 @@ def run(database, document, filter_name):
for person_handle in people:
person = database.get_person_from_handle(person_handle)
for name in [person.get_primary_name()] + person.get_alternate_names():
if name.get_surname() == "" or name.get_first_name() == "":
if name.get_group_name() == "" or name.get_first_name() == "":
stab.row(person, sdb.birth_date_obj(person),
str(person.get_primary_name().get_type()))
matches += 1
@ -132,7 +132,7 @@ def run(database, document, filter_name):
person = database.get_person_from_handle(person_handle)
if person:
names = [person.get_primary_name()] + person.get_alternate_names()
surnames = list(set([name.get_surname() for name in names]))
surnames = list(set([name.get_group_name() for name in names]))
for surname in surnames:
namelist[surname] = namelist.get(surname, 0) + 1
surnames = namelist.keys()

View File

@ -37,7 +37,7 @@ class IncompleteSurname(Rule):
category = _('General filters')
def apply(self,db,person):
for name in [person.get_primary_name()] + person.get_alternate_names():
if name.get_surname() == "":
if name.get_group_name() == "":
return True
return False
@ -68,7 +68,7 @@ def run(database, document, person):
rsurname = person
else:
surname = sdb.surname(person)
rsurname = person.get_primary_name().get_surname()
rsurname = person.get_primary_name().get_group_name()
# display the title
sdoc.title(_("People with the surname '%s'") % surname)
sdoc.paragraph("")