insert name keys for indexing
svn: r6814
This commit is contained in:
parent
06d0287301
commit
9fe2e98464
@ -11,6 +11,9 @@
|
|||||||
* src/docgen/*: Add key to write_text.
|
* src/docgen/*: Add key to write_text.
|
||||||
* src/PluginUtils/_ReportUtils.py: Add get_name_key.
|
* src/PluginUtils/_ReportUtils.py: Add get_name_key.
|
||||||
* src/plugins/FamilyGroup.py: insert name keys for indexing.
|
* src/plugins/FamilyGroup.py: insert name keys for indexing.
|
||||||
|
* src/plugins/DescendReport.py: insert name keys for indexing.
|
||||||
|
* src/plugins/IndivComplete.py: insert name keys for indexing.
|
||||||
|
* src/plugins/AncestorReport.py: insert name keys for indexing.
|
||||||
|
|
||||||
2006-05-27 Alex Roitman <shura@gramps-project.org>
|
2006-05-27 Alex Roitman <shura@gramps-project.org>
|
||||||
* src/plugins/Verify.py: More updates.
|
* src/plugins/Verify.py: More updates.
|
||||||
|
@ -117,9 +117,10 @@ class AncestorReport(Report.Report):
|
|||||||
person_handle = self.map[key]
|
person_handle = self.map[key]
|
||||||
person = self.database.get_person_from_handle(person_handle)
|
person = self.database.get_person_from_handle(person_handle)
|
||||||
name = NameDisplay.displayer.display_formal(person)
|
name = NameDisplay.displayer.display_formal(person)
|
||||||
|
nkey = ReportUtils.get_person_key(self.database,person)
|
||||||
|
|
||||||
self.doc.start_bold()
|
self.doc.start_bold()
|
||||||
self.doc.write_text(name.strip())
|
self.doc.write_text(name.strip(),nkey)
|
||||||
self.doc.end_bold()
|
self.doc.end_bold()
|
||||||
if name[-1:] == '.':
|
if name[-1:] == '.':
|
||||||
self.doc.write_text(" ")
|
self.doc.write_text(" ")
|
||||||
|
@ -155,7 +155,8 @@ class DescendantReport(Report.Report):
|
|||||||
def dump(self,level,person):
|
def dump(self,level,person):
|
||||||
|
|
||||||
self.doc.start_paragraph("DR-Level%d" % level,"%d." % level)
|
self.doc.start_paragraph("DR-Level%d" % level,"%d." % level)
|
||||||
self.doc.write_text(NameDisplay.displayer.display(person))
|
key = ReportUtils.get_person_key(self.database,person)
|
||||||
|
self.doc.write_text(NameDisplay.displayer.display(person),key)
|
||||||
self.dump_dates(person)
|
self.dump_dates(person)
|
||||||
self.doc.end_paragraph()
|
self.doc.end_paragraph()
|
||||||
|
|
||||||
@ -168,9 +169,10 @@ class DescendantReport(Report.Report):
|
|||||||
spouse_handle = ReportUtils.find_spouse(person,family)
|
spouse_handle = ReportUtils.find_spouse(person,family)
|
||||||
if spouse_handle:
|
if spouse_handle:
|
||||||
spouse = self.database.get_person_from_handle(spouse_handle)
|
spouse = self.database.get_person_from_handle(spouse_handle)
|
||||||
|
key = ReportUtils.get_person_key(self.database,person)
|
||||||
self.doc.start_paragraph("DR-Spouse%d" % level)
|
self.doc.start_paragraph("DR-Spouse%d" % level)
|
||||||
name = NameDisplay.displayer.display(spouse)
|
name = NameDisplay.displayer.display(spouse)
|
||||||
self.doc.write_text(_("sp. %(spouse)s") % {'spouse':name})
|
self.doc.write_text(_("sp. %(spouse)s") % {'spouse':name},key)
|
||||||
self.dump_dates(spouse)
|
self.dump_dates(spouse)
|
||||||
self.doc.end_paragraph()
|
self.doc.end_paragraph()
|
||||||
|
|
||||||
|
@ -157,13 +157,13 @@ class IndivCompleteReport(Report.Report):
|
|||||||
self.doc.end_cell()
|
self.doc.end_cell()
|
||||||
self.doc.end_row()
|
self.doc.end_row()
|
||||||
|
|
||||||
def write_p_entry(self,label,parent,rel):
|
def write_p_entry(self,label,parent,rel,key=""):
|
||||||
self.doc.start_row()
|
self.doc.start_row()
|
||||||
self.normal_cell(label)
|
self.normal_cell(label)
|
||||||
|
|
||||||
if parent:
|
if parent:
|
||||||
self.normal_cell('%(parent)s, relationship: %(relation)s' %
|
self.normal_cell('%(parent)s, relationship: %(relation)s' %
|
||||||
{ 'parent' : parent, 'relation' : rel })
|
{ 'parent' : parent, 'relation' : rel },key)
|
||||||
else:
|
else:
|
||||||
self.normal_cell('')
|
self.normal_cell('')
|
||||||
self.doc.end_row()
|
self.doc.end_row()
|
||||||
@ -228,7 +228,8 @@ class IndivCompleteReport(Report.Report):
|
|||||||
if father_handle:
|
if father_handle:
|
||||||
father = self.database.get_person_from_handle(father_handle)
|
father = self.database.get_person_from_handle(father_handle)
|
||||||
fname = father.get_primary_name().get_regular_name()
|
fname = father.get_primary_name().get_regular_name()
|
||||||
self.write_p_entry(_('Father'),fname,frel)
|
key = ReportUtils.get_person_key(self.database,father)
|
||||||
|
self.write_p_entry(_('Father'),fname,frel,key)
|
||||||
else:
|
else:
|
||||||
self.write_p_entry(_('Father'),'','')
|
self.write_p_entry(_('Father'),'','')
|
||||||
|
|
||||||
@ -236,7 +237,8 @@ class IndivCompleteReport(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)
|
||||||
fname = mother.get_primary_name().get_regular_name()
|
fname = mother.get_primary_name().get_regular_name()
|
||||||
self.write_p_entry(_('Mother'),fname,frel)
|
key = ReportUtils.get_person_key(self.database,father)
|
||||||
|
self.write_p_entry(_('Mother'),fname,frel,key)
|
||||||
else:
|
else:
|
||||||
self.write_p_entry(_('Mother'),'','')
|
self.write_p_entry(_('Mother'),'','')
|
||||||
|
|
||||||
@ -301,9 +303,11 @@ class IndivCompleteReport(Report.Report):
|
|||||||
if spouse_id:
|
if spouse_id:
|
||||||
spouse = self.database.get_person_from_handle(spouse_id)
|
spouse = self.database.get_person_from_handle(spouse_id)
|
||||||
text = spouse.get_primary_name().get_regular_name()
|
text = spouse.get_primary_name().get_regular_name()
|
||||||
|
key = ReportUtils.get_person_key(self.database,spouse)
|
||||||
else:
|
else:
|
||||||
text = _("unknown")
|
text = _("unknown")
|
||||||
self.doc.write_text(text)
|
key = ""
|
||||||
|
self.doc.write_text(text,key)
|
||||||
self.doc.end_paragraph()
|
self.doc.end_paragraph()
|
||||||
self.doc.end_cell()
|
self.doc.end_cell()
|
||||||
self.doc.end_row()
|
self.doc.end_row()
|
||||||
@ -328,8 +332,9 @@ class IndivCompleteReport(Report.Report):
|
|||||||
else:
|
else:
|
||||||
self.doc.write_text('\n')
|
self.doc.write_text('\n')
|
||||||
child = self.database.get_person_from_handle(child_ref.ref)
|
child = self.database.get_person_from_handle(child_ref.ref)
|
||||||
self.doc.write_text(
|
name = child.get_primary_name().get_regular_name()
|
||||||
child.get_primary_name().get_regular_name())
|
key = ReportUtils.get_person_key(self.database,child)
|
||||||
|
self.doc.write_text(name,key)
|
||||||
self.doc.end_paragraph()
|
self.doc.end_paragraph()
|
||||||
self.doc.end_cell()
|
self.doc.end_cell()
|
||||||
self.doc.end_row()
|
self.doc.end_row()
|
||||||
@ -381,10 +386,10 @@ class IndivCompleteReport(Report.Report):
|
|||||||
self.doc.start_paragraph("IDS-Normal")
|
self.doc.start_paragraph("IDS-Normal")
|
||||||
self.doc.end_paragraph()
|
self.doc.end_paragraph()
|
||||||
|
|
||||||
def normal_cell(self,text):
|
def normal_cell(self,text,key=""):
|
||||||
self.doc.start_cell('IDS-NormalCell')
|
self.doc.start_cell('IDS-NormalCell')
|
||||||
self.doc.start_paragraph('IDS-Normal')
|
self.doc.start_paragraph('IDS-Normal')
|
||||||
self.doc.write_text(text)
|
self.doc.write_text(text,key)
|
||||||
self.doc.end_paragraph()
|
self.doc.end_paragraph()
|
||||||
self.doc.end_cell()
|
self.doc.end_cell()
|
||||||
|
|
||||||
@ -409,8 +414,9 @@ class IndivCompleteReport(Report.Report):
|
|||||||
|
|
||||||
media_list = self.start_person.get_media_list()
|
media_list = self.start_person.get_media_list()
|
||||||
name = self.start_person.get_primary_name().get_regular_name()
|
name = self.start_person.get_primary_name().get_regular_name()
|
||||||
|
key = ReportUtils.get_person_key(self.database,self.start_person)
|
||||||
self.doc.start_paragraph("IDS-Title")
|
self.doc.start_paragraph("IDS-Title")
|
||||||
self.doc.write_text(_("Summary of %s") % name)
|
self.doc.write_text(_("Summary of %s") % name,key)
|
||||||
self.doc.end_paragraph()
|
self.doc.end_paragraph()
|
||||||
|
|
||||||
self.doc.start_paragraph("IDS-Normal")
|
self.doc.start_paragraph("IDS-Normal")
|
||||||
@ -432,13 +438,14 @@ class IndivCompleteReport(Report.Report):
|
|||||||
self.normal_cell("%s:" % _("Name"))
|
self.normal_cell("%s:" % _("Name"))
|
||||||
name = self.start_person.get_primary_name()
|
name = self.start_person.get_primary_name()
|
||||||
text = name.get_regular_name()
|
text = name.get_regular_name()
|
||||||
|
key = ReportUtils.get_person_key(self.database, self.start_person)
|
||||||
if self.use_srcs:
|
if self.use_srcs:
|
||||||
for s in name.get_source_references():
|
for s in name.get_source_references():
|
||||||
self.slist.append(s)
|
self.slist.append(s)
|
||||||
src_handle = s.get_reference_handle()
|
src_handle = s.get_reference_handle()
|
||||||
src = self.database.get_source_from_handle(src_handle)
|
src = self.database.get_source_from_handle(src_handle)
|
||||||
text = "%s [%s]" % (text,src.get_gramps_id())
|
text = "%s [%s]" % (text,src.get_gramps_id())
|
||||||
self.normal_cell(text)
|
self.normal_cell(text,key)
|
||||||
self.doc.end_row()
|
self.doc.end_row()
|
||||||
|
|
||||||
self.doc.start_row()
|
self.doc.start_row()
|
||||||
@ -457,27 +464,33 @@ class IndivCompleteReport(Report.Report):
|
|||||||
father_inst = self.database.get_person_from_handle(
|
father_inst = self.database.get_person_from_handle(
|
||||||
father_inst_id)
|
father_inst_id)
|
||||||
father = father_inst.get_primary_name().get_regular_name()
|
father = father_inst.get_primary_name().get_regular_name()
|
||||||
|
fkey = ReportUtils.get_person_key(self.database,father_inst)
|
||||||
else:
|
else:
|
||||||
father = ""
|
father = ""
|
||||||
|
fkey = ""
|
||||||
mother_inst_id = family.get_mother_handle()
|
mother_inst_id = family.get_mother_handle()
|
||||||
if mother_inst_id:
|
if mother_inst_id:
|
||||||
mother_inst = self.database.get_person_from_handle(
|
mother_inst = self.database.get_person_from_handle(
|
||||||
mother_inst_id)
|
mother_inst_id)
|
||||||
mother = mother_inst.get_primary_name().get_regular_name()
|
mother = mother_inst.get_primary_name().get_regular_name()
|
||||||
|
mkey = ReportUtils.get_person_key(self.database,mother_inst)
|
||||||
else:
|
else:
|
||||||
mother = ""
|
mother = ""
|
||||||
|
mkey = ""
|
||||||
else:
|
else:
|
||||||
father = ""
|
father = ""
|
||||||
|
fkey = ""
|
||||||
mother = ""
|
mother = ""
|
||||||
|
mkey = ""
|
||||||
|
|
||||||
self.doc.start_row()
|
self.doc.start_row()
|
||||||
self.normal_cell("%s:" % _("Father"))
|
self.normal_cell("%s:" % _("Father"))
|
||||||
self.normal_cell(father)
|
self.normal_cell(father,fkey)
|
||||||
self.doc.end_row()
|
self.doc.end_row()
|
||||||
|
|
||||||
self.doc.start_row()
|
self.doc.start_row()
|
||||||
self.normal_cell("%s:" % _("Mother"))
|
self.normal_cell("%s:" % _("Mother"))
|
||||||
self.normal_cell(mother)
|
self.normal_cell(mother,mkey)
|
||||||
self.doc.end_row()
|
self.doc.end_row()
|
||||||
self.doc.end_table()
|
self.doc.end_table()
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user