insert name keys for indexing

svn: r6817
This commit is contained in:
Brian Matherly 2006-05-30 01:18:41 +00:00
parent fe55f54624
commit 8ebd09eabb
4 changed files with 73 additions and 22 deletions

View File

@ -1,3 +1,8 @@
2006-05-29 Brian Matherly <brian@gramps-project.org>
* src/plugins/DetDescendantReport.py: insert name keys for indexing.
* src/plugins/DetAncestralReport.py: insert name keys for indexing.
* src/plugins/FamilyGroup.py: print descriptions for events.
2006-05-29 Alex Roitman <shura@gramps-project.org> 2006-05-29 Alex Roitman <shura@gramps-project.org>
* src/Editors/_EditFamily.py (EditFamily.save): Typo. * src/Editors/_EditFamily.py (EditFamily.save): Typo.
* configure.in: Set up for 2.1.5. * configure.in: Set up for 2.1.5.

View File

@ -195,9 +195,10 @@ class DetAncestorReport(Report.Report):
self.doc.start_paragraph("DAR-First-Entry","%s." % str(key)) self.doc.start_paragraph("DAR-First-Entry","%s." % str(key))
name = _nd.display_formal(person) name = _nd.display_formal(person)
pkey = ReportUtils.get_person_key(self.database, person)
self.doc.start_bold() self.doc.start_bold()
self.doc.write_text(name) self.doc.write_text(name,pkey)
if name[-1:] == '.': if name[-1:] == '.':
self.doc.write_text(" ") self.doc.write_text(" ")
else: else:
@ -341,19 +342,27 @@ class DetAncestorReport(Report.Report):
if mother_handle: if mother_handle:
mother = self.database.get_person_from_handle(mother_handle) mother = self.database.get_person_from_handle(mother_handle)
mother_name = _nd.display_name(mother.get_primary_name()) mother_name = _nd.display_name(mother.get_primary_name())
mother_key = ReportUtils.get_person_key(self.database, mother)
else: else:
mother_name = "" mother_name = ""
mother_key = ""
if father_handle: if father_handle:
father = self.database.get_person_from_handle(father_handle) father = self.database.get_person_from_handle(father_handle)
father_name = _nd.display_name(father.get_primary_name()) father_name = _nd.display_name(father.get_primary_name())
father_key = ReportUtils.get_person_key(self.database, father)
else: else:
father_name = "" father_name = ""
father_key = ""
text = ReportUtils.child_str(person, father_name, mother_name, text = ReportUtils.child_str(person, father_name, mother_name,
bool(person.get_death_ref()), bool(person.get_death_ref()),
firstName) firstName)
if text: if text:
self.doc.write_text(text) self.doc.write_text(text)
if father_key != "":
self.doc.write_text("",father_key)
if mother_key != "":
self.doc.write_text("",mother_key)
def write_marriage(self, person): def write_marriage(self, person):
""" """
@ -366,6 +375,7 @@ class DetAncestorReport(Report.Report):
spouse = self.database.get_person_from_handle(spouse_handle) spouse = self.database.get_person_from_handle(spouse_handle)
marriage_event = ReportUtils.find_marriage(self.database,family) marriage_event = ReportUtils.find_marriage(self.database,family)
text = "" text = ""
spouse_key = ReportUtils.get_person_key(self.database, spouse)
if marriage_event: if marriage_event:
text = ReportUtils.married_str(self.database,person,spouse, text = ReportUtils.married_str(self.database,person,spouse,
marriage_event,self.endnotes, marriage_event,self.endnotes,
@ -375,7 +385,7 @@ class DetAncestorReport(Report.Report):
text = ReportUtils.married_rel_str(self.database,person,family, text = ReportUtils.married_rel_str(self.database,person,family,
is_first) is_first)
if text: if text:
self.doc.write_text(text) self.doc.write_text(text,spouse_key)
is_first = False is_first = False
def write_children(self, family): def write_children(self, family):
@ -409,6 +419,7 @@ class DetAncestorReport(Report.Report):
child_handle = child_ref.ref child_handle = child_ref.ref
child = self.database.get_person_from_handle(child_handle) child = self.database.get_person_from_handle(child_handle)
child_name = _nd.display(child) child_name = _nd.display(child)
child_key = ReportUtils.get_person_key(self.database,child)
if self.childRef and self.prev_gen_handles.get(child_handle): if self.childRef and self.prev_gen_handles.get(child_handle):
value = str(self.prev_gen_handles.get(child_handle)) value = str(self.prev_gen_handles.get(child_handle))
@ -417,7 +428,7 @@ class DetAncestorReport(Report.Report):
self.doc.start_paragraph("DAR-ChildList",ReportUtils.roman(cnt).lower() + ".") self.doc.start_paragraph("DAR-ChildList",ReportUtils.roman(cnt).lower() + ".")
cnt += 1 cnt += 1
self.doc.write_text("%s. " % child_name) self.doc.write_text("%s. " % child_name,child_key)
self.doc.write_text(ReportUtils.born_str(self.database, child, 0, self.doc.write_text(ReportUtils.born_str(self.database, child, 0,
self.EMPTY_DATE, self.EMPTY_PLACE)) self.EMPTY_DATE, self.EMPTY_PLACE))
self.doc.write_text(ReportUtils.died_str(self.database, child, 0, self.doc.write_text(ReportUtils.died_str(self.database, child, 0,
@ -432,6 +443,7 @@ class DetAncestorReport(Report.Report):
family = self.database.get_family_from_handle(family_handle) family = self.database.get_family_from_handle(family_handle)
person_name = "" person_name = ""
ind_handle = None ind_handle = None
person_key = ""
if mate.get_gender() == RelLib.Person.MALE: if mate.get_gender() == RelLib.Person.MALE:
ind_handle = family.get_mother_handle() ind_handle = family.get_mother_handle()
else: else:
@ -439,6 +451,7 @@ class DetAncestorReport(Report.Report):
if ind_handle: if ind_handle:
ind = self.database.get_person_from_handle(ind_handle) ind = self.database.get_person_from_handle(ind_handle)
person_name = _nd.display(ind) person_name = _nd.display(ind)
person_key = ReportUtils.get_person_key(self.database,ind)
firstName = ReportUtils.common_name(ind,self.usenick) firstName = ReportUtils.common_name(ind,self.usenick)
else: else:
firstName = 0 firstName = 0
@ -446,7 +459,7 @@ class DetAncestorReport(Report.Report):
if person_name: if person_name:
self.doc.start_paragraph("DAR-Entry") self.doc.start_paragraph("DAR-Entry")
self.doc.write_text(person_name) self.doc.write_text(person_name,person_key)
text = ReportUtils.born_str(self.database,ind,"", text = ReportUtils.born_str(self.database,ind,"",
self.EMPTY_DATE,self.EMPTY_PLACE) self.EMPTY_DATE,self.EMPTY_PLACE)

View File

@ -226,9 +226,10 @@ class DetDescendantReport(Report.Report):
self.doc.start_paragraph("DDR-First-Entry","%s." % val) self.doc.start_paragraph("DDR-First-Entry","%s." % val)
name = _nd.display_formal(person) name = _nd.display_formal(person)
pkey = ReportUtils.get_person_key(self.database, person)
self.doc.start_bold() self.doc.start_bold()
self.doc.write_text(name) self.doc.write_text(name,pkey)
if name[-1:] == '.': if name[-1:] == '.':
self.doc.write_text(" ") self.doc.write_text(" ")
else: else:
@ -369,19 +370,27 @@ class DetDescendantReport(Report.Report):
if mother_handle: if mother_handle:
mother = self.database.get_person_from_handle(mother_handle) mother = self.database.get_person_from_handle(mother_handle)
mother_name = _nd.display_name(mother.get_primary_name()) mother_name = _nd.display_name(mother.get_primary_name())
mother_key = ReportUtils.get_person_key(self.database, mother)
else: else:
mother_name = "" mother_name = ""
mother_key = ""
if father_handle: if father_handle:
father = self.database.get_person_from_handle(father_handle) father = self.database.get_person_from_handle(father_handle)
father_name = _nd.display_name(father.get_primary_name()) father_name = _nd.display_name(father.get_primary_name())
father_key = ReportUtils.get_person_key(self.database, father)
else: else:
father_name = "" father_name = ""
father_key = ""
text = ReportUtils.child_str(person, father_name, mother_name, text = ReportUtils.child_str(person, father_name, mother_name,
bool(person.get_death_ref()), bool(person.get_death_ref()),
firstName) firstName)
if text: if text:
self.doc.write_text(text) self.doc.write_text(text)
if father_key != "":
self.doc.write_text("",father_key)
if mother_key != "":
self.doc.write_text("",mother_key)
def write_marriage(self, person): def write_marriage(self, person):
""" """
@ -394,6 +403,7 @@ class DetDescendantReport(Report.Report):
spouse = self.database.get_person_from_handle(spouse_handle) spouse = self.database.get_person_from_handle(spouse_handle)
marriage_event = ReportUtils.find_marriage(self.database,family) marriage_event = ReportUtils.find_marriage(self.database,family)
text = "" text = ""
spouse_key = ReportUtils.get_person_key(self.database, spouse)
if marriage_event: if marriage_event:
text = ReportUtils.married_str(self.database,person,spouse, text = ReportUtils.married_str(self.database,person,spouse,
marriage_event,self.endnotes, marriage_event,self.endnotes,
@ -403,7 +413,7 @@ class DetDescendantReport(Report.Report):
text = ReportUtils.married_rel_str(self.database,person,family, text = ReportUtils.married_rel_str(self.database,person,family,
is_first) is_first)
if text: if text:
self.doc.write_text(text) self.doc.write_text(text,spouse_key)
is_first = False is_first = False
def write_children(self, family): def write_children(self, family):
@ -437,6 +447,7 @@ class DetDescendantReport(Report.Report):
child_handle = child_ref.ref child_handle = child_ref.ref
child = self.database.get_person_from_handle(child_handle) child = self.database.get_person_from_handle(child_handle)
child_name = _nd.display(child) child_name = _nd.display(child)
child_key = ReportUtils.get_person_key(self.database,child)
if self.childRef and self.prev_gen_handles.get(child_handle): if self.childRef and self.prev_gen_handles.get(child_handle):
value = str(self.prev_gen_handles.get(child_handle)) value = str(self.prev_gen_handles.get(child_handle))
@ -448,9 +459,10 @@ class DetDescendantReport(Report.Report):
if self.henry.has_key(child_handle): if self.henry.has_key(child_handle):
self.doc.write_text("%s [%s]. " % (child_name, self.doc.write_text("%s [%s]. " % (child_name,
self.henry[child_handle])) self.henry[child_handle]),
child_key )
else: else:
self.doc.write_text("%s. " % child_name) self.doc.write_text("%s. " % child_name,child_Key)
self.doc.write_text(ReportUtils.born_str( self.doc.write_text(ReportUtils.born_str(
self.database, child, 0, self.EMPTY_DATE, self.EMPTY_PLACE)) self.database, child, 0, self.EMPTY_DATE, self.EMPTY_PLACE))
@ -465,6 +477,7 @@ class DetDescendantReport(Report.Report):
family = self.database.get_family_from_handle(family_handle) family = self.database.get_family_from_handle(family_handle)
person_name = "" person_name = ""
ind_handle = None ind_handle = None
person_key = ""
if mate.get_gender() == RelLib.Person.MALE: if mate.get_gender() == RelLib.Person.MALE:
ind_handle = family.get_mother_handle() ind_handle = family.get_mother_handle()
else: else:
@ -472,6 +485,7 @@ class DetDescendantReport(Report.Report):
if ind_handle: if ind_handle:
ind = self.database.get_person_from_handle(ind_handle) ind = self.database.get_person_from_handle(ind_handle)
person_name = _nd.display(ind) person_name = _nd.display(ind)
person_key = ReportUtils.get_person_key(self.database,ind)
firstName = ReportUtils.common_name(ind,self.usenick) firstName = ReportUtils.common_name(ind,self.usenick)
else: else:
firstName = 0 firstName = 0
@ -479,7 +493,7 @@ class DetDescendantReport(Report.Report):
if person_name: if person_name:
self.doc.start_paragraph("DDR-Entry") self.doc.start_paragraph("DDR-Entry")
self.doc.write_text(person_name) self.doc.write_text(person_name,person_key)
text = ReportUtils.born_str(self.database,ind,"", text = ReportUtils.born_str(self.database,ind,"",
self.EMPTY_DATE,self.EMPTY_PLACE) self.EMPTY_DATE,self.EMPTY_PLACE)

View File

@ -159,28 +159,47 @@ class FamilyGroup(Report.Report):
def dump_parent_event(self,name,event): def dump_parent_event(self,name,event):
place = "" place = ""
date = "" date = ""
descr = ""
if event: if event:
date = DateHandler.get_date(event) date = DateHandler.get_date(event)
place_handle = event.get_place_handle() place_handle = event.get_place_handle()
if place_handle: place = ReportUtils.place_name(self.database,place_handle)
place = self.database.get_place_from_handle(place_handle).get_title() descr = event.get_description()
self.doc.start_row() self.doc.start_row()
self.doc.start_cell("FGR-TextContents") self.doc.start_cell("FGR-TextContents")
self.doc.start_paragraph('FGR-Normal') self.doc.start_paragraph('FGR-Normal')
self.doc.write_text(name) self.doc.write_text(name)
self.doc.end_paragraph() self.doc.end_paragraph()
self.doc.end_cell() self.doc.end_cell()
self.doc.start_cell("FGR-TextContents")
self.doc.start_paragraph('FGR-Normal') if descr:
self.doc.write_text(date) self.doc.start_cell("FGR-TextContents",2)
self.doc.end_paragraph() self.doc.start_paragraph('FGR-Normal')
self.doc.end_cell() self.doc.write_text(descr)
self.doc.start_cell("FGR-TextContentsEnd") self.doc.end_paragraph()
self.doc.start_paragraph('FGR-Normal') self.doc.end_cell()
self.doc.write_text(place) self.doc.end_row()
self.doc.end_paragraph()
self.doc.end_cell() if date or place:
self.doc.end_row() self.doc.start_row()
self.doc.start_cell("FGR-TextContents")
self.doc.start_paragraph('FGR-Normal')
self.doc.end_paragraph()
self.doc.end_cell()
if (date or place) or not descr:
self.doc.start_cell("FGR-TextContents")
self.doc.start_paragraph('FGR-Normal')
self.doc.write_text(date)
self.doc.end_paragraph()
self.doc.end_cell()
self.doc.start_cell("FGR-TextContentsEnd")
self.doc.start_paragraph('FGR-Normal')
self.doc.write_text(place)
self.doc.end_paragraph()
self.doc.end_cell()
self.doc.end_row()
def dump_parent_parents(self,person): def dump_parent_parents(self,person):
family_handle = person.get_main_parents_family_handle() family_handle = person.get_main_parents_family_handle()