various: enhance indexing with IndexMark
svn: r6850
This commit is contained in:
parent
20aa297a21
commit
0c008ceb78
11
ChangeLog
11
ChangeLog
@ -1,3 +1,14 @@
|
||||
2006-06-02 Brian Matherly <brian@gramps-project.org>
|
||||
* src/docgen/*: use IndexMark
|
||||
* src/plugins/DetDecendantReport: use IndexMark
|
||||
* src/plugins/AncestorReport.py: use IndexMark
|
||||
* src/plugins/DetAncestralReport.py: use IndexMark
|
||||
* src/plugins/DecendReport.py: use IndexMark
|
||||
* src/plugins/IndivComplete.py: use IndexMark
|
||||
* src/plugins/FamilyGroup.py: use IndexMark
|
||||
* src/BaseDoc.py: add IndexMark
|
||||
* src/ReportBase.py: get_person_index -> get_person_mark
|
||||
|
||||
2006-06-02 Don Allingham <don@gramps-project.org>
|
||||
* src/FilterEditor/_EditFilter.py: clean up
|
||||
* src/FilterEditor/_EditRule.py: clean up
|
||||
|
@ -138,6 +138,14 @@ GRAPHICS_MODE = 1
|
||||
SOLID = 0
|
||||
DASHED = 1
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
# IndexMark types
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
INDEX_TYPE_ALP = 0
|
||||
INDEX_TYPE_TOC = 1
|
||||
|
||||
#------------------------------------------------------------------------
|
||||
#
|
||||
# cnv2color
|
||||
@ -1144,6 +1152,22 @@ class GraphicsStyle:
|
||||
def get_fill_color(self):
|
||||
return self.fill_color
|
||||
|
||||
#------------------------------------------------------------------------
|
||||
#
|
||||
# IndexMark
|
||||
#
|
||||
#------------------------------------------------------------------------
|
||||
class IndexMark:
|
||||
"""
|
||||
Defines a mark to be associated with text for indexing.
|
||||
"""
|
||||
def __init__(self, key="", type=INDEX_TYPE_ALP):
|
||||
"""
|
||||
Initialize the object with default values, unless values are specified.
|
||||
"""
|
||||
self.type = type
|
||||
self.key = key
|
||||
|
||||
#------------------------------------------------------------------------
|
||||
#
|
||||
# BaseDoc
|
||||
@ -1409,13 +1433,13 @@ class BaseDoc:
|
||||
"""
|
||||
pass
|
||||
|
||||
def write_text(self, text, key=""):
|
||||
def write_text(self, text, mark=None):
|
||||
"""
|
||||
Writes the text in the current paragraph. Should only be used after a
|
||||
start_paragraph and before an end_paragraph.
|
||||
|
||||
@param text: text to write.
|
||||
@param key: key to use for indexing (if supported)
|
||||
@param mark: IndexMark to use for indexing (if supported)
|
||||
"""
|
||||
pass
|
||||
|
||||
|
@ -43,6 +43,7 @@ import DateHandler
|
||||
import RelLib
|
||||
from NameDisplay import displayer as _nd
|
||||
from QuestionDialog import WarningDialog
|
||||
import BaseDoc
|
||||
|
||||
#------------------------------------------------------------------------
|
||||
#
|
||||
@ -2202,15 +2203,15 @@ def common_name(person,use_nick=False):
|
||||
# Indexing function
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
def get_person_key(db,person):
|
||||
def get_person_mark(db,person):
|
||||
"""
|
||||
Returns a key that can be used to index a person in a report
|
||||
Returns a IndexMark that can be used to index a person in a report
|
||||
|
||||
@param db: the GRAMPS database instance
|
||||
@param person: the the key is for
|
||||
"""
|
||||
if not person:
|
||||
return ""
|
||||
return None
|
||||
|
||||
name = person.get_primary_name().get_name()
|
||||
birth = " "
|
||||
@ -2232,4 +2233,4 @@ def get_person_key(db,person):
|
||||
else:
|
||||
key = "%s (%s - %s)" % (name,birth,death)
|
||||
|
||||
return key
|
||||
return BaseDoc.IndexMark( key, BaseDoc.INDEX_TYPE_ALP )
|
||||
|
@ -265,7 +265,7 @@ class AbiWordDoc(BaseDoc.BaseDoc):
|
||||
self.write_text(line)
|
||||
self.end_paragraph()
|
||||
|
||||
def write_text(self,text,key=""):
|
||||
def write_text(self,text,mark=None):
|
||||
text = text.replace('&','&'); # Must be first
|
||||
text = text.replace('<','<');
|
||||
text = text.replace('>','>');
|
||||
|
@ -369,7 +369,7 @@ class AsciiDoc(BaseDoc.BaseDoc):
|
||||
#
|
||||
# Writes text.
|
||||
#--------------------------------------------------------------------
|
||||
def write_text(self,text,key=""):
|
||||
def write_text(self,text,mark=None):
|
||||
text = text.replace('<super>','[')
|
||||
text = text.replace('</super>',']')
|
||||
self.text = self.text + text
|
||||
|
@ -480,7 +480,7 @@ class HtmlDoc(BaseDoc.BaseDoc):
|
||||
self.write_text(line.strip().replace('\n',' '))
|
||||
self.end_paragraph()
|
||||
|
||||
def write_text(self,text,key=""):
|
||||
def write_text(self,text,mark=None):
|
||||
text = text.replace('&','&'); # Must be first
|
||||
text = text.replace('<','<');
|
||||
text = text.replace('>','>');
|
||||
|
@ -482,7 +482,7 @@ class KwordDoc(BaseDoc.BaseDoc):
|
||||
self.write_text(line)
|
||||
self.end_paragraph()
|
||||
|
||||
def write_text(self,text,key=""):
|
||||
def write_text(self,text,mark=None):
|
||||
text = text.replace('&','&'); # Must be first
|
||||
text = text.replace('<','<');
|
||||
text = text.replace('>','>');
|
||||
|
@ -778,7 +778,7 @@ class LPRDoc(BaseDoc.BaseDoc):
|
||||
y = y - height
|
||||
return (x,y)
|
||||
|
||||
def write_text(self,text,key=""):
|
||||
def write_text(self,text,mark=None):
|
||||
"""Add the text to the paragraph"""
|
||||
self.brand_new_page = 0
|
||||
# Take care of superscript tags
|
||||
|
@ -484,7 +484,7 @@ class LaTeXDoc(BaseDoc.BaseDoc):
|
||||
self.f.write('\\end{verbatim}')
|
||||
self.end_paragraph()
|
||||
|
||||
def write_text(self,text,key=""):
|
||||
def write_text(self,text,mark=None):
|
||||
"""Write the text to the file"""
|
||||
if text == '\n':
|
||||
text = '\\newline\n'
|
||||
|
@ -824,16 +824,19 @@ class ODFDoc(BaseDoc.BaseDoc):
|
||||
self.write_text(line)
|
||||
self.end_paragraph()
|
||||
|
||||
def write_text(self,text,key=""):
|
||||
def write_text(self,text,mark=None):
|
||||
"""
|
||||
Uses the xml.sax.saxutils.escape function to convert XML
|
||||
entities. The _esc_map dictionary allows us to add our own
|
||||
mappings.
|
||||
"""
|
||||
if key != "":
|
||||
key = escape(key,_esc_map)
|
||||
if mark:
|
||||
key = escape(mark.key,_esc_map)
|
||||
key = key.replace('"','"')
|
||||
self.cntnt.write('<text:alphabetical-index-mark ')
|
||||
if mark.type == BaseDoc.INDEX_TYPE_ALP:
|
||||
self.cntnt.write('<text:alphabetical-index-mark ')
|
||||
elif mark.type == BaseDoc.INDEX_TYPE_TOC:
|
||||
self.cntnt.write('<text:toc-mark ')
|
||||
self.cntnt.write('text:string-value="%s" />' % key)
|
||||
self.cntnt.write(escape(text,_esc_map))
|
||||
|
||||
|
@ -395,7 +395,7 @@ class ODSDoc(SpreadSheetDoc):
|
||||
def end_page(self):
|
||||
self.f.write('</table:table>\n')
|
||||
|
||||
def write_text(self,text,key=""):
|
||||
def write_text(self,text,mark=None):
|
||||
if text == "":
|
||||
return
|
||||
if self.content == 0:
|
||||
|
@ -727,17 +727,19 @@ class OpenOfficeDoc(BaseDoc.BaseDoc):
|
||||
self.write_text(line)
|
||||
self.end_paragraph()
|
||||
|
||||
def write_text(self,text,key=""):
|
||||
def write_text(self,text,mark=None):
|
||||
"""
|
||||
Uses the xml.sax.saxutils.escape function to convert XML
|
||||
entities. The _esc_map dictionary allows us to add our own
|
||||
mappings.
|
||||
"""
|
||||
|
||||
if key != "":
|
||||
key = escape(key,_esc_map)
|
||||
if mark:
|
||||
key = escape(mark.key,_esc_map)
|
||||
key = key.replace('"','"')
|
||||
self.cntnt.write('<text:alphabetical-index-mark ')
|
||||
if mark.type == BaseDoc.INDEX_TYPE_ALP:
|
||||
self.cntnt.write('<text:alphabetical-index-mark ')
|
||||
elif mark.type == BaseDoc.INDEX_TYPE_TOC:
|
||||
self.cntnt.write('<text:toc-mark ')
|
||||
self.cntnt.write('text:string-value="%s" />' % key)
|
||||
self.cntnt.write(escape(text,_esc_map))
|
||||
|
||||
|
@ -381,7 +381,7 @@ class OpenSpreadSheet(SpreadSheetDoc):
|
||||
def end_page(self):
|
||||
self.f.write('</table:table>\n')
|
||||
|
||||
def write_text(self,text,key=""):
|
||||
def write_text(self,text,mark=None):
|
||||
if text == "":
|
||||
return
|
||||
if self.content == 0:
|
||||
|
@ -139,7 +139,7 @@ class PSDrawDoc(BaseDoc.BaseDoc):
|
||||
if self.print_req:
|
||||
Report.run_print_dialog (self.filename)
|
||||
|
||||
def write_text(self,text,key=""):
|
||||
def write_text(self,text,mark=None):
|
||||
pass
|
||||
|
||||
def start_page(self):
|
||||
|
@ -403,7 +403,7 @@ class PdfDoc(BaseDoc.BaseDoc):
|
||||
else:
|
||||
self.story.append(Paragraph(line,current_para))
|
||||
|
||||
def write_text(self,text,key=""):
|
||||
def write_text(self,text,mark=None):
|
||||
text = text.replace('&','&') # Must be first
|
||||
text = text.replace('<','<')
|
||||
text = text.replace('>','>')
|
||||
|
@ -401,7 +401,7 @@ class RTFDoc(BaseDoc.BaseDoc):
|
||||
# the form of \`XX. Make sure to escape braces.
|
||||
#
|
||||
#--------------------------------------------------------------------
|
||||
def write_text(self,text,key=""):
|
||||
def write_text(self,text,mark=None):
|
||||
if self.opened == 0:
|
||||
self.opened = 1
|
||||
self.text = self.text + '{%s ' % self.font_type
|
||||
|
@ -112,5 +112,5 @@ class SpreadSheetDoc:
|
||||
def end_cell(self):
|
||||
pass
|
||||
|
||||
def write_text(self,text,key=""):
|
||||
def write_text(self,text,mark=None):
|
||||
pass
|
||||
|
@ -119,10 +119,10 @@ class AncestorReport(Report):
|
||||
person_handle = self.map[key]
|
||||
person = self.database.get_person_from_handle(person_handle)
|
||||
name = NameDisplay.displayer.display_formal(person)
|
||||
nkey = ReportUtils.get_person_key(self.database,person)
|
||||
mark = ReportUtils.get_person_mark(self.database,person)
|
||||
|
||||
self.doc.start_bold()
|
||||
self.doc.write_text(name.strip(),nkey)
|
||||
self.doc.write_text(name.strip(),mark)
|
||||
self.doc.end_bold()
|
||||
if name[-1:] == '.':
|
||||
self.doc.write_text(" ")
|
||||
|
@ -157,8 +157,8 @@ class DescendantReport(Report):
|
||||
def dump(self,level,person):
|
||||
|
||||
self.doc.start_paragraph("DR-Level%d" % level,"%d." % level)
|
||||
key = ReportUtils.get_person_key(self.database,person)
|
||||
self.doc.write_text(NameDisplay.displayer.display(person),key)
|
||||
mark = ReportUtils.get_person_mark(self.database,person)
|
||||
self.doc.write_text(NameDisplay.displayer.display(person),mark)
|
||||
self.dump_dates(person)
|
||||
self.doc.end_paragraph()
|
||||
|
||||
@ -171,10 +171,10 @@ class DescendantReport(Report):
|
||||
spouse_handle = ReportUtils.find_spouse(person,family)
|
||||
if spouse_handle:
|
||||
spouse = self.database.get_person_from_handle(spouse_handle)
|
||||
key = ReportUtils.get_person_key(self.database,person)
|
||||
mark = ReportUtils.get_person_mark(self.database,person)
|
||||
self.doc.start_paragraph("DR-Spouse%d" % level)
|
||||
name = NameDisplay.displayer.display(spouse)
|
||||
self.doc.write_text(_("sp. %(spouse)s") % {'spouse':name},key)
|
||||
self.doc.write_text(_("sp. %(spouse)s") % {'spouse':name},mark)
|
||||
self.dump_dates(spouse)
|
||||
self.doc.end_paragraph()
|
||||
|
||||
|
@ -198,10 +198,10 @@ class DetAncestorReport(Report):
|
||||
self.doc.start_paragraph("DAR-First-Entry","%s." % str(key))
|
||||
|
||||
name = _nd.display_formal(person)
|
||||
pkey = ReportUtils.get_person_key(self.database, person)
|
||||
mark = ReportUtils.get_person_mark(self.database, person)
|
||||
|
||||
self.doc.start_bold()
|
||||
self.doc.write_text(name,pkey)
|
||||
self.doc.write_text(name,mark)
|
||||
if name[-1:] == '.':
|
||||
self.doc.write_text(" ")
|
||||
else:
|
||||
@ -345,27 +345,27 @@ class DetAncestorReport(Report):
|
||||
if mother_handle:
|
||||
mother = self.database.get_person_from_handle(mother_handle)
|
||||
mother_name = _nd.display_name(mother.get_primary_name())
|
||||
mother_key = ReportUtils.get_person_key(self.database, mother)
|
||||
mother_mark = ReportUtils.get_person_mark(self.database, mother)
|
||||
else:
|
||||
mother_name = ""
|
||||
mother_key = ""
|
||||
mother_mark = ""
|
||||
if father_handle:
|
||||
father = self.database.get_person_from_handle(father_handle)
|
||||
father_name = _nd.display_name(father.get_primary_name())
|
||||
father_key = ReportUtils.get_person_key(self.database, father)
|
||||
father_mark = ReportUtils.get_person_mark(self.database, father)
|
||||
else:
|
||||
father_name = ""
|
||||
father_key = ""
|
||||
father_mark = ""
|
||||
|
||||
text = ReportUtils.child_str(person, father_name, mother_name,
|
||||
bool(person.get_death_ref()),
|
||||
firstName)
|
||||
if text:
|
||||
self.doc.write_text(text)
|
||||
if father_key != "":
|
||||
self.doc.write_text("",father_key)
|
||||
if mother_key != "":
|
||||
self.doc.write_text("",mother_key)
|
||||
if father_mark:
|
||||
self.doc.write_text("",father_mark)
|
||||
if mother_mark:
|
||||
self.doc.write_text("",mother_mark)
|
||||
|
||||
def write_marriage(self, person):
|
||||
"""
|
||||
@ -378,7 +378,7 @@ class DetAncestorReport(Report):
|
||||
spouse = self.database.get_person_from_handle(spouse_handle)
|
||||
marriage_event = ReportUtils.find_marriage(self.database,family)
|
||||
text = ""
|
||||
spouse_key = ReportUtils.get_person_key(self.database, spouse)
|
||||
spouse_mark = ReportUtils.get_person_mark(self.database, spouse)
|
||||
if marriage_event:
|
||||
text = ReportUtils.married_str(self.database,person,spouse,
|
||||
marriage_event,self.endnotes,
|
||||
@ -388,7 +388,7 @@ class DetAncestorReport(Report):
|
||||
text = ReportUtils.married_rel_str(self.database,person,family,
|
||||
is_first)
|
||||
if text:
|
||||
self.doc.write_text(text,spouse_key)
|
||||
self.doc.write_text(text,spouse_mark)
|
||||
is_first = False
|
||||
|
||||
def write_children(self, family):
|
||||
@ -422,7 +422,7 @@ class DetAncestorReport(Report):
|
||||
child_handle = child_ref.ref
|
||||
child = self.database.get_person_from_handle(child_handle)
|
||||
child_name = _nd.display(child)
|
||||
child_key = ReportUtils.get_person_key(self.database,child)
|
||||
child_mark = ReportUtils.get_person_mark(self.database,child)
|
||||
|
||||
if self.childRef and self.prev_gen_handles.get(child_handle):
|
||||
value = str(self.prev_gen_handles.get(child_handle))
|
||||
@ -431,7 +431,7 @@ class DetAncestorReport(Report):
|
||||
self.doc.start_paragraph("DAR-ChildList",ReportUtils.roman(cnt).lower() + ".")
|
||||
cnt += 1
|
||||
|
||||
self.doc.write_text("%s. " % child_name,child_key)
|
||||
self.doc.write_text("%s. " % child_name,child_mark)
|
||||
self.doc.write_text(ReportUtils.born_str(self.database, child, 0,
|
||||
self.EMPTY_DATE, self.EMPTY_PLACE))
|
||||
self.doc.write_text(ReportUtils.died_str(self.database, child, 0,
|
||||
@ -454,7 +454,7 @@ class DetAncestorReport(Report):
|
||||
if ind_handle:
|
||||
ind = self.database.get_person_from_handle(ind_handle)
|
||||
person_name = _nd.display(ind)
|
||||
person_key = ReportUtils.get_person_key(self.database,ind)
|
||||
person_mark = ReportUtils.get_person_mark(self.database,ind)
|
||||
firstName = ReportUtils.common_name(ind,self.usenick)
|
||||
else:
|
||||
firstName = 0
|
||||
|
@ -228,10 +228,10 @@ class DetDescendantReport(Report):
|
||||
self.doc.start_paragraph("DDR-First-Entry","%s." % val)
|
||||
|
||||
name = _nd.display_formal(person)
|
||||
pkey = ReportUtils.get_person_key(self.database, person)
|
||||
mark = ReportUtils.get_person_mark(self.database, person)
|
||||
|
||||
self.doc.start_bold()
|
||||
self.doc.write_text(name,pkey)
|
||||
self.doc.write_text(name,mark)
|
||||
if name[-1:] == '.':
|
||||
self.doc.write_text(" ")
|
||||
else:
|
||||
@ -372,27 +372,27 @@ class DetDescendantReport(Report):
|
||||
if mother_handle:
|
||||
mother = self.database.get_person_from_handle(mother_handle)
|
||||
mother_name = _nd.display_name(mother.get_primary_name())
|
||||
mother_key = ReportUtils.get_person_key(self.database, mother)
|
||||
mother_mark = ReportUtils.get_person_mark(self.database, mother)
|
||||
else:
|
||||
mother_name = ""
|
||||
mother_key = ""
|
||||
mother_mark = ""
|
||||
if father_handle:
|
||||
father = self.database.get_person_from_handle(father_handle)
|
||||
father_name = _nd.display_name(father.get_primary_name())
|
||||
father_key = ReportUtils.get_person_key(self.database, father)
|
||||
father_mark = ReportUtils.get_person_mark(self.database, father)
|
||||
else:
|
||||
father_name = ""
|
||||
father_key = ""
|
||||
father_mark = ""
|
||||
|
||||
text = ReportUtils.child_str(person, father_name, mother_name,
|
||||
bool(person.get_death_ref()),
|
||||
firstName)
|
||||
if text:
|
||||
self.doc.write_text(text)
|
||||
if father_key != "":
|
||||
self.doc.write_text("",father_key)
|
||||
if mother_key != "":
|
||||
self.doc.write_text("",mother_key)
|
||||
if father_mark:
|
||||
self.doc.write_text("",father_mark)
|
||||
if mother_mark:
|
||||
self.doc.write_text("",mother_mark)
|
||||
|
||||
def write_marriage(self, person):
|
||||
"""
|
||||
@ -405,7 +405,7 @@ class DetDescendantReport(Report):
|
||||
spouse = self.database.get_person_from_handle(spouse_handle)
|
||||
marriage_event = ReportUtils.find_marriage(self.database,family)
|
||||
text = ""
|
||||
spouse_key = ReportUtils.get_person_key(self.database, spouse)
|
||||
spouse_mark = ReportUtils.get_person_mark(self.database, spouse)
|
||||
if marriage_event:
|
||||
text = ReportUtils.married_str(self.database,person,spouse,
|
||||
marriage_event,self.endnotes,
|
||||
@ -415,7 +415,7 @@ class DetDescendantReport(Report):
|
||||
text = ReportUtils.married_rel_str(self.database,person,family,
|
||||
is_first)
|
||||
if text:
|
||||
self.doc.write_text(text,spouse_key)
|
||||
self.doc.write_text(text,spouse_mark)
|
||||
is_first = False
|
||||
|
||||
def write_children(self, family):
|
||||
@ -449,7 +449,7 @@ class DetDescendantReport(Report):
|
||||
child_handle = child_ref.ref
|
||||
child = self.database.get_person_from_handle(child_handle)
|
||||
child_name = _nd.display(child)
|
||||
child_key = ReportUtils.get_person_key(self.database,child)
|
||||
child_mark = ReportUtils.get_person_mark(self.database,child)
|
||||
|
||||
if self.childRef and self.prev_gen_handles.get(child_handle):
|
||||
value = str(self.prev_gen_handles.get(child_handle))
|
||||
@ -462,9 +462,9 @@ class DetDescendantReport(Report):
|
||||
if self.henry.has_key(child_handle):
|
||||
self.doc.write_text("%s [%s]. " % (child_name,
|
||||
self.henry[child_handle]),
|
||||
child_key )
|
||||
child_mark )
|
||||
else:
|
||||
self.doc.write_text("%s. " % child_name,child_Key)
|
||||
self.doc.write_text("%s. " % child_name,child_mark)
|
||||
|
||||
self.doc.write_text(ReportUtils.born_str(
|
||||
self.database, child, 0, self.EMPTY_DATE, self.EMPTY_PLACE))
|
||||
@ -479,7 +479,7 @@ class DetDescendantReport(Report):
|
||||
family = self.database.get_family_from_handle(family_handle)
|
||||
person_name = ""
|
||||
ind_handle = None
|
||||
person_key = ""
|
||||
person_mark = None
|
||||
if mate.get_gender() == RelLib.Person.MALE:
|
||||
ind_handle = family.get_mother_handle()
|
||||
else:
|
||||
@ -487,7 +487,7 @@ class DetDescendantReport(Report):
|
||||
if ind_handle:
|
||||
ind = self.database.get_person_from_handle(ind_handle)
|
||||
person_name = _nd.display(ind)
|
||||
person_key = ReportUtils.get_person_key(self.database,ind)
|
||||
person_mark = ReportUtils.get_person_mark(self.database,ind)
|
||||
firstName = ReportUtils.common_name(ind,self.usenick)
|
||||
else:
|
||||
firstName = 0
|
||||
@ -495,7 +495,7 @@ class DetDescendantReport(Report):
|
||||
if person_name:
|
||||
self.doc.start_paragraph("DDR-Entry")
|
||||
|
||||
self.doc.write_text(person_name,person_key)
|
||||
self.doc.write_text(person_name,person_mark)
|
||||
|
||||
text = ReportUtils.born_str(self.database,ind,"",
|
||||
self.EMPTY_DATE,self.EMPTY_PLACE)
|
||||
|
@ -253,8 +253,8 @@ class FamilyGroup(Report):
|
||||
self.doc.end_cell()
|
||||
self.doc.start_cell("FGR-TextContentsEnd",2)
|
||||
self.doc.start_paragraph('FGR-Normal')
|
||||
key = ReportUtils.get_person_key(self.database,father)
|
||||
self.doc.write_text(father_name,key)
|
||||
mark = ReportUtils.get_person_mark(self.database,father)
|
||||
self.doc.write_text(father_name,mark)
|
||||
self.doc.end_paragraph()
|
||||
self.doc.end_cell()
|
||||
self.doc.end_row()
|
||||
@ -270,8 +270,8 @@ class FamilyGroup(Report):
|
||||
self.doc.end_cell()
|
||||
self.doc.start_cell("FGR-TextContentsEnd",2)
|
||||
self.doc.start_paragraph('FGR-Normal')
|
||||
key = ReportUtils.get_person_key(self.database,mother)
|
||||
self.doc.write_text(mother_name,key)
|
||||
mark = ReportUtils.get_person_mark(self.database,mother)
|
||||
self.doc.write_text(mother_name,mark)
|
||||
self.doc.end_paragraph()
|
||||
self.doc.end_cell()
|
||||
self.doc.end_row()
|
||||
@ -307,8 +307,8 @@ class FamilyGroup(Report):
|
||||
self.doc.start_cell('FGR-ParentHead',3)
|
||||
self.doc.start_paragraph('FGR-ParentName')
|
||||
self.doc.write_text(title + ': ')
|
||||
key = ReportUtils.get_person_key(self.database,person)
|
||||
self.doc.write_text(name,key)
|
||||
mark = ReportUtils.get_person_mark(self.database,person)
|
||||
self.doc.write_text(name,mark)
|
||||
self.doc.end_paragraph()
|
||||
self.doc.end_cell()
|
||||
self.doc.end_row()
|
||||
@ -518,10 +518,10 @@ class FamilyGroup(Report):
|
||||
self.doc.end_cell()
|
||||
|
||||
name = person.get_primary_name().get_regular_name()
|
||||
key = ReportUtils.get_person_key(self.database,person)
|
||||
mark = ReportUtils.get_person_mark(self.database,person)
|
||||
self.doc.start_cell('FGR-ChildName',3)
|
||||
self.doc.start_paragraph('FGR-ChildText')
|
||||
self.doc.write_text(name,key)
|
||||
self.doc.write_text(name,mark)
|
||||
self.doc.end_paragraph()
|
||||
self.doc.end_cell()
|
||||
self.doc.end_row()
|
||||
@ -591,8 +591,8 @@ class FamilyGroup(Report):
|
||||
death = DateHandler.get_date(event)
|
||||
if birth_ref or death_ref:
|
||||
spouse_name = "%s (%s - %s)" % (spouse_name,birth,death)
|
||||
key = ReportUtils.get_person_key(self.database,spouse)
|
||||
self.doc.write_text(spouse_name,key)
|
||||
mark = ReportUtils.get_person_mark(self.database,spouse)
|
||||
self.doc.write_text(spouse_name,mark)
|
||||
self.doc.end_paragraph()
|
||||
self.doc.end_cell()
|
||||
self.doc.end_row()
|
||||
|
@ -159,13 +159,13 @@ class IndivCompleteReport(Report):
|
||||
self.doc.end_cell()
|
||||
self.doc.end_row()
|
||||
|
||||
def write_p_entry(self,label,parent,rel,key=""):
|
||||
def write_p_entry(self,label,parent,rel,mark=None):
|
||||
self.doc.start_row()
|
||||
self.normal_cell(label)
|
||||
|
||||
if parent:
|
||||
self.normal_cell('%(parent)s, relationship: %(relation)s' %
|
||||
{ 'parent' : parent, 'relation' : rel },key)
|
||||
{ 'parent' : parent, 'relation' : rel },mark)
|
||||
else:
|
||||
self.normal_cell('')
|
||||
self.doc.end_row()
|
||||
@ -230,8 +230,8 @@ class IndivCompleteReport(Report):
|
||||
if father_handle:
|
||||
father = self.database.get_person_from_handle(father_handle)
|
||||
fname = father.get_primary_name().get_regular_name()
|
||||
key = ReportUtils.get_person_key(self.database,father)
|
||||
self.write_p_entry(_('Father'),fname,frel,key)
|
||||
mark = ReportUtils.get_person_mark(self.database,father)
|
||||
self.write_p_entry(_('Father'),fname,frel,mark)
|
||||
else:
|
||||
self.write_p_entry(_('Father'),'','')
|
||||
|
||||
@ -239,8 +239,8 @@ class IndivCompleteReport(Report):
|
||||
if mother_handle:
|
||||
mother = self.database.get_person_from_handle(mother_handle)
|
||||
fname = mother.get_primary_name().get_regular_name()
|
||||
key = ReportUtils.get_person_key(self.database,father)
|
||||
self.write_p_entry(_('Mother'),fname,frel,key)
|
||||
mark = ReportUtils.get_person_mark(self.database,father)
|
||||
self.write_p_entry(_('Mother'),fname,frel,mark)
|
||||
else:
|
||||
self.write_p_entry(_('Mother'),'','')
|
||||
|
||||
@ -305,11 +305,11 @@ class IndivCompleteReport(Report):
|
||||
if spouse_id:
|
||||
spouse = self.database.get_person_from_handle(spouse_id)
|
||||
text = spouse.get_primary_name().get_regular_name()
|
||||
key = ReportUtils.get_person_key(self.database,spouse)
|
||||
mark = ReportUtils.get_person_mark(self.database,spouse)
|
||||
else:
|
||||
text = _("unknown")
|
||||
key = ""
|
||||
self.doc.write_text(text,key)
|
||||
mark = None
|
||||
self.doc.write_text(text,mark)
|
||||
self.doc.end_paragraph()
|
||||
self.doc.end_cell()
|
||||
self.doc.end_row()
|
||||
@ -335,8 +335,8 @@ class IndivCompleteReport(Report):
|
||||
self.doc.write_text('\n')
|
||||
child = self.database.get_person_from_handle(child_ref.ref)
|
||||
name = child.get_primary_name().get_regular_name()
|
||||
key = ReportUtils.get_person_key(self.database,child)
|
||||
self.doc.write_text(name,key)
|
||||
mark = ReportUtils.get_person_mark(self.database,child)
|
||||
self.doc.write_text(name,mark)
|
||||
self.doc.end_paragraph()
|
||||
self.doc.end_cell()
|
||||
self.doc.end_row()
|
||||
@ -388,10 +388,10 @@ class IndivCompleteReport(Report):
|
||||
self.doc.start_paragraph("IDS-Normal")
|
||||
self.doc.end_paragraph()
|
||||
|
||||
def normal_cell(self,text,key=""):
|
||||
def normal_cell(self,text,mark=None):
|
||||
self.doc.start_cell('IDS-NormalCell')
|
||||
self.doc.start_paragraph('IDS-Normal')
|
||||
self.doc.write_text(text,key)
|
||||
self.doc.write_text(text,mark)
|
||||
self.doc.end_paragraph()
|
||||
self.doc.end_cell()
|
||||
|
||||
@ -416,9 +416,9 @@ class IndivCompleteReport(Report):
|
||||
|
||||
media_list = self.start_person.get_media_list()
|
||||
name = self.start_person.get_primary_name().get_regular_name()
|
||||
key = ReportUtils.get_person_key(self.database,self.start_person)
|
||||
mark = ReportUtils.get_person_mark(self.database,self.start_person)
|
||||
self.doc.start_paragraph("IDS-Title")
|
||||
self.doc.write_text(_("Summary of %s") % name,key)
|
||||
self.doc.write_text(_("Summary of %s") % name,mark)
|
||||
self.doc.end_paragraph()
|
||||
|
||||
self.doc.start_paragraph("IDS-Normal")
|
||||
@ -440,14 +440,14 @@ class IndivCompleteReport(Report):
|
||||
self.normal_cell("%s:" % _("Name"))
|
||||
name = self.start_person.get_primary_name()
|
||||
text = name.get_regular_name()
|
||||
key = ReportUtils.get_person_key(self.database, self.start_person)
|
||||
mark = ReportUtils.get_person_mark(self.database, self.start_person)
|
||||
if self.use_srcs:
|
||||
for s in name.get_source_references():
|
||||
self.slist.append(s)
|
||||
src_handle = s.get_reference_handle()
|
||||
src = self.database.get_source_from_handle(src_handle)
|
||||
text = "%s [%s]" % (text,src.get_gramps_id())
|
||||
self.normal_cell(text,key)
|
||||
self.normal_cell(text,mark)
|
||||
self.doc.end_row()
|
||||
|
||||
self.doc.start_row()
|
||||
@ -466,33 +466,33 @@ class IndivCompleteReport(Report):
|
||||
father_inst = self.database.get_person_from_handle(
|
||||
father_inst_id)
|
||||
father = father_inst.get_primary_name().get_regular_name()
|
||||
fkey = ReportUtils.get_person_key(self.database,father_inst)
|
||||
fmark = ReportUtils.get_person_mark(self.database,father_inst)
|
||||
else:
|
||||
father = ""
|
||||
fkey = ""
|
||||
fmark = None
|
||||
mother_inst_id = family.get_mother_handle()
|
||||
if mother_inst_id:
|
||||
mother_inst = self.database.get_person_from_handle(
|
||||
mother_inst_id)
|
||||
mother = mother_inst.get_primary_name().get_regular_name()
|
||||
mkey = ReportUtils.get_person_key(self.database,mother_inst)
|
||||
mmark = ReportUtils.get_person_mark(self.database,mother_inst)
|
||||
else:
|
||||
mother = ""
|
||||
mkey = ""
|
||||
mmark = None
|
||||
else:
|
||||
father = ""
|
||||
fkey = ""
|
||||
fmark = None
|
||||
mother = ""
|
||||
mkey = ""
|
||||
mmark = None
|
||||
|
||||
self.doc.start_row()
|
||||
self.normal_cell("%s:" % _("Father"))
|
||||
self.normal_cell(father,fkey)
|
||||
self.normal_cell(father,fmark)
|
||||
self.doc.end_row()
|
||||
|
||||
self.doc.start_row()
|
||||
self.normal_cell("%s:" % _("Mother"))
|
||||
self.normal_cell(mother,mkey)
|
||||
self.normal_cell(mother,mmark)
|
||||
self.doc.end_row()
|
||||
self.doc.end_table()
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user