diff --git a/gramps2/ChangeLog b/gramps2/ChangeLog index 289c6482c..4d6f31c04 100644 --- a/gramps2/ChangeLog +++ b/gramps2/ChangeLog @@ -1,3 +1,7 @@ +2006-04-21 Brian Matherly + * src/PluginUtils/_ReportUtils.py: keep up with RelLib changes + * src/plugins/NavWebPage.py: keep up with RelLib changes + 2006-04-22 Don Allingham * src/GrampsDb/_ReadXML.py: fix Type str_from_xml calls * src/DataViews/_MediaView.py: Shorten tab name diff --git a/gramps2/src/PluginUtils/_ReportUtils.py b/gramps2/src/PluginUtils/_ReportUtils.py index afedddc7b..f4fa8fe99 100644 --- a/gramps2/src/PluginUtils/_ReportUtils.py +++ b/gramps2/src/PluginUtils/_ReportUtils.py @@ -1120,7 +1120,7 @@ def sanitize_person(db,person): # copy Family reference list for item in person.get_parent_family_handle_list(): - new_person.add_parent_family_handle(item[0],item[1],item[2]) + new_person.add_parent_family_handle(item) if person.get_privacy(): return new_person @@ -1179,17 +1179,13 @@ def sanitize_person(db,person): new_person.add_media_reference(RelLib.MediaRef(obj)) # LDS ordinances - ordinance = person.get_lds_baptism() - if ordinance: - new_person.set_lds_baptism(ordinance) - - ordinance = person.get_lds_endowment() - if ordinance: - new_person.set_lds_endowment(ordinance) - - ordinance = person.get_lds_sealing() - if ordinance: - new_person.set_lds_sealing(ordinance) + for lds_ord in person.get_lds_ord_list(): + lds_type = lds_ord.get_type() + if lds_type == RelLib.LdsOrd.BAPTISM or \ + lds_type == RelLib.LdsOrd.ENDOWMENT or \ + lds_type == RelLib.LdsOrd.SEAL_TO_PARENTS or \ + lds_type == RelLib.LdsOrd.SEAL_TO_SPOUSE : + new_person.add_lds_ord( lds_ord ) new_person.set_note(person.get_note()) diff --git a/gramps2/src/plugins/NavWebPage.py b/gramps2/src/plugins/NavWebPage.py index 0d191fedc..cfe936b2a 100644 --- a/gramps2/src/plugins/NavWebPage.py +++ b/gramps2/src/plugins/NavWebPage.py @@ -443,7 +443,7 @@ class BasePage: of.write('\n') for attr in attrlist: - atType = Utils.format_personal_attribute( attr.get_type() ) + atType = str( attr.get_type() ) of.write('' % atType) of.write('\n' % attr.get_value()) of.write('
%s%s
\n') @@ -1563,7 +1563,9 @@ class IndividualPage(BasePage): index = 1 for sref in sreflist: lnk = (self.cur_name, self.page_title, self.gid) - shandle = sref.get_base_handle() + shandle = sref.get_reference_handle() + if not shandle: + continue if self.src_list.has_key(shandle): if lnk not in self.src_list[shandle]: self.src_list[shandle].append(lnk) @@ -1593,7 +1595,7 @@ class IndividualPage(BasePage): parent_handle_list = self.person.get_parent_family_handle_list() if parent_handle_list: - (parent_handle, mrel,frel) = parent_handle_list[0] + parent_handle = parent_handle_list[0] family = self.db.get_family_from_handle(parent_handle) father_id = family.get_father_handle() mother_id = family.get_mother_handle() @@ -1619,7 +1621,8 @@ class IndividualPage(BasePage): self.pedigree_person(of,mother,True) of.write('
\n') if family: - for child_handle in family.get_child_handle_list(): + for child_ref in family.get_child_ref_list(): + child_handle = child_ref.ref if child_handle == self.person.handle: of.write('%s
\n' % self.name) self.pedigree_family(of) @@ -1656,7 +1659,7 @@ class IndividualPage(BasePage): # Names [and their sources] for name in [self.person.get_primary_name(),]+self.person.get_alternate_names(): pname = name_nameof(name,self.exclude_private) - type = Utils.format_name_type( name.get_type() ) + type = str( name.get_type() ) of.write('%s\n' % _(type)) of.write('%s' % pname) if not self.restrict: @@ -1725,7 +1728,7 @@ class IndividualPage(BasePage): for event_ref in evt_ref_list: event = self.db.get_event_from_handle(event_ref.ref) if event: - evt_name = Utils.format_event(event.get_type()) + evt_name = str(event.get_type()) of.write('%s\n' % evt_name) of.write('\n') of.write(self.format_event(event)) @@ -1765,7 +1768,7 @@ class IndividualPage(BasePage): else: of.write(nameof(person,self.exclude_private)) if rel != RelLib.ChildRefType.BIRTH: - of.write('   (%s)' % Utils.format_child_relation(rel)) + of.write('   (%s)' % str(rel)) of.write('\n') def display_ind_parents(self,of): @@ -1780,8 +1783,18 @@ class IndividualPage(BasePage): first = True if parent_list: - for (family_handle,mrel,frel) in parent_list: + for family_handle in parent_list: family = self.db.get_family_from_handle(family_handle) + + # Get the mother and father relationships + frel = "" + mrel = "" + child_handle = self.person.get_handle() + child_ref_list = family.get_child_ref_list() + for child_ref in child_ref_list: + if child_ref.ref == child_handle: + frel = str(child_ref.get_father_relation()) + mrel = str(child_ref.get_mother_relation()) if not first: of.write(' \n') @@ -1799,12 +1812,13 @@ class IndividualPage(BasePage): self.display_parent(of,mother_handle,_('Mother'),mrel) of.write('\n') first = False - childlist = family.get_child_handle_list() + childlist = family.get_child_ref_list() if len(childlist) > 1: of.write('\n') of.write('%s\n' % _("Siblings")) of.write('\n') - for child_handle in childlist: + for child_ref in childlist: + child_handle = child_ref.ref if child_handle != self.person.handle: self.display_child_link(of,child_handle) of.write('\n\n') @@ -1826,13 +1840,13 @@ class IndividualPage(BasePage): family = self.db.get_family_from_handle(family_handle) self.display_spouse(of,family,first) first = False - childlist = family.get_child_handle_list() + childlist = family.get_child_ref_list() if childlist: of.write(' \n') of.write('%s\n' % _("Children")) of.write('\n') - for child_handle in childlist: - self.display_child_link(of,child_handle) + for child_ref in childlist: + self.display_child_link(of,child_ref.ref) of.write('\n\n') of.write('\n') of.write('
\n') @@ -1841,7 +1855,7 @@ class IndividualPage(BasePage): gender = self.person.get_gender() reltype = family.get_relationship() - if reltype[0] == RelLib.Family.MARRIED: + if reltype == RelLib.FamilyRelType.MARRIED: if gender == RelLib.Person.FEMALE: relstr = _("Husband") elif gender == RelLib.Person.MALE: @@ -1861,7 +1875,7 @@ class IndividualPage(BasePage): name = _("unknown") if not first: of.write(' \n') - rtype = Utils.format_family_relation(family.get_relationship()) + rtype = str(family.get_relationship()) of.write('%s\n' % rtype) of.write('%s\n' % relstr) of.write('') @@ -1885,7 +1899,7 @@ class IndividualPage(BasePage): if self.exclude_private and event.private: continue - evtType = Utils.format_event(event.get_type()) + evtType = str(event.get_type()) of.write(' \n') of.write('%s\n' % evtType) of.write('\n') @@ -1894,7 +1908,7 @@ class IndividualPage(BasePage): for attr in family.get_attribute_list(): if self.exclude_private and attr.private: continue - attrType = Utils.format_family_attribute(attr.get_type()) + attrType = str(attr.get_type()) of.write(' \n') of.write('%s' % attrType) of.write('%s\n\n' % attr.get_value()) @@ -1936,11 +1950,11 @@ class IndividualPage(BasePage): if self.exclude_private: spouse = ReportUtils.sanitize_person( self.db, spouse) self.pedigree_person(of,spouse,True) - childlist = rel_family.get_child_handle_list() + childlist = rel_family.get_child_ref_list() if childlist: of.write('
\n') - for child_handle in childlist: - child = self.db.get_person_from_handle(child_handle) + for child_ref in childlist: + child = self.db.get_person_from_handle(child_ref.ref) if self.exclude_private: child = ReportUtils.sanitize_person( self.db, child) self.pedigree_person(of,child)