add gramps-ID option to DAR and DDR text reports
This commit is contained in:
parent
8086d9f2ca
commit
07ce8c22d8
@ -292,9 +292,12 @@ class AncestorOptions(MenuReportOptions):
|
|||||||
menu.add_option(category_name, "pid", self.__pid)
|
menu.add_option(category_name, "pid", self.__pid)
|
||||||
|
|
||||||
maxgen = NumberOption(_("Generations"), 10, 1, 100)
|
maxgen = NumberOption(_("Generations"), 10, 1, 100)
|
||||||
maxgen.set_help(_("The number of generations to include in the report"))
|
maxgen.set_help(
|
||||||
|
_("The number of generations to include in the report"))
|
||||||
menu.add_option(category_name, "maxgen", maxgen)
|
menu.add_option(category_name, "maxgen", maxgen)
|
||||||
|
|
||||||
|
stdoptions.add_gramps_id_option(menu, category_name)
|
||||||
|
|
||||||
pagebbg = BooleanOption(_("Page break between generations"), False)
|
pagebbg = BooleanOption(_("Page break between generations"), False)
|
||||||
pagebbg.set_help(
|
pagebbg.set_help(
|
||||||
_("Whether to start a new page after each generation."))
|
_("Whether to start a new page after each generation."))
|
||||||
@ -304,8 +307,6 @@ class AncestorOptions(MenuReportOptions):
|
|||||||
namebrk.set_help(_("Whether a line break should follow the name."))
|
namebrk.set_help(_("Whether a line break should follow the name."))
|
||||||
menu.add_option(category_name, "namebrk", namebrk)
|
menu.add_option(category_name, "namebrk", namebrk)
|
||||||
|
|
||||||
stdoptions.add_gramps_id_option(menu, category_name)
|
|
||||||
|
|
||||||
category_name = _("Report Options (2)")
|
category_name = _("Report Options (2)")
|
||||||
|
|
||||||
stdoptions.add_name_format_option(menu, category_name)
|
stdoptions.add_name_format_option(menu, category_name)
|
||||||
|
@ -92,6 +92,7 @@ class DetAncestorReport(Report):
|
|||||||
that come in the options class.
|
that come in the options class.
|
||||||
|
|
||||||
gen - Maximum number of generations to include.
|
gen - Maximum number of generations to include.
|
||||||
|
inc_id - Whether to include Gramps IDs
|
||||||
pagebgg - Whether to include page breaks between generations.
|
pagebgg - Whether to include page breaks between generations.
|
||||||
pageben - Whether to include page break before End Notes.
|
pageben - Whether to include page break before End Notes.
|
||||||
firstName - Whether to use first names instead of pronouns.
|
firstName - Whether to use first names instead of pronouns.
|
||||||
@ -156,6 +157,7 @@ class DetAncestorReport(Report):
|
|||||||
self.inc_srcnotes = get_value('incsrcnotes')
|
self.inc_srcnotes = get_value('incsrcnotes')
|
||||||
self.inc_attrs = get_value('incattrs')
|
self.inc_attrs = get_value('incattrs')
|
||||||
self.initial_sosa = get_value('initial_sosa')
|
self.initial_sosa = get_value('initial_sosa')
|
||||||
|
self.want_ids = get_value('inc_id')
|
||||||
pid = get_value('pid')
|
pid = get_value('pid')
|
||||||
self.other_events = get_value('incotherevents')
|
self.other_events = get_value('incotherevents')
|
||||||
|
|
||||||
@ -298,6 +300,8 @@ class DetAncestorReport(Report):
|
|||||||
elif name:
|
elif name:
|
||||||
self.doc.write_text_citation("%s. " % self.endnotes(person))
|
self.doc.write_text_citation("%s. " % self.endnotes(person))
|
||||||
self.doc.end_bold()
|
self.doc.end_bold()
|
||||||
|
if self.want_ids:
|
||||||
|
self.doc.write_text('(%s) ' % person.get_gramps_id())
|
||||||
|
|
||||||
if self.dupperson:
|
if self.dupperson:
|
||||||
# Check for duplicate record (result of distant cousins marrying)
|
# Check for duplicate record (result of distant cousins marrying)
|
||||||
@ -557,6 +561,8 @@ class DetAncestorReport(Report):
|
|||||||
self._nd)
|
self._nd)
|
||||||
if text:
|
if text:
|
||||||
self.doc.write_text_citation(text, spouse_mark)
|
self.doc.write_text_citation(text, spouse_mark)
|
||||||
|
if self.want_ids:
|
||||||
|
self.doc.write_text(' (%s)' % family.get_gramps_id())
|
||||||
is_first = False
|
is_first = False
|
||||||
|
|
||||||
def write_children(self, family):
|
def write_children(self, family):
|
||||||
@ -614,6 +620,8 @@ class DetAncestorReport(Report):
|
|||||||
self.__narrator.set_subject(child)
|
self.__narrator.set_subject(child)
|
||||||
if child_name:
|
if child_name:
|
||||||
self.doc.write_text("%s. " % child_name, child_mark)
|
self.doc.write_text("%s. " % child_name, child_mark)
|
||||||
|
if self.want_ids:
|
||||||
|
self.doc.write_text('(%s) ' % child.get_gramps_id())
|
||||||
self.doc.write_text_citation(
|
self.doc.write_text_citation(
|
||||||
self.__narrator.get_born_string() or
|
self.__narrator.get_born_string() or
|
||||||
self.__narrator.get_christened_string() or
|
self.__narrator.get_christened_string() or
|
||||||
@ -735,6 +743,8 @@ class DetAncestorReport(Report):
|
|||||||
mark)
|
mark)
|
||||||
if name[-1:] != '.':
|
if name[-1:] != '.':
|
||||||
self.doc.write_text(".")
|
self.doc.write_text(".")
|
||||||
|
if self.want_ids:
|
||||||
|
self.doc.write_text(' (%s)' % ind.get_gramps_id())
|
||||||
self.doc.write_text_citation(self.endnotes(ind))
|
self.doc.write_text_citation(self.endnotes(ind))
|
||||||
self.doc.end_paragraph()
|
self.doc.end_paragraph()
|
||||||
|
|
||||||
@ -821,6 +831,8 @@ class DetAncestorOptions(MenuReportOptions):
|
|||||||
gen.set_help(_("The number of generations to include in the report"))
|
gen.set_help(_("The number of generations to include in the report"))
|
||||||
addopt("gen", gen)
|
addopt("gen", gen)
|
||||||
|
|
||||||
|
stdoptions.add_gramps_id_option(menu, category)
|
||||||
|
|
||||||
pagebbg = BooleanOption(_("Page break between generations"), False)
|
pagebbg = BooleanOption(_("Page break between generations"), False)
|
||||||
pagebbg.set_help(
|
pagebbg.set_help(
|
||||||
_("Whether to start a new page after each generation."))
|
_("Whether to start a new page after each generation."))
|
||||||
|
@ -95,6 +95,7 @@ class DetDescendantReport(Report):
|
|||||||
that come in the options class.
|
that come in the options class.
|
||||||
|
|
||||||
gen - Maximum number of generations to include.
|
gen - Maximum number of generations to include.
|
||||||
|
inc_id - Whether to include Gramps IDs
|
||||||
pagebgg - Whether to include page breaks between generations.
|
pagebgg - Whether to include page breaks between generations.
|
||||||
pageben - Whether to include page break before End Notes.
|
pageben - Whether to include page break before End Notes.
|
||||||
fulldates - Whether to use full dates instead of just year.
|
fulldates - Whether to use full dates instead of just year.
|
||||||
@ -177,6 +178,7 @@ class DetDescendantReport(Report):
|
|||||||
self.inc_paths = get_value('incpaths')
|
self.inc_paths = get_value('incpaths')
|
||||||
self.inc_ssign = get_value('incssign')
|
self.inc_ssign = get_value('incssign')
|
||||||
self.inc_materef = get_value('incmateref')
|
self.inc_materef = get_value('incmateref')
|
||||||
|
self.want_ids = get_value('inc_id')
|
||||||
|
|
||||||
pid = get_value('pid')
|
pid = get_value('pid')
|
||||||
self.center_person = self._db.get_person_from_gramps_id(pid)
|
self.center_person = self._db.get_person_from_gramps_id(pid)
|
||||||
@ -439,6 +441,8 @@ class DetDescendantReport(Report):
|
|||||||
elif name:
|
elif name:
|
||||||
self.doc.write_text_citation("%s. " % self.endnotes(person))
|
self.doc.write_text_citation("%s. " % self.endnotes(person))
|
||||||
self.doc.end_bold()
|
self.doc.end_bold()
|
||||||
|
if self.want_ids:
|
||||||
|
self.doc.write_text('(%s)' % person.get_gramps_id())
|
||||||
|
|
||||||
if self.inc_paths:
|
if self.inc_paths:
|
||||||
self.write_path(person)
|
self.write_path(person)
|
||||||
@ -597,6 +601,8 @@ class DetDescendantReport(Report):
|
|||||||
self._name_display)
|
self._name_display)
|
||||||
if text:
|
if text:
|
||||||
self.doc.write_text_citation(text, spouse_mark)
|
self.doc.write_text_citation(text, spouse_mark)
|
||||||
|
if self.want_ids:
|
||||||
|
self.doc.write_text('(%s)' % family.get_gramps_id())
|
||||||
is_first = False
|
is_first = False
|
||||||
|
|
||||||
def __write_mate(self, person, family):
|
def __write_mate(self, person, family):
|
||||||
@ -627,6 +633,8 @@ class DetDescendantReport(Report):
|
|||||||
if name[-1:] != '.':
|
if name[-1:] != '.':
|
||||||
self.doc.write_text(".")
|
self.doc.write_text(".")
|
||||||
self.doc.write_text_citation(self.endnotes(mate))
|
self.doc.write_text_citation(self.endnotes(mate))
|
||||||
|
if self.want_ids:
|
||||||
|
self.doc.write_text(' (%s)' % mate.get_gramps_id())
|
||||||
self.doc.end_paragraph()
|
self.doc.end_paragraph()
|
||||||
|
|
||||||
if not self.inc_materef:
|
if not self.inc_materef:
|
||||||
@ -723,6 +731,8 @@ class DetDescendantReport(Report):
|
|||||||
cnt += 1
|
cnt += 1
|
||||||
|
|
||||||
self.doc.write_text("%s. " % child_name, child_mark)
|
self.doc.write_text("%s. " % child_name, child_mark)
|
||||||
|
if self.want_ids:
|
||||||
|
self.doc.write_text('(%s) ' % child.get_gramps_id())
|
||||||
self.__narrator.set_subject(child)
|
self.__narrator.set_subject(child)
|
||||||
self.doc.write_text_citation(
|
self.doc.write_text_citation(
|
||||||
self.__narrator.get_born_string() or
|
self.__narrator.get_born_string() or
|
||||||
@ -1027,6 +1037,8 @@ class DetDescendantOptions(MenuReportOptions):
|
|||||||
gen.set_help(_("The number of generations to include in the report"))
|
gen.set_help(_("The number of generations to include in the report"))
|
||||||
add_option("gen", gen)
|
add_option("gen", gen)
|
||||||
|
|
||||||
|
stdoptions.add_gramps_id_option(menu, category)
|
||||||
|
|
||||||
pagebbg = BooleanOption(_("Page break between generations"), False)
|
pagebbg = BooleanOption(_("Page break between generations"), False)
|
||||||
pagebbg.set_help(
|
pagebbg.set_help(
|
||||||
_("Whether to start a new page after each generation."))
|
_("Whether to start a new page after each generation."))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user