diff --git a/src/GrampsDbUtils/_GedcomParse.py b/src/GrampsDbUtils/_GedcomParse.py index ed99ff211..60152505e 100644 --- a/src/GrampsDbUtils/_GedcomParse.py +++ b/src/GrampsDbUtils/_GedcomParse.py @@ -2471,7 +2471,7 @@ class GedcomParser(UpdateCallback): self.__parse_level(sub_state, self.event_parse_tbl, self.__undefined) - if int(event.get_type()) == gen.lib.EventType.MARRIAGE: + if event.type == gen.lib.EventType.MARRIAGE: descr = event.get_description() if descr == "Civil Union": state.family.type.set(gen.lib.FamilyRelType.CIVIL_UNION) @@ -2881,7 +2881,7 @@ class GedcomParser(UpdateCallback): @type state: CurrentState """ - if self.is_ftw and int(state.event.get_type()) in FTW_BAD_PLACE: + if self.is_ftw and state.event.type in FTW_BAD_PLACE: state.event.set_description(line.data) else: place = self.__find_or_create_place(line.data) diff --git a/src/ReportBase/_ReportUtils.py b/src/ReportBase/_ReportUtils.py index 49b5ea0ea..bdcdb4dfa 100644 --- a/src/ReportBase/_ReportUtils.py +++ b/src/ReportBase/_ReportUtils.py @@ -41,7 +41,11 @@ from gettext import gettext as _ # #------------------------------------------------------------------------ import DateHandler -import gen.lib +from gen.lib.date import Date +from gen.lib.eventroletype import EventRoleType +from gen.lib.eventtype import EventType +from gen.lib.familyreltype import FamilyRelType +from gen.lib.person import Person from BasicUtils import name_displayer as _nd from Utils import media_path_full from QuestionDialog import WarningDialog @@ -55,98 +59,98 @@ import BaseDoc born_full_date_with_place = [ { - gen.lib.Person.UNKNOWN : _("This person was born on %(birth_date)s in %(birth_place)s."), - gen.lib.Person.MALE : _("He was born on %(birth_date)s in %(birth_place)s."), - gen.lib.Person.FEMALE : _("She was born on %(birth_date)s in %(birth_place)s."), + Person.UNKNOWN : _("This person was born on %(birth_date)s in %(birth_place)s."), + Person.MALE : _("He was born on %(birth_date)s in %(birth_place)s."), + Person.FEMALE : _("She was born on %(birth_date)s in %(birth_place)s."), }, { - gen.lib.Person.UNKNOWN : _("%(unknown_gender_name)s was born on %(birth_date)s in %(birth_place)s."), - gen.lib.Person.MALE : _("%(male_name)s was born on %(birth_date)s in %(birth_place)s."), - gen.lib.Person.FEMALE : _("%(female_name)s was born on %(birth_date)s in %(birth_place)s."), + Person.UNKNOWN : _("%(unknown_gender_name)s was born on %(birth_date)s in %(birth_place)s."), + Person.MALE : _("%(male_name)s was born on %(birth_date)s in %(birth_place)s."), + Person.FEMALE : _("%(female_name)s was born on %(birth_date)s in %(birth_place)s."), }, _("Born %(birth_date)s in %(birth_place)s."), ] born_modified_date_with_place = [ { - gen.lib.Person.UNKNOWN : _("This person was born %(modified_date)s in %(birth_place)s."), - gen.lib.Person.MALE : _("He was born %(modified_date)s in %(birth_place)s."), - gen.lib.Person.FEMALE : _("She was born %(modified_date)s in %(birth_place)s."), + Person.UNKNOWN : _("This person was born %(modified_date)s in %(birth_place)s."), + Person.MALE : _("He was born %(modified_date)s in %(birth_place)s."), + Person.FEMALE : _("She was born %(modified_date)s in %(birth_place)s."), }, { - gen.lib.Person.UNKNOWN : _("%(unknown_gender_name)s was born %(modified_date)s in %(birth_place)s."), - gen.lib.Person.MALE : _("%(male_name)s was born %(modified_date)s in %(birth_place)s."), - gen.lib.Person.FEMALE : _("%(female_name)s was born %(modified_date)s in %(birth_place)s."), + Person.UNKNOWN : _("%(unknown_gender_name)s was born %(modified_date)s in %(birth_place)s."), + Person.MALE : _("%(male_name)s was born %(modified_date)s in %(birth_place)s."), + Person.FEMALE : _("%(female_name)s was born %(modified_date)s in %(birth_place)s."), }, _("Born %(modified_date)s in %(birth_place)s."), ] born_full_date_no_place = [ { - gen.lib.Person.UNKNOWN : _("This person was born on %(birth_date)s."), - gen.lib.Person.MALE : _("He was born on %(birth_date)s."), - gen.lib.Person.FEMALE : _("She was born on %(birth_date)s."), + Person.UNKNOWN : _("This person was born on %(birth_date)s."), + Person.MALE : _("He was born on %(birth_date)s."), + Person.FEMALE : _("She was born on %(birth_date)s."), }, { - gen.lib.Person.UNKNOWN : _("%(unknown_gender_name)s was born on %(birth_date)s."), - gen.lib.Person.MALE : _("%(male_name)s was born on %(birth_date)s."), - gen.lib.Person.FEMALE : _("%(female_name)s was born on %(birth_date)s."), + Person.UNKNOWN : _("%(unknown_gender_name)s was born on %(birth_date)s."), + Person.MALE : _("%(male_name)s was born on %(birth_date)s."), + Person.FEMALE : _("%(female_name)s was born on %(birth_date)s."), }, _("Born %(birth_date)s."), ] born_modified_date_no_place = [ { - gen.lib.Person.UNKNOWN : _("This person was born %(modified_date)s."), - gen.lib.Person.MALE : _("He was born %(modified_date)s."), - gen.lib.Person.FEMALE : _("She was born %(modified_date)s."), + Person.UNKNOWN : _("This person was born %(modified_date)s."), + Person.MALE : _("He was born %(modified_date)s."), + Person.FEMALE : _("She was born %(modified_date)s."), }, { - gen.lib.Person.UNKNOWN : _("%(unknown_gender_name)s was born %(modified_date)s."), - gen.lib.Person.MALE : _("%(male_name)s was born %(modified_date)s."), - gen.lib.Person.FEMALE : _("%(female_name)s was born %(modified_date)s."), + Person.UNKNOWN : _("%(unknown_gender_name)s was born %(modified_date)s."), + Person.MALE : _("%(male_name)s was born %(modified_date)s."), + Person.FEMALE : _("%(female_name)s was born %(modified_date)s."), }, _("Born %(modified_date)s."), ] born_partial_date_with_place = [ { - gen.lib.Person.UNKNOWN : _("This person was born in %(month_year)s in %(birth_place)s."), - gen.lib.Person.MALE : _("He was born in %(month_year)s in %(birth_place)s."), - gen.lib.Person.FEMALE : _("She was born in %(month_year)s in %(birth_place)s."), + Person.UNKNOWN : _("This person was born in %(month_year)s in %(birth_place)s."), + Person.MALE : _("He was born in %(month_year)s in %(birth_place)s."), + Person.FEMALE : _("She was born in %(month_year)s in %(birth_place)s."), }, { - gen.lib.Person.UNKNOWN : _("%(unknown_gender_name)s was born in %(month_year)s in %(birth_place)s."), - gen.lib.Person.MALE : _("%(male_name)s was born in %(month_year)s in %(birth_place)s."), - gen.lib.Person.FEMALE : _("%(female_name)s was born in %(month_year)s in %(birth_place)s."), + Person.UNKNOWN : _("%(unknown_gender_name)s was born in %(month_year)s in %(birth_place)s."), + Person.MALE : _("%(male_name)s was born in %(month_year)s in %(birth_place)s."), + Person.FEMALE : _("%(female_name)s was born in %(month_year)s in %(birth_place)s."), }, _("Born %(month_year)s in %(birth_place)s."), ] born_partial_date_no_place = [ { - gen.lib.Person.UNKNOWN : _("This person was born in %(month_year)s."), - gen.lib.Person.MALE : _("He was born in %(month_year)s."), - gen.lib.Person.FEMALE : _("She was born in %(month_year)s."), + Person.UNKNOWN : _("This person was born in %(month_year)s."), + Person.MALE : _("He was born in %(month_year)s."), + Person.FEMALE : _("She was born in %(month_year)s."), }, { - gen.lib.Person.UNKNOWN : _("%(unknown_gender_name)s was born in %(month_year)s."), - gen.lib.Person.MALE : _("%(male_name)s was born in %(month_year)s."), - gen.lib.Person.FEMALE : _("%(female_name)s was born in %(month_year)s."), + Person.UNKNOWN : _("%(unknown_gender_name)s was born in %(month_year)s."), + Person.MALE : _("%(male_name)s was born in %(month_year)s."), + Person.FEMALE : _("%(female_name)s was born in %(month_year)s."), }, _("Born %(month_year)s."), ] born_no_date_with_place = [ { - gen.lib.Person.UNKNOWN : _("This person was born in %(birth_place)s."), - gen.lib.Person.MALE : _("He was born in %(birth_place)s."), - gen.lib.Person.FEMALE : _("She was born in %(birth_place)s."), + Person.UNKNOWN : _("This person was born in %(birth_place)s."), + Person.MALE : _("He was born in %(birth_place)s."), + Person.FEMALE : _("She was born in %(birth_place)s."), }, { - gen.lib.Person.UNKNOWN : _("%(unknown_gender_name)s was born in %(birth_place)s."), - gen.lib.Person.MALE : _("%(male_name)s was born in %(birth_place)s."), - gen.lib.Person.FEMALE : _("%(female_name)s was born in %(birth_place)s."), + Person.UNKNOWN : _("%(unknown_gender_name)s was born in %(birth_place)s."), + Person.MALE : _("%(male_name)s was born in %(birth_place)s."), + Person.FEMALE : _("%(female_name)s was born in %(birth_place)s."), }, _("Born in %(birth_place)s."), ] @@ -158,38 +162,38 @@ born_no_date_with_place = [ #------------------------------------------------------------------------ died_full_date_with_place = [ - { gen.lib.Person.UNKNOWN : [ + { Person.UNKNOWN : [ _("This person died on %(death_date)s in %(death_place)s."), _("This person died on %(death_date)s in %(death_place)s at the age of %(age)d years."), _("This person died on %(death_date)s in %(death_place)s at the age of %(age)d months."), _("This person died on %(death_date)s in %(death_place)s at the age of %(age)d days."), ], - gen.lib.Person.MALE : [ + Person.MALE : [ _("He died on %(death_date)s in %(death_place)s."), _("He died on %(death_date)s in %(death_place)s at the age of %(age)d years."), _("He died on %(death_date)s in %(death_place)s at the age of %(age)d months."), _("He died on %(death_date)s in %(death_place)s at the age of %(age)d days."), ], - gen.lib.Person.FEMALE : [ + Person.FEMALE : [ _("She died on %(death_date)s in %(death_place)s."), _("She died on %(death_date)s in %(death_place)s at the age of %(age)d years."), _("She died on %(death_date)s in %(death_place)s at the age of %(age)d months."), _("She died on %(death_date)s in %(death_place)s at the age of %(age)d days."), ], }, - { gen.lib.Person.UNKNOWN : [ + { Person.UNKNOWN : [ _("%(unknown_gender_name)s died on %(death_date)s in %(death_place)s."), _("%(unknown_gender_name)s died on %(death_date)s in %(death_place)s at the age of %(age)d years."), _("%(unknown_gender_name)s died on %(death_date)s in %(death_place)s at the age of %(age)d months."), _("%(unknown_gender_name)s died on %(death_date)s in %(death_place)s at the age of %(age)d days."), ], - gen.lib.Person.MALE : [ + Person.MALE : [ _("%(male_name)s died on %(death_date)s in %(death_place)s."), _("%(male_name)s died on %(death_date)s in %(death_place)s at the age of %(age)d years."), _("%(male_name)s died on %(death_date)s in %(death_place)s at the age of %(age)d months."), _("%(male_name)s died on %(death_date)s in %(death_place)s at the age of %(age)d days."), ], - gen.lib.Person.FEMALE : [ + Person.FEMALE : [ _("%(female_name)s died on %(death_date)s in %(death_place)s."), _("%(female_name)s died on %(death_date)s in %(death_place)s at the age of %(age)d years."), _("%(female_name)s died on %(death_date)s in %(death_place)s at the age of %(age)d months."), @@ -205,38 +209,38 @@ died_full_date_with_place = [ ] died_modified_date_with_place = [ - { gen.lib.Person.UNKNOWN : [ + { Person.UNKNOWN : [ _("This person died %(death_date)s in %(death_place)s."), _("This person died %(death_date)s in %(death_place)s at the age of %(age)d years."), _("This person died %(death_date)s in %(death_place)s at the age of %(age)d months."), _("This person died %(death_date)s in %(death_place)s at the age of %(age)d days."), ], - gen.lib.Person.MALE : [ + Person.MALE : [ _("He died %(death_date)s in %(death_place)s."), _("He died %(death_date)s in %(death_place)s at the age of %(age)d years."), _("He died %(death_date)s in %(death_place)s at the age of %(age)d months."), _("He died %(death_date)s in %(death_place)s at the age of %(age)d days."), ], - gen.lib.Person.FEMALE : [ + Person.FEMALE : [ _("She died %(death_date)s in %(death_place)s."), _("She died %(death_date)s in %(death_place)s at the age of %(age)d years."), _("She died %(death_date)s in %(death_place)s at the age of %(age)d months."), _("She died %(death_date)s in %(death_place)s at the age of %(age)d days."), ], }, - { gen.lib.Person.UNKNOWN : [ + { Person.UNKNOWN : [ _("%(unknown_gender_name)s died %(death_date)s in %(death_place)s."), _("%(unknown_gender_name)s died %(death_date)s in %(death_place)s at the age of %(age)d years."), _("%(unknown_gender_name)s died %(death_date)s in %(death_place)s at the age of %(age)d months."), _("%(unknown_gender_name)s died %(death_date)s in %(death_place)s at the age of %(age)d days."), ], - gen.lib.Person.MALE : [ + Person.MALE : [ _("%(male_name)s died %(death_date)s in %(death_place)s."), _("%(male_name)s died %(death_date)s in %(death_place)s at the age of %(age)d years."), _("%(male_name)s died %(death_date)s in %(death_place)s at the age of %(age)d months."), _("%(male_name)s died %(death_date)s in %(death_place)s at the age of %(age)d days."), ], - gen.lib.Person.FEMALE : [ + Person.FEMALE : [ _("%(female_name)s died %(death_date)s in %(death_place)s."), _("%(female_name)s died %(death_date)s in %(death_place)s at the age of %(age)d years."), _("%(female_name)s died %(death_date)s in %(death_place)s at the age of %(age)d months."), @@ -252,38 +256,38 @@ died_modified_date_with_place = [ ] died_full_date_no_place = [ - { gen.lib.Person.UNKNOWN : [ + { Person.UNKNOWN : [ _("This person died on %(death_date)s."), _("This person died on %(death_date)s at the age of %(age)d years."), _("This person died on %(death_date)s at the age of %(age)d months."), _("This person died on %(death_date)s at the age of %(age)d days."), ], - gen.lib.Person.MALE : [ + Person.MALE : [ _("He died on %(death_date)s."), _("He died on %(death_date)s at the age of %(age)d years."), _("He died on %(death_date)s at the age of %(age)d months."), _("He died on %(death_date)s at the age of %(age)d days."), ], - gen.lib.Person.FEMALE : [ + Person.FEMALE : [ _("She died on %(death_date)s."), _("She died on %(death_date)s at the age of %(age)d years."), _("She died on %(death_date)s at the age of %(age)d months."), _("She died on %(death_date)s at the age of %(age)d days."), ], }, - { gen.lib.Person.UNKNOWN : [ + { Person.UNKNOWN : [ _("%(unknown_gender_name)s died on %(death_date)s."), _("%(unknown_gender_name)s died on %(death_date)s at the age of %(age)d years."), _("%(unknown_gender_name)s died on %(death_date)s at the age of %(age)d months."), _("%(unknown_gender_name)s died on %(death_date)s at the age of %(age)d days."), ], - gen.lib.Person.MALE : [ + Person.MALE : [ _("%(male_name)s died on %(death_date)s."), _("%(male_name)s died on %(death_date)s at the age of %(age)d years."), _("%(male_name)s died on %(death_date)s at the age of %(age)d months."), _("%(male_name)s died on %(death_date)s at the age of %(age)d days."), ], - gen.lib.Person.FEMALE : [ + Person.FEMALE : [ _("%(female_name)s died on %(death_date)s."), _("%(female_name)s died on %(death_date)s at the age of %(age)d years."), _("%(female_name)s died on %(death_date)s at the age of %(age)d months."), @@ -299,38 +303,38 @@ died_full_date_no_place = [ ] died_modified_date_no_place = [ - { gen.lib.Person.UNKNOWN : [ + { Person.UNKNOWN : [ _("This person died %(death_date)s."), _("This person died %(death_date)s at the age of %(age)d years."), _("This person died %(death_date)s at the age of %(age)d months."), _("This person died %(death_date)s at the age of %(age)d days."), ], - gen.lib.Person.MALE : [ + Person.MALE : [ _("He died %(death_date)s."), _("He died %(death_date)s at the age of %(age)d years."), _("He died %(death_date)s at the age of %(age)d months."), _("He died %(death_date)s at the age of %(age)d days."), ], - gen.lib.Person.FEMALE : [ + Person.FEMALE : [ _("She died %(death_date)s."), _("She died %(death_date)s at the age of %(age)d years."), _("She died %(death_date)s at the age of %(age)d months."), _("She died %(death_date)s at the age of %(age)d days."), ], }, - { gen.lib.Person.UNKNOWN : [ + { Person.UNKNOWN : [ _("%(unknown_gender_name)s died %(death_date)s."), _("%(unknown_gender_name)s died %(death_date)s at the age of %(age)d years."), _("%(unknown_gender_name)s died %(death_date)s at the age of %(age)d months."), _("%(unknown_gender_name)s died %(death_date)s at the age of %(age)d days."), ], - gen.lib.Person.MALE : [ + Person.MALE : [ _("%(male_name)s died %(death_date)s."), _("%(male_name)s died %(death_date)s at the age of %(age)d years."), _("%(male_name)s died %(death_date)s at the age of %(age)d months."), _("%(male_name)s died %(death_date)s at the age of %(age)d days."), ], - gen.lib.Person.FEMALE : [ + Person.FEMALE : [ _("%(female_name)s died %(death_date)s."), _("%(female_name)s died %(death_date)s at the age of %(age)d years."), _("%(female_name)s died %(death_date)s at the age of %(age)d months."), @@ -346,38 +350,38 @@ died_modified_date_no_place = [ ] died_partial_date_with_place = [ - { gen.lib.Person.UNKNOWN : [ + { Person.UNKNOWN : [ _("This person died in %(month_year)s in %(death_place)s."), _("This person died in %(month_year)s in %(death_place)s at the age of %(age)d years."), _("This person died in %(month_year)s in %(death_place)s at the age of %(age)d months."), _("This person died in %(month_year)s in %(death_place)s at the age of %(age)d days."), ], - gen.lib.Person.MALE : [ + Person.MALE : [ _("He died in %(month_year)s in %(death_place)s."), _("He died in %(month_year)s in %(death_place)s at the age of %(age)d years."), _("He died in %(month_year)s in %(death_place)s at the age of %(age)d months."), _("He died in %(month_year)s in %(death_place)s at the age of %(age)d days."), ], - gen.lib.Person.FEMALE : [ + Person.FEMALE : [ _("She died in %(month_year)s in %(death_place)s."), _("She died in %(month_year)s in %(death_place)s at the age of %(age)d years."), _("She died in %(month_year)s in %(death_place)s at the age of %(age)d months."), _("She died in %(month_year)s in %(death_place)s at the age of %(age)d days."), ] }, - { gen.lib.Person.UNKNOWN : [ + { Person.UNKNOWN : [ _("%(unknown_gender_name)s died in %(month_year)s in %(death_place)s."), _("%(unknown_gender_name)s died in %(month_year)s in %(death_place)s at the age of %(age)d years."), _("%(unknown_gender_name)s died in %(month_year)s in %(death_place)s at the age of %(age)d months."), _("%(unknown_gender_name)s died in %(month_year)s in %(death_place)s at the age of %(age)d days."), ], - gen.lib.Person.MALE : [ + Person.MALE : [ _("%(male_name)s died in %(month_year)s in %(death_place)s."), _("%(male_name)s died in %(month_year)s in %(death_place)s at the age of %(age)d years."), _("%(male_name)s died in %(month_year)s in %(death_place)s at the age of %(age)d months."), _("%(male_name)s died in %(month_year)s in %(death_place)s at the age of %(age)d days."), ], - gen.lib.Person.FEMALE : [ + Person.FEMALE : [ _("%(female_name)s died in %(month_year)s in %(death_place)s."), _("%(female_name)s died in %(month_year)s in %(death_place)s at the age of %(age)d years."), _("%(female_name)s died in %(month_year)s in %(death_place)s at the age of %(age)d months."), @@ -393,38 +397,38 @@ died_partial_date_with_place = [ ] died_partial_date_no_place = [ - { gen.lib.Person.UNKNOWN : [ + { Person.UNKNOWN : [ _("This person died in %(month_year)s."), _("This person died in %(month_year)s at the age of %(age)d years."), _("This person died in %(month_year)s at the age of %(age)d months."), _("This person died in %(month_year)s at the age of %(age)d days."), ], - gen.lib.Person.MALE : [ + Person.MALE : [ _("He died in %(month_year)s."), _("He died in %(month_year)s at the age of %(age)d years."), _("He died in %(month_year)s at the age of %(age)d months."), _("He died in %(month_year)s at the age of %(age)d days."), ], - gen.lib.Person.FEMALE : [ + Person.FEMALE : [ _("She died in %(month_year)s."), _("She died in %(month_year)s at the age of %(age)d years."), _("She died in %(month_year)s at the age of %(age)d months."), _("She died in %(month_year)s at the age of %(age)d days."), ], }, - { gen.lib.Person.UNKNOWN : [ + { Person.UNKNOWN : [ _("%(unknown_gender_name)s died in %(month_year)s."), _("%(unknown_gender_name)s died in %(month_year)s at the age of %(age)d years."), _("%(unknown_gender_name)s died in %(month_year)s at the age of %(age)d months."), _("%(unknown_gender_name)s died in %(month_year)s at the age of %(age)d days."), ], - gen.lib.Person.MALE : [ + Person.MALE : [ _("%(male_name)s died in %(month_year)s."), _("%(male_name)s died in %(month_year)s at the age of %(age)d years."), _("%(male_name)s died in %(month_year)s at the age of %(age)d months."), _("%(male_name)s died in %(month_year)s at the age of %(age)d days."), ], - gen.lib.Person.FEMALE : [ + Person.FEMALE : [ _("%(female_name)s died in %(month_year)s."), _("%(female_name)s died in %(month_year)s at the age of %(age)d years."), _("%(female_name)s died in %(month_year)s at the age of %(age)d months."), @@ -441,38 +445,38 @@ died_partial_date_no_place = [ died_no_date_with_place = [ { - gen.lib.Person.UNKNOWN : [ + Person.UNKNOWN : [ _("This person died in %(death_place)s."), _("This person died in %(death_place)s at the age of %(age)d years."), _("This person died in %(death_place)s at the age of %(age)d months."), _("This person died in %(death_place)s at the age of %(age)d days."), ], - gen.lib.Person.MALE : [ + Person.MALE : [ _("He died in %(death_place)s."), _("He died in %(death_place)s at the age of %(age)d years."), _("He died in %(death_place)s at the age of %(age)d months."), _("He died in %(death_place)s at the age of %(age)d days."), ], - gen.lib.Person.FEMALE : [ + Person.FEMALE : [ _("She died in %(death_place)s."), _("She died in %(death_place)s at the age of %(age)d years."), _("She died in %(death_place)s at the age of %(age)d months."), _("She died in %(death_place)s at the age of %(age)d days."), ], }, - { gen.lib.Person.UNKNOWN : [ + { Person.UNKNOWN : [ _("%(unknown_gender_name)s died in %(death_place)s."), _("%(unknown_gender_name)s died in %(death_place)s at the age of %(age)d years."), _("%(unknown_gender_name)s died in %(death_place)s at the age of %(age)d months."), _("%(unknown_gender_name)s died in %(death_place)s at the age of %(age)d days."), ], - gen.lib.Person.MALE : [ + Person.MALE : [ _("%(male_name)s died in %(death_place)s."), _("%(male_name)s died in %(death_place)s at the age of %(age)d years."), _("%(male_name)s died in %(death_place)s at the age of %(age)d months."), _("%(male_name)s died in %(death_place)s at the age of %(age)d days."), ], - gen.lib.Person.FEMALE : [ + Person.FEMALE : [ _("%(female_name)s died in %(death_place)s."), _("%(female_name)s died in %(death_place)s at the age of %(age)d years."), _("%(female_name)s died in %(death_place)s at the age of %(age)d months."), @@ -488,38 +492,38 @@ died_no_date_with_place = [ ] died_no_date_no_place = [ - { gen.lib.Person.UNKNOWN : [ + { Person.UNKNOWN : [ "", _("This person died at the age of %(age)d years."), _("This person died at the age of %(age)d months."), _("This person died at the age of %(age)d days."), ], - gen.lib.Person.MALE : [ + Person.MALE : [ "", _("He died at the age of %(age)d years."), _("He died at the age of %(age)d months."), _("He died at the age of %(age)d days."), ], - gen.lib.Person.FEMALE : [ + Person.FEMALE : [ "", _("She died at the age of %(age)d years."), _("She died at the age of %(age)d months."), _("She died at the age of %(age)d days."), ], }, - { gen.lib.Person.UNKNOWN : [ + { Person.UNKNOWN : [ "", _("%(unknown_gender_name)s died at the age of %(age)d years."), _("%(unknown_gender_name)s died at the age of %(age)d months."), _("%(unknown_gender_name)s died at the age of %(age)d days."), ], - gen.lib.Person.MALE : [ + Person.MALE : [ "", _("%(male_name)s died at the age of %(age)d years."), _("%(male_name)s died at the age of %(age)d months."), _("%(male_name)s died at the age of %(age)d days."), ], - gen.lib.Person.FEMALE : [ + Person.FEMALE : [ "", _("%(female_name)s died at the age of %(age)d years."), _("%(female_name)s died at the age of %(age)d months."), @@ -541,120 +545,120 @@ died_no_date_no_place = [ #------------------------------------------------------------------------ buried_full_date_place = { - gen.lib.Person.MALE: [ + Person.MALE: [ _("%(male_name)s was buried on %(burial_date)s in %(burial_place)s."), _("He was buried on %(burial_date)s in %(burial_place)s."), ], - gen.lib.Person.FEMALE: [ + Person.FEMALE: [ _("%(female_name)s was buried on %(burial_date)s in %(burial_place)s."), _("She was buried on %(burial_date)s in %(burial_place)s."), ], - gen.lib.Person.UNKNOWN: [ + Person.UNKNOWN: [ _("%(unknown_gender_name)s was buried on %(burial_date)s in %(burial_place)s."), _("This person was buried on %(burial_date)s in %(burial_place)s."), ], } buried_full_date_no_place = { - gen.lib.Person.MALE: [ + Person.MALE: [ _("%(male_name)s was buried on %(burial_date)s."), _("He was buried on %(burial_date)s."), ], - gen.lib.Person.FEMALE: [ + Person.FEMALE: [ _("%(female_name)s was buried on %(burial_date)s."), _("She was buried on %(burial_date)s."), ], - gen.lib.Person.UNKNOWN: [ + Person.UNKNOWN: [ _("%(unknown_gender_name)s was buried on %(burial_date)s."), _("This person was buried on %(burial_date)s."), ], } buried_partial_date_place = { - gen.lib.Person.MALE: [ + Person.MALE: [ _("%(male_name)s was buried in %(month_year)s in %(burial_place)s."), _("He was buried in %(month_year)s in %(burial_place)s."), ], - gen.lib.Person.FEMALE: [ + Person.FEMALE: [ _("%(female_name)s was buried in %(month_year)s in %(burial_place)s."), _("She was buried in %(month_year)s in %(burial_place)s."), ], - gen.lib.Person.UNKNOWN: [ + Person.UNKNOWN: [ _("%(unknown_gender_name)s was buried in %(month_year)s in %(burial_place)s."), _("This person was buried in %(month_year)s in %(burial_place)s."), ], } buried_partial_date_no_place = { - gen.lib.Person.MALE: [ + Person.MALE: [ _("%(male_name)s was buried in %(month_year)s."), _("He was buried in %(month_year)s."), ], - gen.lib.Person.FEMALE: [ + Person.FEMALE: [ _("%(female_name)s was buried in %(month_year)s."), _("She was buried in %(month_year)s."), ], - gen.lib.Person.UNKNOWN: [ + Person.UNKNOWN: [ _("%(unknown_gender_name)s was buried in %(month_year)s."), _("This person was buried in %(month_year)s."), ], } buried_modified_date_place = { - gen.lib.Person.MALE: [ + Person.MALE: [ _("%(male_name)s was buried %(modified_date)s in %(burial_place)s."), _("He was buried %(modified_date)s in %(burial_place)s."), ], - gen.lib.Person.FEMALE: [ + Person.FEMALE: [ _("%(female_name)s was buried %(modified_date)s in %(burial_place)s."), _("She was buried %(modified_date)s in %(burial_place)s."), ], - gen.lib.Person.UNKNOWN: [ + Person.UNKNOWN: [ _("%(unknown_gender_name)s was buried %(modified_date)s in %(burial_place)s."), _("This person was buried %(modified_date)s in %(burial_place)s."), ], } buried_modified_date_no_place = { - gen.lib.Person.MALE: [ + Person.MALE: [ _("%(male_name)s was buried %(modified_date)s."), _("He was buried %(modified_date)s."), ], - gen.lib.Person.FEMALE: [ + Person.FEMALE: [ _("%(female_name)s was buried %(modified_date)s."), _("She was buried %(modified_date)s."), ], - gen.lib.Person.UNKNOWN: [ + Person.UNKNOWN: [ _("%(unknown_gender_name)s was buried %(modified_date)s."), _("This person was buried %(modified_date)s."), ], } buried_no_date_place = { - gen.lib.Person.MALE : [ + Person.MALE : [ _("%(male_name)s was buried in %(burial_place)s."), _("He was buried in %(burial_place)s."), ], - gen.lib.Person.FEMALE : [ + Person.FEMALE : [ _("%(female_name)s was buried in %(burial_place)s."), _("She was buried in %(burial_place)s."), ], - gen.lib.Person.UNKNOWN : [ + Person.UNKNOWN : [ _("%(unknown_gender_name)s was buried in %(burial_place)s."), _("This person was buried in %(burial_place)s."), ], } buried_no_date_no_place = { - gen.lib.Person.MALE : [ + Person.MALE : [ _("%(male_name)s was buried."), _("He was buried."), ], - gen.lib.Person.FEMALE : [ + Person.FEMALE : [ _("%(female_name)s was buried."), _("She was buried."), ], - gen.lib.Person.UNKNOWN : [ + Person.UNKNOWN : [ _("%(unknown_gender_name)s was buried."), _("This person was buried."), ] @@ -667,17 +671,17 @@ buried_no_date_no_place = { #------------------------------------------------------------------------ marriage_first_date_place = { - gen.lib.Person.UNKNOWN : [ + Person.UNKNOWN : [ _('This person married %(spouse)s in %(partial_date)s in %(place)s%(endnotes)s.'), _('This person married %(spouse)s on %(full_date)s in %(place)s%(endnotes)s.'), _('This person married %(spouse)s %(modified_date)s in %(place)s%(endnotes)s.'), ], - gen.lib.Person.MALE : [ + Person.MALE : [ _('He married %(spouse)s in %(partial_date)s in %(place)s%(endnotes)s.'), _('He married %(spouse)s on %(full_date)s in %(place)s%(endnotes)s.'), _('He married %(spouse)s %(modified_date)s in %(place)s%(endnotes)s.'), ], - gen.lib.Person.FEMALE : [ + Person.FEMALE : [ _('She married %(spouse)s in %(partial_date)s in %(place)s%(endnotes)s.'), _('She married %(spouse)s on %(full_date)s in %(place)s%(endnotes)s.'), _('She married %(spouse)s %(modified_date)s in %(place)s%(endnotes)s.'), @@ -690,17 +694,17 @@ marriage_first_date_place = { } marriage_also_date_place = { - gen.lib.Person.UNKNOWN : [ + Person.UNKNOWN : [ _('This person also married %(spouse)s in %(partial_date)s in %(place)s%(endnotes)s.'), _('This person also married %(spouse)s on %(full_date)s in %(place)s%(endnotes)s.'), _('This person also married %(spouse)s %(modified_date)s in %(place)s%(endnotes)s.'), ], - gen.lib.Person.MALE : [ + Person.MALE : [ _('He also married %(spouse)s in %(partial_date)s in %(place)s%(endnotes)s.'), _('He also married %(spouse)s on %(full_date)s in %(place)s%(endnotes)s.'), _('He also married %(spouse)s %(modified_date)s in %(place)s%(endnotes)s.'), ], - gen.lib.Person.FEMALE : [ + Person.FEMALE : [ _('She also married %(spouse)s in %(partial_date)s in %(place)s%(endnotes)s.'), _('She also married %(spouse)s on %(full_date)s in %(place)s%(endnotes)s.'), _('She also married %(spouse)s %(modified_date)s in %(place)s%(endnotes)s.'), @@ -713,17 +717,17 @@ marriage_also_date_place = { } marriage_first_date = { - gen.lib.Person.UNKNOWN : [ + Person.UNKNOWN : [ _('This person married %(spouse)s in %(partial_date)s%(endnotes)s.'), _('This person married %(spouse)s on %(full_date)s%(endnotes)s.'), _('This person married %(spouse)s %(modified_date)s%(endnotes)s.'), ], - gen.lib.Person.MALE : [ + Person.MALE : [ _('He married %(spouse)s in %(partial_date)s%(endnotes)s.'), _('He married %(spouse)s on %(full_date)s%(endnotes)s.'), _('He married %(spouse)s %(modified_date)s%(endnotes)s.'), ], - gen.lib.Person.FEMALE : [ + Person.FEMALE : [ _('She married %(spouse)s in %(partial_date)s%(endnotes)s.'), _('She married %(spouse)s on %(full_date)s%(endnotes)s.'), _('She married %(spouse)s %(modified_date)s%(endnotes)s.'), @@ -736,17 +740,17 @@ marriage_first_date = { } marriage_also_date = { - gen.lib.Person.UNKNOWN : [ + Person.UNKNOWN : [ _('This person also married %(spouse)s in %(partial_date)s%(endnotes)s.'), _('This person also married %(spouse)s on %(full_date)s%(endnotes)s.'), _('This person also married %(spouse)s %(modified_date)s%(endnotes)s.'), ], - gen.lib.Person.MALE : [ + Person.MALE : [ _('He also married %(spouse)s in %(partial_date)s%(endnotes)s.'), _('He also married %(spouse)s on %(full_date)s%(endnotes)s.'), _('He also married %(spouse)s %(modified_date)s%(endnotes)s.'), ], - gen.lib.Person.FEMALE : [ + Person.FEMALE : [ _('She also married %(spouse)s in %(partial_date)s%(endnotes)s.'), _('She also married %(spouse)s on %(full_date)s%(endnotes)s.'), _('She also married %(spouse)s %(modified_date)s%(endnotes)s.'), @@ -759,30 +763,30 @@ marriage_also_date = { } marriage_first_place = { - gen.lib.Person.UNKNOWN : _('This person married %(spouse)s in %(place)s%(endnotes)s.'), - gen.lib.Person.MALE : _('He married %(spouse)s in %(place)s%(endnotes)s.'), - gen.lib.Person.FEMALE : _('She married %(spouse)s in %(place)s%(endnotes)s.'), + Person.UNKNOWN : _('This person married %(spouse)s in %(place)s%(endnotes)s.'), + Person.MALE : _('He married %(spouse)s in %(place)s%(endnotes)s.'), + Person.FEMALE : _('She married %(spouse)s in %(place)s%(endnotes)s.'), 'succinct' : _('Married %(spouse)s in %(place)s%(endnotes)s.'), } marriage_also_place = { - gen.lib.Person.UNKNOWN : _('This person also married %(spouse)s in %(place)s%(endnotes)s.'), - gen.lib.Person.MALE : _('He also married %(spouse)s in %(place)s%(endnotes)s.'), - gen.lib.Person.FEMALE : _('She also married %(spouse)s in %(place)s%(endnotes)s.'), + Person.UNKNOWN : _('This person also married %(spouse)s in %(place)s%(endnotes)s.'), + Person.MALE : _('He also married %(spouse)s in %(place)s%(endnotes)s.'), + Person.FEMALE : _('She also married %(spouse)s in %(place)s%(endnotes)s.'), 'succinct' : _('Also married %(spouse)s in %(place)s%(endnotes)s.'), } marriage_first_only = { - gen.lib.Person.UNKNOWN : _('This person married %(spouse)s%(endnotes)s.'), - gen.lib.Person.MALE : _('He married %(spouse)s%(endnotes)s.'), - gen.lib.Person.FEMALE : _('She married %(spouse)s%(endnotes)s.'), + Person.UNKNOWN : _('This person married %(spouse)s%(endnotes)s.'), + Person.MALE : _('He married %(spouse)s%(endnotes)s.'), + Person.FEMALE : _('She married %(spouse)s%(endnotes)s.'), 'succinct' : _('Married %(spouse)s%(endnotes)s.'), } marriage_also_only = { - gen.lib.Person.UNKNOWN : _('This person also married %(spouse)s%(endnotes)s.'), - gen.lib.Person.MALE : _('He also married %(spouse)s%(endnotes)s.'), - gen.lib.Person.FEMALE : _('She also married %(spouse)s%(endnotes)s.'), + Person.UNKNOWN : _('This person also married %(spouse)s%(endnotes)s.'), + Person.MALE : _('He also married %(spouse)s%(endnotes)s.'), + Person.FEMALE : _('She also married %(spouse)s%(endnotes)s.'), 'succinct' : _('Also married %(spouse)s%(endnotes)s.'), } @@ -793,17 +797,17 @@ marriage_also_only = { #------------------------------------------------------------------------ unmarried_first_date_place = { - gen.lib.Person.UNKNOWN : [ + Person.UNKNOWN : [ _('This person had an unmarried relationship with %(spouse)s in %(partial_date)s in %(place)s%(endnotes)s.'), _('This person had an unmarried relationship with %(spouse)s on %(full_date)s in %(place)s%(endnotes)s.'), _('This person had an unmarried relationship with %(spouse)s %(modified_date)s in %(place)s%(endnotes)s.'), ], - gen.lib.Person.MALE : [ + Person.MALE : [ _('He had an unmarried relationship with %(spouse)s in %(partial_date)s in %(place)s%(endnotes)s.'), _('He had an unmarried relationship with %(spouse)s on %(full_date)s in %(place)s%(endnotes)s.'), _('He had an unmarried relationship with %(spouse)s %(modified_date)s in %(place)s%(endnotes)s.'), ], - gen.lib.Person.FEMALE : [ + Person.FEMALE : [ _('She had an unmarried relationship with %(spouse)s in %(partial_date)s in %(place)s%(endnotes)s.'), _('She had an unmarried relationship with %(spouse)s on %(full_date)s in %(place)s%(endnotes)s.'), _('She had an unmarried relationship with %(spouse)s %(modified_date)s in %(place)s%(endnotes)s.'), @@ -816,17 +820,17 @@ unmarried_first_date_place = { } unmarried_also_date_place = { - gen.lib.Person.UNKNOWN : [ + Person.UNKNOWN : [ _('This person also had an unmarried relationship with %(spouse)s in %(partial_date)s in %(place)s%(endnotes)s.'), _('This person also had an unmarried relationship with %(spouse)s on %(full_date)s in %(place)s%(endnotes)s.'), _('This person also had an unmarried relationship with %(spouse)s %(modified_date)s in %(place)s%(endnotes)s.'), ], - gen.lib.Person.MALE : [ + Person.MALE : [ _('He also had an unmarried relationship with %(spouse)s in %(partial_date)s in %(place)s%(endnotes)s.'), _('He also had an unmarried relationship with %(spouse)s on %(full_date)s in %(place)s%(endnotes)s.'), _('He also had an unmarried relationship with %(spouse)s %(modified_date)s in %(place)s%(endnotes)s.'), ], - gen.lib.Person.FEMALE : [ + Person.FEMALE : [ _('She also had an unmarried relationship with %(spouse)s in %(partial_date)s in %(place)s%(endnotes)s.'), _('She also had an unmarried relationship with %(spouse)s on %(full_date)s in %(place)s%(endnotes)s.'), _('She also had an unmarried relationship with %(spouse)s %(modified_date)s in %(place)s%(endnotes)s.'), @@ -839,17 +843,17 @@ unmarried_also_date_place = { } unmarried_first_date = { - gen.lib.Person.UNKNOWN : [ + Person.UNKNOWN : [ _('This person had an unmarried relationship with %(spouse)s in %(partial_date)s%(endnotes)s.'), _('This person had an unmarried relationship with %(spouse)s on %(full_date)s%(endnotes)s.'), _('This person had an unmarried relationship with %(spouse)s %(modified_date)s%(endnotes)s.'), ], - gen.lib.Person.MALE : [ + Person.MALE : [ _('He had an unmarried relationship with %(spouse)s in %(partial_date)s%(endnotes)s.'), _('He had an unmarried relationship with %(spouse)s on %(full_date)s%(endnotes)s.'), _('He had an unmarried relationship with %(spouse)s %(modified_date)s%(endnotes)s.'), ], - gen.lib.Person.FEMALE : [ + Person.FEMALE : [ _('She had an unmarried relationship with %(spouse)s in %(partial_date)s%(endnotes)s.'), _('She had an unmarried relationship with %(spouse)s on %(full_date)s%(endnotes)s.'), _('She had an unmarried relationship with %(spouse)s %(modified_date)s%(endnotes)s.'), @@ -862,17 +866,17 @@ unmarried_first_date = { } unmarried_also_date = { - gen.lib.Person.UNKNOWN : [ + Person.UNKNOWN : [ _('This person also had an unmarried relationship with %(spouse)s in %(partial_date)s%(endnotes)s.'), _('This person also had an unmarried relationship with %(spouse)s on %(full_date)s%(endnotes)s.'), _('This person also had an unmarried relationship with %(spouse)s %(modified_date)s%(endnotes)s.'), ], - gen.lib.Person.MALE : [ + Person.MALE : [ _('He also had an unmarried relationship with %(spouse)s in %(partial_date)s%(endnotes)s.'), _('He also had an unmarried relationship with %(spouse)s on %(full_date)s%(endnotes)s.'), _('He also had an unmarried relationship with %(spouse)s %(modified_date)s%(endnotes)s.'), ], - gen.lib.Person.FEMALE : [ + Person.FEMALE : [ _('She also had an unmarried relationship with %(spouse)s in %(partial_date)s%(endnotes)s.'), _('She also had an unmarried relationship with %(spouse)s on %(full_date)s%(endnotes)s.'), _('She also had an unmarried relationship with %(spouse)s %(modified_date)s%(endnotes)s.'), @@ -885,30 +889,30 @@ unmarried_also_date = { } unmarried_first_place = { - gen.lib.Person.UNKNOWN : _('This person had an unmarried relationship with %(spouse)s in %(place)s%(endnotes)s.'), - gen.lib.Person.MALE : _('He had an unmarried relationship with %(spouse)s in %(place)s%(endnotes)s.'), - gen.lib.Person.FEMALE : _('She had an unmarried relationship with %(spouse)s in %(place)s%(endnotes)s.'), + Person.UNKNOWN : _('This person had an unmarried relationship with %(spouse)s in %(place)s%(endnotes)s.'), + Person.MALE : _('He had an unmarried relationship with %(spouse)s in %(place)s%(endnotes)s.'), + Person.FEMALE : _('She had an unmarried relationship with %(spouse)s in %(place)s%(endnotes)s.'), 'succinct' : _('Unmarried relationship with %(spouse)s in %(place)s%(endnotes)s.'), } unmarried_also_place = { - gen.lib.Person.UNKNOWN : _('This person also had an unmarried relationship with %(spouse)s in %(place)s%(endnotes)s.'), - gen.lib.Person.MALE : _('He also had an unmarried relationship with %(spouse)s in %(place)s%(endnotes)s.'), - gen.lib.Person.FEMALE : _('She also had an unmarried relationship with %(spouse)s in %(place)s%(endnotes)s.'), + Person.UNKNOWN : _('This person also had an unmarried relationship with %(spouse)s in %(place)s%(endnotes)s.'), + Person.MALE : _('He also had an unmarried relationship with %(spouse)s in %(place)s%(endnotes)s.'), + Person.FEMALE : _('She also had an unmarried relationship with %(spouse)s in %(place)s%(endnotes)s.'), 'succinct' : _('Unmarried relationship with %(spouse)s in %(place)s%(endnotes)s.'), } unmarried_first_only = { - gen.lib.Person.UNKNOWN : _('This person had an unmarried relationship with %(spouse)s%(endnotes)s.'), - gen.lib.Person.MALE : _('He had an unmarried relationship with %(spouse)s%(endnotes)s.'), - gen.lib.Person.FEMALE : _('She had an unmarried relationship with %(spouse)s%(endnotes)s.'), + Person.UNKNOWN : _('This person had an unmarried relationship with %(spouse)s%(endnotes)s.'), + Person.MALE : _('He had an unmarried relationship with %(spouse)s%(endnotes)s.'), + Person.FEMALE : _('She had an unmarried relationship with %(spouse)s%(endnotes)s.'), 'succinct' : _('Unmarried relationship with %(spouse)s%(endnotes)s.'), } unmarried_also_only = { - gen.lib.Person.UNKNOWN : _('This person also had an unmarried relationship with %(spouse)s%(endnotes)s.'), - gen.lib.Person.MALE : _('He also had an unmarried relationship with %(spouse)s%(endnotes)s.'), - gen.lib.Person.FEMALE : _('She also had an unmarried relationship with %(spouse)s%(endnotes)s.'), + Person.UNKNOWN : _('This person also had an unmarried relationship with %(spouse)s%(endnotes)s.'), + Person.MALE : _('He also had an unmarried relationship with %(spouse)s%(endnotes)s.'), + Person.FEMALE : _('She also had an unmarried relationship with %(spouse)s%(endnotes)s.'), 'succinct' : _('Unmarried relationship with %(spouse)s%(endnotes)s.'), } @@ -920,17 +924,17 @@ unmarried_also_only = { #------------------------------------------------------------------------ relationship_first_date_place = { - gen.lib.Person.UNKNOWN : [ + Person.UNKNOWN : [ _('This person had a relationship with %(spouse)s in %(partial_date)s in %(place)s%(endnotes)s.'), _('This person had a relationship with %(spouse)s on %(full_date)s in %(place)s%(endnotes)s.'), _('This person had a relationship with %(spouse)s %(modified_date)s in %(place)s%(endnotes)s.'), ], - gen.lib.Person.MALE : [ + Person.MALE : [ _('He had a relationship with %(spouse)s in %(partial_date)s in %(place)s%(endnotes)s.'), _('He had a relationship with %(spouse)s on %(full_date)s in %(place)s%(endnotes)s.'), _('He had a relationship with %(spouse)s %(modified_date)s in %(place)s%(endnotes)s.'), ], - gen.lib.Person.FEMALE : [ + Person.FEMALE : [ _('She had a relationship with %(spouse)s in %(partial_date)s in %(place)s%(endnotes)s.'), _('She had a relationship with %(spouse)s on %(full_date)s in %(place)s%(endnotes)s.'), _('She had a relationship with %(spouse)s %(modified_date)s in %(place)s%(endnotes)s.'), @@ -943,17 +947,17 @@ relationship_first_date_place = { } relationship_also_date_place = { - gen.lib.Person.UNKNOWN : [ + Person.UNKNOWN : [ _('This person also had a relationship with %(spouse)s in %(partial_date)s in %(place)s%(endnotes)s.'), _('This person also had a relationship with %(spouse)s on %(full_date)s in %(place)s%(endnotes)s.'), _('This person also had a relationship with %(spouse)s %(modified_date)s in %(place)s%(endnotes)s.'), ], - gen.lib.Person.MALE : [ + Person.MALE : [ _('He also had a relationship with %(spouse)s in %(partial_date)s in %(place)s%(endnotes)s.'), _('He also had a relationship with %(spouse)s on %(full_date)s in %(place)s%(endnotes)s.'), _('He also had a relationship with %(spouse)s %(modified_date)s in %(place)s%(endnotes)s.'), ], - gen.lib.Person.FEMALE : [ + Person.FEMALE : [ _('She also had a relationship with %(spouse)s in %(partial_date)s in %(place)s%(endnotes)s.'), _('She also had a relationship with %(spouse)s on %(full_date)s in %(place)s%(endnotes)s.'), _('She also had a relationship with %(spouse)s %(modified_date)s in %(place)s%(endnotes)s.'), @@ -966,17 +970,17 @@ relationship_also_date_place = { } relationship_first_date = { - gen.lib.Person.UNKNOWN : [ + Person.UNKNOWN : [ _('This person had a relationship with %(spouse)s in %(partial_date)s%(endnotes)s.'), _('This person had a relationship with %(spouse)s on %(full_date)s%(endnotes)s.'), _('This person had a relationship with %(spouse)s %(modified_date)s%(endnotes)s.'), ], - gen.lib.Person.MALE : [ + Person.MALE : [ _('He had a relationship with %(spouse)s in %(partial_date)s%(endnotes)s.'), _('He had a relationship with %(spouse)s on %(full_date)s%(endnotes)s.'), _('He had a relationship with %(spouse)s %(modified_date)s%(endnotes)s.'), ], - gen.lib.Person.FEMALE : [ + Person.FEMALE : [ _('She had a relationship with %(spouse)s in %(partial_date)s%(endnotes)s.'), _('She had a relationship with %(spouse)s on %(full_date)s%(endnotes)s.'), _('She had a relationship with %(spouse)s %(modified_date)s%(endnotes)s.'), @@ -989,17 +993,17 @@ relationship_first_date = { } relationship_also_date = { - gen.lib.Person.UNKNOWN : [ + Person.UNKNOWN : [ _('This person also had a relationship with %(spouse)s in %(partial_date)s%(endnotes)s.'), _('This person also had a relationship with %(spouse)s on %(full_date)s%(endnotes)s.'), _('This person also had a relationship with %(spouse)s %(modified_date)s%(endnotes)s.'), ], - gen.lib.Person.MALE : [ + Person.MALE : [ _('He also had a relationship with %(spouse)s in %(partial_date)s%(endnotes)s.'), _('He also had a relationship with %(spouse)s on %(full_date)s%(endnotes)s.'), _('He also had a relationship with %(spouse)s %(modified_date)s%(endnotes)s.'), ], - gen.lib.Person.FEMALE : [ + Person.FEMALE : [ _('She also had a relationship with %(spouse)s in %(partial_date)s%(endnotes)s.'), _('She also had a relationship with %(spouse)s on %(full_date)s%(endnotes)s.'), _('She also had a relationship with %(spouse)s %(modified_date)s%(endnotes)s.'), @@ -1012,30 +1016,30 @@ relationship_also_date = { } relationship_first_place = { - gen.lib.Person.UNKNOWN : _('This person had a relationship with %(spouse)s in %(place)s%(endnotes)s.'), - gen.lib.Person.MALE : _('He had a relationship with %(spouse)s in %(place)s%(endnotes)s.'), - gen.lib.Person.FEMALE : _('She had a relationship with %(spouse)s in %(place)s%(endnotes)s.'), + Person.UNKNOWN : _('This person had a relationship with %(spouse)s in %(place)s%(endnotes)s.'), + Person.MALE : _('He had a relationship with %(spouse)s in %(place)s%(endnotes)s.'), + Person.FEMALE : _('She had a relationship with %(spouse)s in %(place)s%(endnotes)s.'), 'succinct' : _('Relationship with %(spouse)s in %(place)s%(endnotes)s.'), } relationship_also_place = { - gen.lib.Person.UNKNOWN : _('This person also had a relationship with %(spouse)s in %(place)s%(endnotes)s.'), - gen.lib.Person.MALE : _('He also had a relationship with %(spouse)s in %(place)s%(endnotes)s.'), - gen.lib.Person.FEMALE : _('She also had a relationship with %(spouse)s in %(place)s%(endnotes)s.'), + Person.UNKNOWN : _('This person also had a relationship with %(spouse)s in %(place)s%(endnotes)s.'), + Person.MALE : _('He also had a relationship with %(spouse)s in %(place)s%(endnotes)s.'), + Person.FEMALE : _('She also had a relationship with %(spouse)s in %(place)s%(endnotes)s.'), 'succinct' : _('Also relationship with %(spouse)s in %(place)s%(endnotes)s.'), } relationship_first_only = { - gen.lib.Person.UNKNOWN : _('This person had a relationship with %(spouse)s%(endnotes)s.'), - gen.lib.Person.MALE : _('He had a relationship with %(spouse)s%(endnotes)s.'), - gen.lib.Person.FEMALE : _('She had a relationship with %(spouse)s%(endnotes)s.'), + Person.UNKNOWN : _('This person had a relationship with %(spouse)s%(endnotes)s.'), + Person.MALE : _('He had a relationship with %(spouse)s%(endnotes)s.'), + Person.FEMALE : _('She had a relationship with %(spouse)s%(endnotes)s.'), 'succinct' : _('Relationship with %(spouse)s%(endnotes)s.'), } relationship_also_only = { - gen.lib.Person.UNKNOWN : _('This person also had a relationship with %(spouse)s%(endnotes)s.'), - gen.lib.Person.MALE : _('He also had a relationship with %(spouse)s%(endnotes)s.'), - gen.lib.Person.FEMALE : _('She also had a relationship with %(spouse)s%(endnotes)s.'), + Person.UNKNOWN : _('This person also had a relationship with %(spouse)s%(endnotes)s.'), + Person.MALE : _('He also had a relationship with %(spouse)s%(endnotes)s.'), + Person.FEMALE : _('She also had a relationship with %(spouse)s%(endnotes)s.'), 'succinct' : _('Also relationship with %(spouse)s%(endnotes)s.'), } @@ -1046,7 +1050,7 @@ relationship_also_only = { #------------------------------------------------------------------------- child_father_mother = { - gen.lib.Person.UNKNOWN: [ + Person.UNKNOWN: [ [ _("This person is the child of %(father)s and %(mother)s."), _("This person was the child of %(father)s and %(mother)s."), @@ -1057,7 +1061,7 @@ child_father_mother = { ], _("Child of %(father)s and %(mother)s."), ], - gen.lib.Person.MALE : [ + Person.MALE : [ [ _("He is the son of %(father)s and %(mother)s."), _("He was the son of %(father)s and %(mother)s."), @@ -1068,7 +1072,7 @@ child_father_mother = { ], _("Son of %(father)s and %(mother)s."), ], - gen.lib.Person.FEMALE : [ + Person.FEMALE : [ [ _("She is the daughter of %(father)s and %(mother)s."), _("She was the daughter of %(father)s and %(mother)s."), @@ -1082,7 +1086,7 @@ child_father_mother = { } child_father = { - gen.lib.Person.UNKNOWN : [ + Person.UNKNOWN : [ [ _("This person is the child of %(father)s."), _("This person was the child of %(father)s."), @@ -1093,7 +1097,7 @@ child_father = { ], _("Child of %(father)s."), ], - gen.lib.Person.MALE : [ + Person.MALE : [ [ _("He is the son of %(father)s."), _("He was the son of %(father)s."), @@ -1104,7 +1108,7 @@ child_father = { ], _("Son of %(father)s."), ], - gen.lib.Person.FEMALE : [ + Person.FEMALE : [ [ _("She is the daughter of %(father)s."), _("She was the daughter of %(father)s."), @@ -1118,7 +1122,7 @@ child_father = { } child_mother = { - gen.lib.Person.UNKNOWN : [ + Person.UNKNOWN : [ [ _("This person is the child of %(mother)s."), _("This person was the child of %(mother)s."), @@ -1129,7 +1133,7 @@ child_mother = { ], _("Child of %(mother)s."), ], - gen.lib.Person.MALE : [ + Person.MALE : [ [ _("He is the son of %(mother)s."), _("He was the son of %(mother)s."), @@ -1140,7 +1144,7 @@ child_mother = { ], _("Son of %(mother)s."), ], - gen.lib.Person.FEMALE : [ + Person.FEMALE : [ [ _("She is the daughter of %(mother)s."), _("She was the daughter of %(mother)s."), @@ -1159,10 +1163,10 @@ child_mother = { # #------------------------------------------------------------------------- _rtype = { - gen.lib.FamilyRelType.UNMARRIED : _("unmarried"), - gen.lib.FamilyRelType.CIVIL_UNION : _("civil union"), - gen.lib.FamilyRelType.UNKNOWN : _("Unknown"), - gen.lib.FamilyRelType.CUSTOM : _("Other"), + FamilyRelType.UNMARRIED : _("unmarried"), + FamilyRelType.CIVIL_UNION : _("civil union"), + FamilyRelType.UNKNOWN : _("Unknown"), + FamilyRelType.CUSTOM : _("Other"), } #------------------------------------------------------------------------- @@ -1457,14 +1461,14 @@ def estimate_age(db, person, end_handle=None, start_handle=None, today=_TODAY): else: return high[2] - low[2] - if bstop == gen.lib.Date.EMPTY and dstop == gen.lib.Date.EMPTY: + if bstop == Date.EMPTY and dstop == Date.EMPTY: lower = _calc_diff(bstart, dstart) age = (lower, lower) - elif bstop == gen.lib.Date.EMPTY: + elif bstop == Date.EMPTY: lower = _calc_diff(bstart, dstart) upper = _calc_diff(bstart, dstop) age = (lower, upper) - elif dstop == gen.lib.Date.EMPTY: + elif dstop == Date.EMPTY: lower = _calc_diff(bstop, dstart) upper = _calc_diff(bstart, dstart) age = (lower, upper) @@ -1500,14 +1504,14 @@ def estimate_age_on_date(db, person, ddata=_TODAY): return high[2] - low[2] - 1 else: return high[2] - low[2] - if bstop == gen.lib.Date.EMPTY and dstop == gen.lib.Date.EMPTY: + if bstop == Date.EMPTY and dstop == Date.EMPTY: lower = _calc_diff(bstart, dstart) age = [lower, lower] - elif bstop == gen.lib.Date.EMPTY: + elif bstop == Date.EMPTY: lower = _calc_diff(bstart, dstart) upper = _calc_diff(bstart, dstop) age = [lower, upper] - elif dstop == gen.lib.Date.EMPTY: + elif dstop == Date.EMPTY: lower = _calc_diff(bstop, dstart) upper = _calc_diff(bstart, dstart) age = [lower, upper] @@ -1604,7 +1608,7 @@ def get_birth_death_strings(database, person, empty_date="", empty_place=""): bplace = database.get_place_from_handle(bplace_handle).get_title() bdate_obj = birth.get_date_object() bdate_full = bdate_obj and bdate_obj.get_day_valid() - bdate_mod = bdate_obj and bdate_obj.get_modifier() != gen.lib.Date.MOD_NONE + bdate_mod = bdate_obj and bdate_obj.get_modifier() != Date.MOD_NONE death_ref = person.get_death_ref() if death_ref and death_ref.ref: @@ -1616,7 +1620,7 @@ def get_birth_death_strings(database, person, empty_date="", empty_place=""): dplace = database.get_place_from_handle(dplace_handle).get_title() ddate_obj = death.get_date_object() ddate_full = ddate_obj and ddate_obj.get_day_valid() - ddate_mod = ddate_obj and ddate_obj.get_modifier() != gen.lib.Date.MOD_NONE + ddate_mod = ddate_obj and ddate_obj.get_modifier() != Date.MOD_NONE return (bdate, bplace, bdate_full, bdate_mod, ddate, dplace, ddate_full, ddate_mod) @@ -1654,7 +1658,7 @@ def born_died_str(database, person, endnotes=None, name_object=None, person_name if person_name == None: person_name = _nd.display_name(name_object) elif person_name == 0: - if person.get_gender() == gen.lib.Person.MALE: + if person.get_gender() == Person.MALE: person_name = _('He') else: person_name = _('She') @@ -1686,7 +1690,7 @@ def born_died_str(database, person, endnotes=None, name_object=None, person_name 'death_endnotes' : endnotes(death), } - if person.get_gender() == gen.lib.Person.MALE: + if person.get_gender() == Person.MALE: if bdate: if bplace: if ddate: @@ -1892,7 +1896,7 @@ def married_str(database, person, family, verbose=True, endnotes=None, if event: dobj = event.get_date_object() - if dobj.get_modifier() != gen.lib.Date.MOD_NONE: + if dobj.get_modifier() != Date.MOD_NONE: date_full = 2 elif dobj and dobj.get_day_valid(): date_full = 1 @@ -1915,115 +1919,115 @@ def married_str(database, person, family, verbose=True, endnotes=None, if is_first: if event and date and place and verbose: - if relationship == gen.lib.FamilyRelType.MARRIED: + if relationship == FamilyRelType.MARRIED: text = marriage_first_date_place[gender][date_full] % values - elif relationship == gen.lib.FamilyRelType.UNMARRIED: + elif relationship == FamilyRelType.UNMARRIED: text = unmarried_first_date_place[gender][date_full] % values else: text = relationship_first_date_place[gender][date_full] % values elif event and date and place: - if relationship == gen.lib.FamilyRelType.MARRIED: + if relationship == FamilyRelType.MARRIED: text = marriage_first_date_place['succinct'][date_full] % values - elif relationship == gen.lib.FamilyRelType.UNMARRIED: + elif relationship == FamilyRelType.UNMARRIED: text = unmarried_first_date_place['succinct'][date_full] % values else: text = relationship_first_date_place['succinct'][date_full] % values elif event and date and verbose: - if relationship == gen.lib.FamilyRelType.MARRIED: + if relationship == FamilyRelType.MARRIED: text = marriage_first_date[gender][date_full] % values - elif relationship == gen.lib.FamilyRelType.UNMARRIED: + elif relationship == FamilyRelType.UNMARRIED: text = unmarried_first_date[gender][date_full] % values else: text = relationship_first_date[gender][date_full] % values elif event and date: - if relationship == gen.lib.FamilyRelType.MARRIED: + if relationship == FamilyRelType.MARRIED: text = marriage_first_date['succinct'][date_full] % values - elif relationship == gen.lib.FamilyRelType.UNMARRIED: + elif relationship == FamilyRelType.UNMARRIED: text = unmarried_first_date['succinct'][date_full] % values else: text = relationship_first_date['succinct'][date_full] % values elif event and place and verbose: - if relationship == gen.lib.FamilyRelType.MARRIED: + if relationship == FamilyRelType.MARRIED: text = marriage_first_place[gender] % values - elif relationship == gen.lib.FamilyRelType.UNMARRIED: + elif relationship == FamilyRelType.UNMARRIED: text = unmarried_first_place[gender] % values else: text = relationship_first_place[gender] % values elif event and place: - if relationship == gen.lib.FamilyRelType.MARRIED: + if relationship == FamilyRelType.MARRIED: text = marriage_first_place['succinct'] % values - elif relationship == gen.lib.FamilyRelType.UNMARRIED: + elif relationship == FamilyRelType.UNMARRIED: text = unmarried_first_place['succinct'] % values else: text = relationship_first_place['succinct'] % values elif verbose: - if relationship == gen.lib.FamilyRelType.MARRIED: + if relationship == FamilyRelType.MARRIED: text = marriage_first_only[gender] % values - elif relationship == gen.lib.FamilyRelType.UNMARRIED: + elif relationship == FamilyRelType.UNMARRIED: text = unmarried_first_only[gender] % values else: text = relationship_first_only[gender] % values else: - if relationship == gen.lib.FamilyRelType.MARRIED: + if relationship == FamilyRelType.MARRIED: text = marriage_first_only['succinct'] % values - elif relationship == gen.lib.FamilyRelType.UNMARRIED: + elif relationship == FamilyRelType.UNMARRIED: text = unmarried_first_only['succinct'] % values else: text = relationship_first_only['succinct'] % values else: if event and date and place and verbose: - if relationship == gen.lib.FamilyRelType.MARRIED: + if relationship == FamilyRelType.MARRIED: text = marriage_also_date_place[gender][date_full] % values - elif relationship == gen.lib.FamilyRelType.UNMARRIED: + elif relationship == FamilyRelType.UNMARRIED: text = unmarried_also_date_place[gender][date_full] % values else: text = relationship_also_date_place[gender][date_full] % values if event and date and place: - if relationship == gen.lib.FamilyRelType.MARRIED: + if relationship == FamilyRelType.MARRIED: text = marriage_also_date_place['succinct'][date_full] % values - elif relationship == gen.lib.FamilyRelType.UNMARRIED: + elif relationship == FamilyRelType.UNMARRIED: text = unmarried_also_date_place['succinct'][date_full] % values else: text = relationship_also_date_place['succinct'][date_full] % values elif event and date and verbose: - if relationship == gen.lib.FamilyRelType.MARRIED: + if relationship == FamilyRelType.MARRIED: text = marriage_also_date[gender][date_full] % values - elif relationship == gen.lib.FamilyRelType.UNMARRIED: + elif relationship == FamilyRelType.UNMARRIED: text = unmarried_also_date[gender][date_full] % values else: text = relationship_also_date[gender][date_full] % values elif event and date: - if relationship == gen.lib.FamilyRelType.MARRIED: + if relationship == FamilyRelType.MARRIED: text = marriage_also_date['succinct'][date_full] % values - elif relationship == gen.lib.FamilyRelType.UNMARRIED: + elif relationship == FamilyRelType.UNMARRIED: text = unmarried_also_date['succinct'][date_full] % values else: text = relationship_also_date['succinct'][date_full] % values elif event and place and verbose: - if relationship == gen.lib.FamilyRelType.MARRIED: + if relationship == FamilyRelType.MARRIED: text = marriage_also_place[gender] % values - elif relationship == gen.lib.FamilyRelType.UNMARRIED: + elif relationship == FamilyRelType.UNMARRIED: text = unmarried_also_place[gender] % values else: text = relationship_also_place[gender] % values elif event and place: - if relationship == gen.lib.FamilyRelType.MARRIED: + if relationship == FamilyRelType.MARRIED: text = marriage_also_place['succinct'] % values - elif relationship == gen.lib.FamilyRelType.UNMARRIED: + elif relationship == FamilyRelType.UNMARRIED: text = unmarried_also_place['succinct'] % values else: text = relationship_also_place['succinct'] % values elif verbose: - if relationship == gen.lib.FamilyRelType.MARRIED: + if relationship == FamilyRelType.MARRIED: text = marriage_also_only[gender] % values - elif relationship == gen.lib.FamilyRelType.UNMARRIED: + elif relationship == FamilyRelType.UNMARRIED: text = unmarried_also_only[gender] % values else: text = relationship_also_only[gender] % values else: - if relationship == gen.lib.FamilyRelType.MARRIED: + if relationship == FamilyRelType.MARRIED: text = marriage_also_only['succinct'] % values - elif relationship == gen.lib.FamilyRelType.UNMARRIED: + elif relationship == FamilyRelType.UNMARRIED: text = unmarried_also_only['succinct'] % values else: text = relationship_also_only['succinct'] % values @@ -2112,7 +2116,8 @@ def find_spouse(person, family): def find_marriage(database, family): for event_ref in family.get_event_ref_list(): event = database.get_event_from_handle(event_ref.ref) - if event and int(event.get_type()) == gen.lib.EventType.MARRIAGE: + if event and event.type.value == EventType.MARRIAGE \ + and event_ref.role.value == EventRoleType.PRIMARY: return event return None @@ -2333,7 +2338,8 @@ def buried_str(database, person, person_name=None, empty_date="", empty_place="" burial = None for event_ref in person.get_event_ref_list(): event = database.get_event_from_handle(event_ref.ref) - if event and int(event.get_type()) == gen.lib.EventType.BURIAL: + if event and event.type.value == EventType.BURIAL \ + and event_ref.role.value == EventRoleType.PRIMARY: burial = event break @@ -2344,7 +2350,7 @@ def buried_str(database, person, person_name=None, empty_date="", empty_place="" bplace = database.get_place_from_handle(bplace_handle).get_title() bdate_obj = burial.get_date_object() bdate_full = bdate_obj and bdate_obj.get_day_valid() - bdate_mod = bdate_obj and bdate_obj.get_modifier() != gen.lib.Date.MOD_NONE + bdate_mod = bdate_obj and bdate_obj.get_modifier() != Date.MOD_NONE else: return text @@ -2467,7 +2473,8 @@ def get_birth_or_fallback(database, person): # now search the event list for fallbacks for event_ref in person.get_primary_event_ref_list(): event = database.get_event_from_handle(event_ref.ref) - if event.get_type() in [gen.lib.EventType.CHRISTEN, gen.lib.EventType.BAPTISM]: + if event.type.value in [EventType.CHRISTEN, EventType.BAPTISM] \ + and event_ref.role.value == EventRoleType.PRIMARY: return event return None @@ -2478,7 +2485,8 @@ def get_death_or_fallback(database, person): # now search the event list for fallbacks for event_ref in person.get_primary_event_ref_list(): event = database.get_event_from_handle(event_ref.ref) - if event.get_type() in [gen.lib.EventType.BURIAL, gen.lib.EventType.CREMATION]: + if event.type.value in [EventType.BURIAL, EventType.CREMATION] \ + and event_ref.role.value == EventRoleType.PRIMARY: return event return None @@ -2643,7 +2651,7 @@ def get_person_filters(person, include_single=True): Return a list of filters that are relevant for the given person @param person: the person the filters should apply to. - @type person: L{gen.lib.Person} + @type person: L{Person} @param include_single: include a filter to include the single person @type person: boolean """ @@ -2691,3 +2699,4 @@ def get_person_filters(person, include_single=True): return the_filters + diff --git a/src/Simple/_SimpleAccess.py b/src/Simple/_SimpleAccess.py index 687e66db8..33122ab46 100644 --- a/src/Simple/_SimpleAccess.py +++ b/src/Simple/_SimpleAccess.py @@ -361,7 +361,7 @@ class SimpleAccess: elist = [ self.dbase.get_event_from_handle(ref.ref) for ref in reflist ] events = [ evnt for evnt in elist - if int(evnt.get_type()) == EventType.MARRIAGE ] + if event.type == EventType.MARRIAGE ] if events: place_handle = events[0].get_place_handle() return ReportUtils.place_name(self.dbase, place_handle) @@ -391,7 +391,7 @@ class SimpleAccess: elist = [ self.dbase.get_event_from_handle(ref.ref) for ref in reflist ] events = [ evnt for evnt in elist - if int(evnt.get_type()) == EventType.MARRIAGE ] + if event.type == EventType.MARRIAGE ] if events: date_obj = events[0].get_date_object() if date_obj: diff --git a/src/Utils.py b/src/Utils.py index f6afb42f9..a981a763c 100644 --- a/src/Utils.py +++ b/src/Utils.py @@ -598,9 +598,9 @@ def probably_alive(person, db, current_date=None, limit=0): # These are fairly good indications that someone's not alive. for ev_ref in person.get_primary_event_ref_list(): ev = db.get_event_from_handle(ev_ref.ref) - if ev and int(ev.get_type()) in [gen.lib.EventType.CAUSE_DEATH, - gen.lib.EventType.BURIAL, - gen.lib.EventType.CREMATION]: + if ev and ev.type in [gen.lib.EventType.CAUSE_DEATH, + gen.lib.EventType.BURIAL, + gen.lib.EventType.CREMATION]: if not death_date: death_date = ev.get_date_object() if ev.get_date_object().get_start_date() != gen.lib.Date.EMPTY: diff --git a/src/gen/lib/event.py b/src/gen/lib/event.py index dc8747b40..f05980064 100644 --- a/src/gen/lib/event.py +++ b/src/gen/lib/event.py @@ -71,11 +71,11 @@ class Event(SourceBase, NoteBase, MediaBase, AttributeBase, PlaceBase.__init__(self, source) if source: - self.description = source.description - self.type = source.type + self.__description = source.__description + self.__type = source.__type else: - self.description = "" - self.type = EventType() + self.__description = "" + self.__type = EventType() def serialize(self, no_text_date = False): """ @@ -95,9 +95,9 @@ class Event(SourceBase, NoteBase, MediaBase, AttributeBase, be considered persistent. @rtype: tuple """ - return (self.handle, self.gramps_id, self.type.serialize(), + return (self.handle, self.gramps_id, self.__type.serialize(), DateBase.serialize(self, no_text_date), - self.description, self.place, + self.__description, self.place, SourceBase.serialize(self), NoteBase.serialize(self), MediaBase.serialize(self), @@ -114,14 +114,14 @@ class Event(SourceBase, NoteBase, MediaBase, AttributeBase, @type data: tuple """ (self.handle, self.gramps_id, the_type, date, - self.description, self.place, + self.__description, self.place, source_list, note_list, media_list, attribute_list, self.change, marker, self.private) = data self.marker = MarkerType() self.marker.unserialize(marker) - self.type = EventType() - self.type.unserialize(the_type) + self.__type = EventType() + self.__type.unserialize(the_type) DateBase.unserialize(self, date) MediaBase.unserialize(self, media_list) AttributeBase.unserialize(self, attribute_list) @@ -178,7 +178,7 @@ class Event(SourceBase, NoteBase, MediaBase, AttributeBase, @return: Returns the list of all textual attributes of the object. @rtype: list """ - return [self.description, str(self.type), self.gramps_id] + return [self.__description, str(self.__type), self.gramps_id] def get_text_data_child_list(self): """ @@ -241,8 +241,8 @@ class Event(SourceBase, NoteBase, MediaBase, AttributeBase, """ date = self.get_date_object() place = self.get_place_handle() - description = self.description - the_type = self.type + description = self.__description + the_type = self.__type return (the_type == EventType.CUSTOM and date.is_empty() and not place and not description) @@ -258,9 +258,9 @@ class Event(SourceBase, NoteBase, MediaBase, AttributeBase, if other == None: other = Event (None) - if self.type != other.type or \ + if self.__type != other.__type or \ ((self.place or other.place) and (self.place != other.place)) or \ - self.description != other.description \ + self.__description != other.__description \ or self.private != other.private or \ (not self.get_date_object().is_equal(other.get_date_object())) or \ len(self.get_source_references()) != len(other.get_source_references()): @@ -282,7 +282,7 @@ class Event(SourceBase, NoteBase, MediaBase, AttributeBase, @param the_type: Type to assign to the Event @type the_type: tuple """ - self.type.set(the_type) + self.__type.set(the_type) def get_type(self): """ @@ -291,7 +291,8 @@ class Event(SourceBase, NoteBase, MediaBase, AttributeBase, @return: Type of the Event @rtype: tuple """ - return self.type + return self.__type + type = property(get_type, get_type, None, 'Returns or sets type of the event') def set_description(self, description): """ @@ -302,7 +303,7 @@ class Event(SourceBase, NoteBase, MediaBase, AttributeBase, @param description: Description to assign to the Event @type description: str """ - self.description = description + self.__description = description def get_description(self) : """ @@ -311,4 +312,5 @@ class Event(SourceBase, NoteBase, MediaBase, AttributeBase, @return: Returns the description of the Event @rtype: str """ - return self.description + return self.__description + description = property(get_description, set_description, None, 'Returns or sets description of the event') diff --git a/src/gen/lib/eventref.py b/src/gen/lib/eventref.py index 866fb519a..1e044b1aa 100644 --- a/src/gen/lib/eventref.py +++ b/src/gen/lib/eventref.py @@ -49,6 +49,8 @@ class EventRef(SecondaryObject, PrivacyBase, NoteBase, AttributeBase, RefBase): to the refereneced event. """ + __slots__=('.__role') + def __init__(self, source=None): """ Create a new EventRef instance, copying from the source if present. @@ -58,9 +60,9 @@ class EventRef(SecondaryObject, PrivacyBase, NoteBase, AttributeBase, RefBase): AttributeBase.__init__(self, source) RefBase.__init__(self, source) if source: - self.role = source.role + self.__role = source.__role else: - self.role = EventRoleType() + self.__role = EventRoleType() def serialize(self): """ @@ -71,7 +73,7 @@ class EventRef(SecondaryObject, PrivacyBase, NoteBase, AttributeBase, RefBase): NoteBase.serialize(self), AttributeBase.serialize(self), RefBase.serialize(self), - self.role.serialize() + self.__role.serialize() ) def unserialize(self, data): @@ -83,8 +85,8 @@ class EventRef(SecondaryObject, PrivacyBase, NoteBase, AttributeBase, RefBase): NoteBase.unserialize(self, note_list) AttributeBase.unserialize(self, attribute_list) RefBase.unserialize(self, ref) - self.role = EventRoleType() - self.role.unserialize(role) + self.__role = EventRoleType() + self.__role.unserialize(role) return self def get_text_data_list(self): @@ -94,7 +96,7 @@ class EventRef(SecondaryObject, PrivacyBase, NoteBase, AttributeBase, RefBase): @return: Returns the list of all textual attributes of the object. @rtype: list """ - return [str(self.role)] + return self.__role.string def get_text_data_child_list(self): """ @@ -194,10 +196,11 @@ class EventRef(SecondaryObject, PrivacyBase, NoteBase, AttributeBase, RefBase): """ Return the tuple corresponding to the preset role. """ - return self.role + return self.__role def set_role(self, role): """ Set the role according to the given argument. """ - self.role.set(role) + self.__role.set(role) + role = property(get_role, set_role, None, 'Returns or sets role property') diff --git a/src/gen/lib/grampstype.py b/src/gen/lib/grampstype.py index cd54545e0..175901da9 100644 --- a/src/gen/lib/grampstype.py +++ b/src/gen/lib/grampstype.py @@ -94,6 +94,7 @@ class GrampsType(object): _BLACKLIST = None __metaclass__ = GrampsTypeMeta + __slots__ = ('__value','__string') @classmethod def __class_init__(cls, namespace): @@ -115,23 +116,23 @@ class GrampsType(object): v = value[0] if len(value) > 1: s = value[1] - self.val = v - self.string = s + self.__value = v + self.__string = s def __set_int(self, value): - self.val = value - self.string = u'' + self.__value = value + self.__string = u'' def __set_instance(self, value): - self.val = value.val - self.string = value.string + self.__value = value.value + self.__string = value.string def __set_str(self, value): - self.val = self._S2IMAP.get(value, self._CUSTOM) - if self.val == self._CUSTOM: - self.string = value + self.__value = self._S2IMAP.get(value, self._CUSTOM) + if self.__value == self._CUSTOM: + self.__string = value else: - self.string = u'' + self.__string = u'' def set(self, value): if isinstance(value, tuple): @@ -143,8 +144,8 @@ class GrampsType(object): elif isinstance(value, basestring): self.__set_str(value) else: - self.val = self._DEFAULT - self.string = u'' + self.__value = self._DEFAULT + self.__string = u'' def set_from_xml_str(self, value): """ @@ -152,38 +153,38 @@ class GrampsType(object): (obtained e.g. from XML). """ if self._E2IMAP.has_key(value): - self.val = self._E2IMAP[value] - self.string = u'' + self.__value = self._E2IMAP[value] + self.__string = u'' else: - self.val = self._CUSTOM - self.string = value + self.__value = self._CUSTOM + self.__string = value def xml_str(self): """ Return the untranslated string (e.g. suitable for XML) corresponding to the type. """ - if self.val == self._CUSTOM: - return self.string + if self.__value == self._CUSTOM: + return self.__string else: - return self._I2EMAP[self.val] + return self._I2EMAP[self.__value] def serialize(self): """Convert the object to a serialized tuple of data. """ - return (self.val, self.string) + return (self.__value, self.__string) def unserialize(self, data): """Convert a serialized tuple of data to an object.""" - self.val, self.string = data + self.__value, self.__string = data def __str__(self): - if self.val == self._CUSTOM: - return self.string + if self.__value == self._CUSTOM: + return self.__string else: - return self._I2SMAP.get(self.val, _('Unknown')) + return self._I2SMAP.get(self.__value, _('Unknown')) def __int__(self): - return self.val + return self.__value def get_map(self): return self._I2SMAP @@ -199,26 +200,28 @@ class GrampsType(object): if (i != self._CUSTOM) and s.strip()] def is_custom(self): - return self.val == self._CUSTOM + return self.__value == self._CUSTOM def is_default(self): - return self.val == self._DEFAULT + return self.__value == self._DEFAULT def get_custom(self): return self._CUSTOM def __cmp__(self, value): if isinstance(value, int): - return cmp(self.val, value) + return cmp(self.__value, value) elif isinstance(value, basestring): - if self.val == self._CUSTOM: - return cmp(self.string, value) + if self.__value == self._CUSTOM: + return cmp(self.__string, value) else: - return cmp(self._I2SMAP.get(self.val), value) + return cmp(self._I2SMAP.get(self.__value), value) elif isinstance(value, tuple): - return cmp((self.val, self.string), value) + return cmp((self.__value, self.__string), value) else: - if value.val == self._CUSTOM: - return cmp(self.string, value.string) + if value.value == self._CUSTOM: + return cmp(self.__string, value.string) else: - return cmp(self.val, value.val) + return cmp(self.__value, value.value) + value = property(__int__, __set_int, None, "Returns or sets integer value") + string = property(__str__, __set_str, None, "Returns or sets string value") diff --git a/src/gen/utils/dbutils.py b/src/gen/utils/dbutils.py index 759a39357..4d3f5f92b 100644 --- a/src/gen/utils/dbutils.py +++ b/src/gen/utils/dbutils.py @@ -168,7 +168,7 @@ def remove_child_from_family(db, person_handle, family_handle, trans=None): def marriage_from_eventref_list(db, eventref_list): for eventref in eventref_list: event = db.get_event_from_handle(eventref.ref) - if int(event.get_type()) == gen.lib.EventType.MARRIAGE: + if event.type == gen.lib.EventType.MARRIAGE: return event else: return None @@ -305,12 +305,12 @@ def set_birth_death_index(db, person): for index in range(len(event_ref_list)): ref = event_ref_list[index] event = db.get_event_from_handle(ref.ref) - if (int(event.get_type()) == gen.lib.EventType.BIRTH) \ - and (int(ref.get_role()) == gen.lib.EventRoleType.PRIMARY) \ + if (event.type == gen.lib.EventType.BIRTH) \ + and (ref.role == gen.lib.EventRoleType.PRIMARY) \ and (birth_ref_index == -1): birth_ref_index = index - elif (int(event.get_type()) == gen.lib.EventType.DEATH) \ - and (int(ref.get_role()) == gen.lib.EventRoleType.PRIMARY) \ + elif (event.type == gen.lib.EventType.DEATH) \ + and (ref.role == gen.lib.EventRoleType.PRIMARY) \ and (death_ref_index == -1): death_ref_index = index diff --git a/src/plugins/CalculateEstimatedDates.py b/src/plugins/CalculateEstimatedDates.py index da8ec5ba4..04c69b6f8 100644 --- a/src/plugins/CalculateEstimatedDates.py +++ b/src/plugins/CalculateEstimatedDates.py @@ -309,9 +309,9 @@ class CalcToolManagedWindow(PluginWindows.ToolManagedWindowBatch): # These are fairly good indications that someone's not alive. for ev_ref in person.get_primary_event_ref_list(): ev = self.db.get_event_from_handle(ev_ref.ref) - if ev and int(ev.get_type()) in [gen.lib.EventType.CAUSE_DEATH, - gen.lib.EventType.BURIAL, - gen.lib.EventType.CREMATION]: + if ev and ev.type in [gen.lib.EventType.CAUSE_DEATH, + gen.lib.EventType.BURIAL, + gen.lib.EventType.CREMATION]: if not death_date: death_date = ev.get_date_object() diff --git a/src/plugins/Calendar.py b/src/plugins/Calendar.py index f9cd09a5b..fff0d1dac 100644 --- a/src/plugins/Calendar.py +++ b/src/plugins/Calendar.py @@ -383,10 +383,10 @@ class Calendar(Report): are_married = None for event_ref in fam.get_event_ref_list(): event = self.database.get_event_from_handle(event_ref.ref) - if int(event.get_type()) in [gen.lib.EventType.MARRIAGE, + if event.type in [gen.lib.EventType.MARRIAGE, gen.lib.EventType.MARR_ALT]: are_married = event - elif int(event.get_type()) in [gen.lib.EventType.DIVORCE, + elif event.type in [gen.lib.EventType.DIVORCE, gen.lib.EventType.ANNULMENT, gen.lib.EventType.DIV_FILING]: are_married = None diff --git a/src/plugins/FamilyGroup.py b/src/plugins/FamilyGroup.py index b8e28a75f..7cba77cff 100644 --- a/src/plugins/FamilyGroup.py +++ b/src/plugins/FamilyGroup.py @@ -453,7 +453,7 @@ class FamilyGroup(Report): for event_ref in family.get_event_ref_list(): if event_ref: event = self.database.get_event_from_handle(event_ref.ref) - if int(event.get_type()) == gen.lib.EventType.MARRIAGE: + if event.type == gen.lib.EventType.MARRIAGE: m = event break diff --git a/src/plugins/GVRelGraph.py b/src/plugins/GVRelGraph.py index acbca25e2..d845569e3 100644 --- a/src/plugins/GVRelGraph.py +++ b/src/plugins/GVRelGraph.py @@ -247,7 +247,7 @@ class RelGraphReport(Report): for event_ref in fam.get_event_ref_list(): event = self.database.get_event_from_handle( event_ref.ref) - if int(event.get_type()) == gen.lib.EventType.MARRIAGE: + if event.type == gen.lib.EventType.MARRIAGE: label = self.get_event_string(event) break if self.includeid: @@ -376,10 +376,10 @@ class RelGraphReport(Report): # missing info, use (first) christening/burial instead for event_ref in person.get_primary_event_ref_list(): event = self.database.get_event_from_handle(event_ref.ref) - if int(event.get_type()) == gen.lib.EventType.CHRISTEN: + if event.type == gen.lib.EventType.CHRISTEN: if not birth: birth = self.get_event_string(event) - elif int(event.get_type()) == gen.lib.EventType.BURIAL: + elif event.type == gen.lib.EventType.BURIAL: if not death: death = self.get_event_string(event) return (birth, death) @@ -574,3 +574,4 @@ pmgr.register_report( ) + diff --git a/src/plugins/StatisticsChart.py b/src/plugins/StatisticsChart.py index f6ba69727..154ba13c5 100644 --- a/src/plugins/StatisticsChart.py +++ b/src/plugins/StatisticsChart.py @@ -339,7 +339,7 @@ class Extract: if int(family.get_relationship()) == FamilyRelType.MARRIED: for event_ref in family.get_event_ref_list(): event = self.db.get_event_from_handle(event_ref.ref) - if int(event.get_type()) == EventType.MARRIAGE: + if event.type == EventType.MARRIAGE: marriages.append(event_ref.ref) if marriages: return (person, marriages) diff --git a/src/plugins/WebCal.py b/src/plugins/WebCal.py index 4e997ed24..05610f112 100644 --- a/src/plugins/WebCal.py +++ b/src/plugins/WebCal.py @@ -642,9 +642,9 @@ class WebCalReport(Report): married = True for event_ref in fam.get_event_ref_list(): event = self.database.get_event_from_handle(event_ref.ref) - if event and int(event.get_type()) in [gen.lib.EventType.DIVORCE, - gen.lib.EventType.ANNULMENT, - gen.lib.EventType.DIV_FILING]: + if event and event.type in [gen.lib.EventType.DIVORCE, + gen.lib.EventType.ANNULMENT, + gen.lib.EventType.DIV_FILING]: married = False if married: for event_ref in fam.get_event_ref_list(): diff --git a/src/plugins/WriteGeneWeb.py b/src/plugins/WriteGeneWeb.py index 68fbe7f93..4cc0e5fb7 100644 --- a/src/plugins/WriteGeneWeb.py +++ b/src/plugins/WriteGeneWeb.py @@ -313,7 +313,7 @@ class GeneWebWriter: event_ref_list = family.get_event_ref_list() for event_ref in event_ref: event = self.db.get_event_from_handle(event_ref.ref) - if int(event.get_type()) == gen.lib.EventType.MARRIAGE: + if event.type == gen.lib.EventType.MARRIAGE: w_list = event.get_witness_list() if w_list: for witness in w_list: