Update for RelLib changes

svn: r6361
This commit is contained in:
Brian Matherly 2006-04-19 04:06:27 +00:00
parent b82376fb66
commit 54957e0a21
3 changed files with 28 additions and 15 deletions

View File

@ -1,3 +1,7 @@
2006-04-18 Brian Matherly <pez4brian@users.sourceforge.net>
* src/plugins/FamilyGroup.py: update for RelLib changes
* src/plugins/IndivComplete.py: update for RelLib changes
2006-04-18 Don Allingham <don@gramps-project.org> 2006-04-18 Don Allingham <don@gramps-project.org>
* src/GrampsDb/_ReadXML.py: new types * src/GrampsDb/_ReadXML.py: new types
* src/GrampsDb/_ConstXML.py: new types * src/GrampsDb/_ConstXML.py: new types

View File

@ -320,7 +320,7 @@ class FamilyGroup(Report.Report):
if self.incParNames: if self.incParNames:
for alt_name in person.get_alternate_names(): for alt_name in person.get_alternate_names():
type = Utils.format_name_type( alt_name.get_type() ) type = str( alt_name.get_type() )
name = alt_name.get_regular_name() name = alt_name.get_regular_name()
self.dump_parent_line(type,name) self.dump_parent_line(type,name)
@ -538,7 +538,7 @@ class FamilyGroup(Report.Report):
self.dump_parent(_("Wife"),family.get_mother_handle()) self.dump_parent(_("Wife"),family.get_mother_handle())
length = len(family.get_child_handle_list()) length = len(family.get_child_ref_list())
if length > 0: if length > 0:
self.doc.start_paragraph("FGR-blank") self.doc.start_paragraph("FGR-blank")
self.doc.end_paragraph() self.doc.end_paragraph()
@ -551,14 +551,14 @@ class FamilyGroup(Report.Report):
self.doc.end_cell() self.doc.end_cell()
self.doc.end_row() self.doc.end_row()
index = 1 index = 1
for child_handle in family.get_child_handle_list(): for child_ref in family.get_child_ref_list():
self.dump_child(index,child_handle) self.dump_child(index,child_ref.ref)
index = index + 1 index = index + 1
self.doc.end_table() self.doc.end_table()
if self.recursive: if self.recursive:
for child_handle in family.get_child_handle_list(): for child_ref in family.get_child_ref_list():
child = self.database.get_person_from_handle(child_handle) child = self.database.get_person_from_handle(child_ref.ref)
for child_family_handle in child.get_family_handle_list(): for child_family_handle in child.get_family_handle_list():
if child_family_handle != family_handle: if child_family_handle != family_handle:
self.doc.page_break() self.doc.page_break()

View File

@ -196,18 +196,28 @@ class IndivCompleteReport(Report.Report):
self.doc.end_cell() self.doc.end_cell()
self.doc.end_row() self.doc.end_row()
for (family_handle,mrel,frel) \ family_handle_list = self.start_person.get_parent_family_handle_list()
in self.start_person.get_parent_family_handle_list(): for family_handle in family_handle_list:
if family_handle == \ if family_handle == \
self.start_person.get_main_parents_family_handle(): self.start_person.get_main_parents_family_handle():
continue continue
family = self.database.get_family_from_handle(family_handle) family = self.database.get_family_from_handle(family_handle)
# Get the mother and father relationships
frel = ""
mrel = ""
child_handle = self.start_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())
father_handle = family.get_father_handle() father_handle = family.get_father_handle()
if father_handle: if father_handle:
father = self.database.get_person_from_handle(father_handle) father = self.database.get_person_from_handle(father_handle)
fname = father.get_primary_name().get_regular_name() fname = father.get_primary_name().get_regular_name()
frel = const.child_relations.find_value(frel)
self.write_p_entry(_('Father'),fname,frel) self.write_p_entry(_('Father'),fname,frel)
else: else:
self.write_p_entry(_('Father'),'','') self.write_p_entry(_('Father'),'','')
@ -216,7 +226,6 @@ class IndivCompleteReport(Report.Report):
if mother_handle: if mother_handle:
mother = self.database.get_person_from_handle(mother_handle) mother = self.database.get_person_from_handle(mother_handle)
fname = mother.get_primary_name().get_regular_name() fname = mother.get_primary_name().get_regular_name()
frel = const.child_relations.find_value(frel)
self.write_p_entry(_('Mother'),fname,frel) self.write_p_entry(_('Mother'),fname,frel)
else: else:
self.write_p_entry(_('Mother'),'','') self.write_p_entry(_('Mother'),'','')
@ -240,7 +249,7 @@ class IndivCompleteReport(Report.Report):
self.doc.end_row() self.doc.end_row()
for name in self.start_person.get_alternate_names(): for name in self.start_person.get_alternate_names():
type = Utils.format_name_type( name.get_type() ) type = str( name.get_type() )
self.doc.start_row() self.doc.start_row()
self.normal_cell(type) self.normal_cell(type)
text = name.get_regular_name() text = name.get_regular_name()
@ -294,8 +303,8 @@ class IndivCompleteReport(Report.Report):
event = self.database.get_event_from_handle(event_ref.ref) event = self.database.get_event_from_handle(event_ref.ref)
self.write_fact(event) self.write_fact(event)
child_handle_list = family.get_child_handle_list() child_ref_list = family.get_child_ref_list()
if len(child_handle_list): if len(child_ref_list):
self.doc.start_row() self.doc.start_row()
self.normal_cell(_("Children")) self.normal_cell(_("Children"))
@ -303,12 +312,12 @@ class IndivCompleteReport(Report.Report):
self.doc.start_paragraph("IDS-Normal") self.doc.start_paragraph("IDS-Normal")
first = 1 first = 1
for child_handle in child_handle_list: for child_ref in child_ref_list:
if first == 1: if first == 1:
first = 0 first = 0
else: else:
self.doc.write_text('\n') self.doc.write_text('\n')
child = self.database.get_person_from_handle(child_handle) child = self.database.get_person_from_handle(child_ref.ref)
self.doc.write_text( self.doc.write_text(
child.get_primary_name().get_regular_name()) child.get_primary_name().get_regular_name())
self.doc.end_paragraph() self.doc.end_paragraph()