* src/plugins/DetDescendantReport.py: fix spouse name printing

* src/plugins/DetAncestralReport.py: fix spouse name printing

svn: r7156
This commit is contained in:
Brian Matherly 2006-08-12 03:37:05 +00:00
parent 4bdc05a6c8
commit 174fe82e52
3 changed files with 65 additions and 14 deletions

View File

@ -1,3 +1,7 @@
2006-08-11 Brian Matherly <brian@gramps-project.org>
* src/plugins/DetDescendantReport.py: fix spouse name printing
* src/plugins/DetAncestralReport.py: fix spouse name printing
2006-08-11 Don Allingham <don@gramps-project.org> 2006-08-11 Don Allingham <don@gramps-project.org>
* src/DisplayModels/_PeopleModel.py: fix sorting of names * src/DisplayModels/_PeopleModel.py: fix sorting of names

View File

@ -454,6 +454,7 @@ class DetAncestorReport(Report):
family = self.database.get_family_from_handle(family_handle) family = self.database.get_family_from_handle(family_handle)
person_name = "" person_name = ""
ind_handle = None ind_handle = None
has_info = False
person_key = "" person_key = ""
if mate.get_gender() == RelLib.Person.MALE: if mate.get_gender() == RelLib.Person.MALE:
ind_handle = family.get_mother_handle() ind_handle = family.get_mother_handle()
@ -464,34 +465,58 @@ class DetAncestorReport(Report):
person_name = _nd.display(ind) person_name = _nd.display(ind)
person_mark = ReportUtils.get_person_mark(self.database,ind) person_mark = ReportUtils.get_person_mark(self.database,ind)
firstName = ReportUtils.common_name(ind,self.usenick) firstName = ReportUtils.common_name(ind,self.usenick)
for event_ref in ind.get_event_ref_list():
event = self.database.get_event_from_handle(event_ref.ref)
if event:
etype = event.get_type()
if etype == RelLib.EventType.BURIAL or \
etype == RelLib.EventType.BIRTH or \
etype == RelLib.EventType.DEATH :
has_info = True
break
if not has_info:
family_handle = ind.get_main_parents_family_handle()
if family_handle:
f = self.database.get_family_from_handle(family_handle)
if f.get_mother_handle() or f.get_father_handle():
has_info = True
else: else:
firstName = 0 firstName = 0
if person_name: print_name = ""
if person_name and has_info:
self.doc.start_paragraph("DAR-Entry") self.doc.start_paragraph("DAR-Entry")
self.doc.write_text(person_name,person_key) self.doc.write_text(person_name,person_key)
text = ReportUtils.born_str(self.database,ind,"", text = ReportUtils.born_str(self.database,ind,print_name,
self.EMPTY_DATE,self.EMPTY_PLACE) self.EMPTY_DATE,self.EMPTY_PLACE)
if text: if text:
self.doc.write_text(text) self.doc.write_text(text)
print_name = 0;
age,units = self.calc_age(ind) age,units = self.calc_age(ind)
text = ReportUtils.died_str(self.database,ind,0, text = ReportUtils.died_str(self.database,ind,print_name,
self.EMPTY_DATE,self.EMPTY_PLACE,age,units) self.EMPTY_DATE,self.EMPTY_PLACE,age,units)
if text: if text:
self.doc.write_text(text) self.doc.write_text(text)
print_name = 0;
text = ReportUtils.buried_str(self.database,ind,0, text = ReportUtils.buried_str(self.database,ind,print_name,
self.EMPTY_DATE,self.EMPTY_PLACE) self.EMPTY_DATE,self.EMPTY_PLACE)
if text: if text:
self.doc.write_text(text) self.doc.write_text(text)
print_name = 0;
self.write_parents(ind, firstName) if print_name == 0:
print_name = firstName
self.write_parents(ind, print_name)
self.doc.end_paragraph() self.doc.end_paragraph()
if person_name:
if self.listChildren and mate.get_gender()==RelLib.Person.MALE: if self.listChildren and mate.get_gender()==RelLib.Person.MALE:
self.write_children(family) self.write_children(family)

View File

@ -480,12 +480,12 @@ class DetDescendantReport(Report):
def write_mate(self, mate): def write_mate(self, mate):
"""Output birth, death, parentage, marriage and notes information """ """Output birth, death, parentage, marriage and notes information """
for family_handle in mate.get_family_handle_list(): for family_handle in mate.get_family_handle_list():
family = self.database.get_family_from_handle(family_handle) family = self.database.get_family_from_handle(family_handle)
person_name = "" person_name = ""
ind_handle = None ind_handle = None
person_mark = None has_info = False
person_key = ""
if mate.get_gender() == RelLib.Person.MALE: if mate.get_gender() == RelLib.Person.MALE:
ind_handle = family.get_mother_handle() ind_handle = family.get_mother_handle()
else: else:
@ -495,35 +495,57 @@ class DetDescendantReport(Report):
person_name = _nd.display(ind) person_name = _nd.display(ind)
person_mark = ReportUtils.get_person_mark(self.database,ind) person_mark = ReportUtils.get_person_mark(self.database,ind)
firstName = ReportUtils.common_name(ind,self.usenick) firstName = ReportUtils.common_name(ind,self.usenick)
for event_ref in ind.get_event_ref_list():
event = self.database.get_event_from_handle(event_ref.ref)
if event:
etype = event.get_type()
if etype == RelLib.EventType.BURIAL or \
etype == RelLib.EventType.BIRTH or \
etype == RelLib.EventType.DEATH :
has_info = True
break
if not has_info:
family_handle = ind.get_main_parents_family_handle()
if family_handle:
f = self.database.get_family_from_handle(family_handle)
if f.get_mother_handle() or f.get_father_handle():
has_info = True
else: else:
firstName = 0 firstName = 0
if person_name: print_name = ""
if person_name and has_info:
self.doc.start_paragraph("DDR-Entry") self.doc.start_paragraph("DDR-Entry")
self.doc.write_text(person_name,person_mark) self.doc.write_text(person_name,person_key)
text = ReportUtils.born_str(self.database,ind,"", text = ReportUtils.born_str(self.database,ind,print_name,
self.EMPTY_DATE,self.EMPTY_PLACE) self.EMPTY_DATE,self.EMPTY_PLACE)
if text: if text:
self.doc.write_text(text) self.doc.write_text(text)
print_name = 0;
age,units = self.calc_age(ind) age,units = self.calc_age(ind)
text = ReportUtils.died_str(self.database,ind,0, text = ReportUtils.died_str(self.database,ind,print_name,
self.EMPTY_DATE,self.EMPTY_PLACE,age,units) self.EMPTY_DATE,self.EMPTY_PLACE,age,units)
if text: if text:
self.doc.write_text(text) self.doc.write_text(text)
print_name = 0;
text = ReportUtils.buried_str(self.database,ind,0, text = ReportUtils.buried_str(self.database,ind,print_name,
self.EMPTY_DATE,self.EMPTY_PLACE) self.EMPTY_DATE,self.EMPTY_PLACE)
if text: if text:
self.doc.write_text(text) self.doc.write_text(text)
print_name = 0;
self.write_parents(ind, firstName) if print_name == 0:
print_name = firstName
self.write_parents(ind, print_name)
self.doc.end_paragraph() self.doc.end_paragraph()
def calc_age(self,ind): def calc_age(self,ind):
""" """
Calulate age. Calulate age.