diff --git a/ChangeLog b/ChangeLog index edc1fe52d..9e682a3d7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,14 @@ +2006-06-02 Brian Matherly + * 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 * src/FilterEditor/_EditFilter.py: clean up * src/FilterEditor/_EditRule.py: clean up diff --git a/src/BaseDoc.py b/src/BaseDoc.py index fbce01c3b..537524932 100644 --- a/src/BaseDoc.py +++ b/src/BaseDoc.py @@ -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 diff --git a/src/ReportBase/_ReportUtils.py b/src/ReportBase/_ReportUtils.py index 4073c1280..13ae4af7c 100644 --- a/src/ReportBase/_ReportUtils.py +++ b/src/ReportBase/_ReportUtils.py @@ -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 ) diff --git a/src/docgen/AbiWord2Doc.py b/src/docgen/AbiWord2Doc.py index 896e4048d..05447540a 100644 --- a/src/docgen/AbiWord2Doc.py +++ b/src/docgen/AbiWord2Doc.py @@ -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('>','>'); diff --git a/src/docgen/AsciiDoc.py b/src/docgen/AsciiDoc.py index 827866477..5dfed8659 100644 --- a/src/docgen/AsciiDoc.py +++ b/src/docgen/AsciiDoc.py @@ -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('','[') text = text.replace('',']') self.text = self.text + text diff --git a/src/docgen/HtmlDoc.py b/src/docgen/HtmlDoc.py index 5807bc0c3..a3d874689 100644 --- a/src/docgen/HtmlDoc.py +++ b/src/docgen/HtmlDoc.py @@ -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('>','>'); diff --git a/src/docgen/KwordDoc.py b/src/docgen/KwordDoc.py index 73a65857b..44b2eedd5 100644 --- a/src/docgen/KwordDoc.py +++ b/src/docgen/KwordDoc.py @@ -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('>','>'); diff --git a/src/docgen/LPRDoc.py b/src/docgen/LPRDoc.py index 77f32da52..88614d75d 100644 --- a/src/docgen/LPRDoc.py +++ b/src/docgen/LPRDoc.py @@ -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 diff --git a/src/docgen/LaTeXDoc.py b/src/docgen/LaTeXDoc.py index 333122ac6..0854216e6 100644 --- a/src/docgen/LaTeXDoc.py +++ b/src/docgen/LaTeXDoc.py @@ -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' diff --git a/src/docgen/ODFDoc.py b/src/docgen/ODFDoc.py index 26858f24b..66ddbe285 100644 --- a/src/docgen/ODFDoc.py +++ b/src/docgen/ODFDoc.py @@ -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('' % key) self.cntnt.write(escape(text,_esc_map)) diff --git a/src/docgen/ODSDoc.py b/src/docgen/ODSDoc.py index e4cc6358a..cd4c8d3bc 100644 --- a/src/docgen/ODSDoc.py +++ b/src/docgen/ODSDoc.py @@ -395,7 +395,7 @@ class ODSDoc(SpreadSheetDoc): def end_page(self): self.f.write('\n') - def write_text(self,text,key=""): + def write_text(self,text,mark=None): if text == "": return if self.content == 0: diff --git a/src/docgen/OpenOfficeDoc.py b/src/docgen/OpenOfficeDoc.py index e4e6fc452..6f5ce7f60 100644 --- a/src/docgen/OpenOfficeDoc.py +++ b/src/docgen/OpenOfficeDoc.py @@ -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('' % key) self.cntnt.write(escape(text,_esc_map)) diff --git a/src/docgen/OpenSpreadSheet.py b/src/docgen/OpenSpreadSheet.py index 028459446..c2c44cf5b 100644 --- a/src/docgen/OpenSpreadSheet.py +++ b/src/docgen/OpenSpreadSheet.py @@ -381,7 +381,7 @@ class OpenSpreadSheet(SpreadSheetDoc): def end_page(self): self.f.write('\n') - def write_text(self,text,key=""): + def write_text(self,text,mark=None): if text == "": return if self.content == 0: diff --git a/src/docgen/PSDrawDoc.py b/src/docgen/PSDrawDoc.py index 0e43e166f..12d0954f1 100644 --- a/src/docgen/PSDrawDoc.py +++ b/src/docgen/PSDrawDoc.py @@ -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): diff --git a/src/docgen/PdfDoc.py b/src/docgen/PdfDoc.py index 0a0bfaecc..f15650b77 100644 --- a/src/docgen/PdfDoc.py +++ b/src/docgen/PdfDoc.py @@ -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('>','>') diff --git a/src/docgen/RTFDoc.py b/src/docgen/RTFDoc.py index d3252ab79..e16028c88 100644 --- a/src/docgen/RTFDoc.py +++ b/src/docgen/RTFDoc.py @@ -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 diff --git a/src/docgen/SpreadSheetDoc.py b/src/docgen/SpreadSheetDoc.py index 1a8480375..92973d77d 100644 --- a/src/docgen/SpreadSheetDoc.py +++ b/src/docgen/SpreadSheetDoc.py @@ -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 diff --git a/src/plugins/AncestorReport.py b/src/plugins/AncestorReport.py index 711572fe1..9601f857e 100644 --- a/src/plugins/AncestorReport.py +++ b/src/plugins/AncestorReport.py @@ -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(" ") diff --git a/src/plugins/DescendReport.py b/src/plugins/DescendReport.py index a22270888..82068fac5 100644 --- a/src/plugins/DescendReport.py +++ b/src/plugins/DescendReport.py @@ -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() diff --git a/src/plugins/DetAncestralReport.py b/src/plugins/DetAncestralReport.py index 7a475a5cd..6e8756f30 100644 --- a/src/plugins/DetAncestralReport.py +++ b/src/plugins/DetAncestralReport.py @@ -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 diff --git a/src/plugins/DetDescendantReport.py b/src/plugins/DetDescendantReport.py index 0b631c539..9dc8cd941 100644 --- a/src/plugins/DetDescendantReport.py +++ b/src/plugins/DetDescendantReport.py @@ -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) diff --git a/src/plugins/FamilyGroup.py b/src/plugins/FamilyGroup.py index 1db61e2c9..c89de5873 100644 --- a/src/plugins/FamilyGroup.py +++ b/src/plugins/FamilyGroup.py @@ -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() diff --git a/src/plugins/IndivComplete.py b/src/plugins/IndivComplete.py index ff03ad28f..4e7c5359c 100644 --- a/src/plugins/IndivComplete.py +++ b/src/plugins/IndivComplete.py @@ -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()