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:
parent
8401d18738
commit
9175b40cb4
@ -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>
|
2008-03-05 Douglas S. Blank <dblank@cs.brynmawr.edu>
|
||||||
* src/plugins/FilterByName.py (run):
|
* src/plugins/FilterByName.py (run):
|
||||||
fixed a couple of missing translations; name counts were slightly off
|
fixed a couple of missing translations; name counts were slightly off
|
||||||
|
@ -219,9 +219,11 @@ class TopSurnamesGramplet(Gramplet):
|
|||||||
for person_handle in people:
|
for person_handle in people:
|
||||||
person = self.dbstate.db.get_person_from_handle(person_handle)
|
person = self.dbstate.db.get_person_from_handle(person_handle)
|
||||||
if person:
|
if person:
|
||||||
surname = person.get_primary_name().get_surname().strip()
|
allnames = [person.get_primary_name()] + person.get_alternate_names()
|
||||||
surnames[surname] = surnames.get(surname, 0) + 1
|
for name in allnames:
|
||||||
representative_handle[surname] = person_handle
|
surname = name.get_group_name().strip()
|
||||||
|
surnames[surname] = surnames.get(surname, 0) + 1
|
||||||
|
representative_handle[surname] = person_handle
|
||||||
if cnt % 350 == 0:
|
if cnt % 350 == 0:
|
||||||
yield True
|
yield True
|
||||||
cnt += 1
|
cnt += 1
|
||||||
@ -294,9 +296,11 @@ class SurnameCloudGramplet(Gramplet):
|
|||||||
for person_handle in people:
|
for person_handle in people:
|
||||||
person = self.dbstate.db.get_person_from_handle(person_handle)
|
person = self.dbstate.db.get_person_from_handle(person_handle)
|
||||||
if person:
|
if person:
|
||||||
surname = person.get_primary_name().get_surname().strip()
|
allnames = [person.get_primary_name()] + person.get_alternate_names()
|
||||||
surnames[surname] = surnames.get(surname, 0) + 1
|
for name in allnames:
|
||||||
representative_handle[surname] = person_handle
|
surname = name.get_group_name().strip()
|
||||||
|
surnames[surname] = surnames.get(surname, 0) + 1
|
||||||
|
representative_handle[surname] = person_handle
|
||||||
if cnt % 350 == 0:
|
if cnt % 350 == 0:
|
||||||
yield True
|
yield True
|
||||||
cnt += 1
|
cnt += 1
|
||||||
@ -599,10 +603,10 @@ class StatsGramplet(Gramplet):
|
|||||||
person = database.get_person_from_handle(person_handle)
|
person = database.get_person_from_handle(person_handle)
|
||||||
names = [person.get_primary_name()] + person.get_alternate_names()
|
names = [person.get_primary_name()] + person.get_alternate_names()
|
||||||
for name in 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
|
incomp_names = incomp_names + 1
|
||||||
if name.get_surname() not in namelist:
|
if name.get_group_name() not in namelist:
|
||||||
namelist.append(name.get_surname())
|
namelist.append(name.get_group_name())
|
||||||
if ((not person.get_main_parents_family_handle()) and
|
if ((not person.get_main_parents_family_handle()) and
|
||||||
(not len(person.get_family_handle_list()))):
|
(not len(person.get_family_handle_list()))):
|
||||||
disconnected = disconnected + 1
|
disconnected = disconnected + 1
|
||||||
|
@ -87,7 +87,7 @@ def run(database, document, filter_name):
|
|||||||
for person_handle in people:
|
for person_handle in people:
|
||||||
person = database.get_person_from_handle(person_handle)
|
person = database.get_person_from_handle(person_handle)
|
||||||
for name in [person.get_primary_name()] + person.get_alternate_names():
|
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),
|
stab.row(person, sdb.birth_date_obj(person),
|
||||||
str(person.get_primary_name().get_type()))
|
str(person.get_primary_name().get_type()))
|
||||||
matches += 1
|
matches += 1
|
||||||
@ -132,7 +132,7 @@ def run(database, document, filter_name):
|
|||||||
person = database.get_person_from_handle(person_handle)
|
person = database.get_person_from_handle(person_handle)
|
||||||
if person:
|
if person:
|
||||||
names = [person.get_primary_name()] + person.get_alternate_names()
|
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:
|
for surname in surnames:
|
||||||
namelist[surname] = namelist.get(surname, 0) + 1
|
namelist[surname] = namelist.get(surname, 0) + 1
|
||||||
surnames = namelist.keys()
|
surnames = namelist.keys()
|
||||||
|
@ -37,7 +37,7 @@ class IncompleteSurname(Rule):
|
|||||||
category = _('General filters')
|
category = _('General filters')
|
||||||
def apply(self,db,person):
|
def apply(self,db,person):
|
||||||
for name in [person.get_primary_name()] + person.get_alternate_names():
|
for name in [person.get_primary_name()] + person.get_alternate_names():
|
||||||
if name.get_surname() == "":
|
if name.get_group_name() == "":
|
||||||
return True
|
return True
|
||||||
return False
|
return False
|
||||||
|
|
||||||
@ -68,7 +68,7 @@ def run(database, document, person):
|
|||||||
rsurname = person
|
rsurname = person
|
||||||
else:
|
else:
|
||||||
surname = sdb.surname(person)
|
surname = sdb.surname(person)
|
||||||
rsurname = person.get_primary_name().get_surname()
|
rsurname = person.get_primary_name().get_group_name()
|
||||||
# display the title
|
# display the title
|
||||||
sdoc.title(_("People with the surname '%s'") % surname)
|
sdoc.title(_("People with the surname '%s'") % surname)
|
||||||
sdoc.paragraph("")
|
sdoc.paragraph("")
|
||||||
|
Loading…
Reference in New Issue
Block a user