Skip to content

Commit

Permalink
Update detancestralreport.py
Browse files Browse the repository at this point in the history
Use Refactoring of get_gender_symbol in utils.py
  • Loading branch information
dave-khuon committed Jan 19, 2025
1 parent 7cd0cc8 commit 891b136
Showing 1 changed file with 4 additions and 14 deletions.
18 changes: 4 additions & 14 deletions gramps/plugins/textreport/detancestralreport.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
# Copyright (C) 2013-2014 Paul Franklin
# Copyright (C) 2014 Gerald Kunzmann <[email protected]>
# Copyright (C) 2017 Robert Carnell <bertcarnell_at_gmail.com>
# Copyright (C) 2024 Dave Khuon
# Copyright (C) 2024-2025 Dave Khuon
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
Expand Down Expand Up @@ -45,7 +45,6 @@
#
# ------------------------------------------------------------------------
from gramps.gen.const import GRAMPS_LOCALE as glocale
from gramps.gen.utils.symbols import Symbols

_ = glocale.translation.gettext
from gramps.gen.errors import ReportError
Expand All @@ -72,7 +71,6 @@
from gramps.gen.proxy import CacheProxyDb
from gramps.gen.display.name import displayer as _nd

_MSYM = Symbols()

# ------------------------------------------------------------------------
#
Expand Down Expand Up @@ -294,14 +292,6 @@ def _get_s_s(self, key):
new_gen_start = self.initial_sosa * gen_start # 3
return new_gen_start + (key - gen_start) # 3+0

def get_genderSymbol(self, person):
"""generate gender symbol to place before the person name"""
gndr = person.get_gender()
if gndr is not None:
return _MSYM.get_symbol_for_string(gndr) + " "
else:
return ""

def write_person(self, key):
"""Output birth, death, parentage, marriage and notes information"""

Expand Down Expand Up @@ -333,7 +323,7 @@ def write_more_header(first, name):

self.doc.start_bold()
if self.showgender:
self.doc.write_text(self.get_genderSymbol(person))
self.doc.write_text(utils.get_gender_symbol(person) + " ")
self.doc.write_text(name, mark)
if name[-1:] == ".":
self.doc.write_text_citation("%s " % self.endnotes(person))
Expand Down Expand Up @@ -659,7 +649,7 @@ def write_children(self, family):
if not child_name:
child_name = self._("Unknown")
if self.showgender:
child_name = self.get_genderSymbol(child) + child_name
child_name = utils.get_gender_symbol(child) + " " + child_name
child_mark = utils.get_person_mark(self._db, child)

if self.childref and self.prev_gen_handles.get(child_handle):
Expand Down Expand Up @@ -789,7 +779,7 @@ def write_mate(self, person):
mark = utils.get_person_mark(self._db, ind)

if self.showgender:
name = self.get_genderSymbol(ind) + name
name = utils.get_gender_symbol(ind) + " " + name
if family.get_relationship() == FamilyRelType.MARRIED:
self.doc.write_text(self._("Spouse: %s") % name, mark)
else:
Expand Down

0 comments on commit 891b136

Please sign in to comment.