add "living people" option to Database Summary report

This commit is contained in:
Paul Franklin 2016-04-20 19:11:35 -07:00
parent e2b7935ace
commit fd8c8f5948
2 changed files with 21 additions and 12 deletions

View File

@ -109,7 +109,8 @@ def run_private_data_option(report, menu):
def add_living_people_option(menu, category,
mode=LivingProxyDb.MODE_INCLUDE_ALL,
after_death_years=0):
after_death_years=0,
process_names=True):
"""
Insert an option for deciding how the information in the
database for living people shall be handled by the report
@ -146,6 +147,8 @@ def add_living_people_option(menu, category,
still consider them as living.
:type after_death_years: int
:return: nothing
:param process_names: whether to offer name-oriented option choices
:type process_names: Boolean
"""
def living_people_changed():
@ -160,7 +163,8 @@ def add_living_people_option(menu, category,
living_people = EnumeratedListOption(_("Living People"), mode)
living_people.add_item(LivingProxyDb.MODE_INCLUDE_ALL,
_("Include living people and their data"))
living_people.add_item(LivingProxyDb.MODE_INCLUDE_FULL_NAME_ONLY,
if process_names:
living_people.add_item(LivingProyDb.MODE_INCLUDE_FULL_NAME_ONLY,
_("Include full names but no data"))
living_people.add_item(LivingProxyDb.MODE_INCLUDE_LAST_NAME_ONLY,
_("Replace given names and include no data"))

View File

@ -68,16 +68,18 @@ class SummaryReport(Report):
database - the GRAMPS database instance
options - instance of the Options class for this report
user - a gen.user.User() instance
incl_private - Whether to count private data
living_people - How to handle living people
years_past_death - Consider as living this many years after death
"""
Report.__init__(self, database, options, user)
stdoptions.run_private_data_option(self, options.menu)
self.__db = self.database
lang = options.menu.get_option_by_name('trans').get_value()
self.set_locale(lang)
rlocale = self.set_locale(lang)
stdoptions.run_private_data_option(self, options.menu)
stdoptions.run_living_people_option(self, options.menu, rlocale)
self.__db = self.database
def write_report(self):
"""
@ -281,6 +283,9 @@ class SummaryOptions(MenuReportOptions):
include_private_data = menu.get_option_by_name('incl_private')
include_private_data.set_help(_("Whether to count private data"))
stdoptions.add_living_people_option(menu, category_name,
process_names=False)
stdoptions.add_localization_option(menu, category_name)
def make_default_style(self, default_style):