clean up output of families from relationship graph

This commit is contained in:
Olaf 2016-01-23 22:24:19 +00:00
parent a947bd3598
commit 9d83cbbc52

View File

@ -296,7 +296,8 @@ class RelGraphReport(Report):
return return
fam_id = fam.get_gramps_id() fam_id = fam.get_gramps_id()
date_label = place_label = None m_type = m_date = m_place = ""
d_type = d_date = d_place = ""
for event_ref in fam.get_event_ref_list(): for event_ref in fam.get_event_ref_list():
event = self.database.get_event_from_handle(event_ref.ref) event = self.database.get_event_from_handle(event_ref.ref)
if event is None: if event is None:
@ -305,34 +306,38 @@ class RelGraphReport(Report):
(event_ref.get_role() == EventRoleType.FAMILY or (event_ref.get_role() == EventRoleType.FAMILY or
event_ref.get_role() == EventRoleType.PRIMARY) event_ref.get_role() == EventRoleType.PRIMARY)
): ):
date_label = self.get_date_string(event) m_type = event.type
if not (self.event_choice == 3 and date_label): m_date = self.get_date_string(event)
place_label = self.get_place_string(event) if not (self.event_choice == 3 and m_date):
m_place = self.get_place_string(event)
break break
if self.includeid == 0 and not date_label and not place_label: if (event.type == EventType.DIVORCE and
label = "" (event_ref.get_role() == EventRoleType.FAMILY or
elif self.includeid == 0 and not date_label and place_label: event_ref.get_role() == EventRoleType.PRIMARY)
label = "(%s)" % place_label ):
elif self.includeid == 0 and date_label and not place_label: d_type = event.type
label = "(%s)" % date_label d_date = self.get_date_string(event)
elif self.includeid == 0 and date_label and place_label: if not (self.event_choice == 3 and d_date):
label = "(%s)\\n(%s)" % (date_label, place_label) d_place = self.get_place_string(event)
elif self.includeid == 1 and not date_label and not place_label: break
label = "(%s)" % fam_id
elif self.includeid == 1 and not date_label and place_label: labellines = list()
label = "(%s) (%s)" % (fam_id, place_label) # id on same line if self.includeid == 2:
elif self.includeid == 1 and date_label and not place_label: # id on separate line
label = "(%s) (%s)" % (fam_id, date_label) # id on same line labellines.append("(%s)" % fam_id)
elif self.includeid == 1 and date_label and place_label: if m_date:
label = "(%s) (%s)\\n(%s)" % (fam_id, date_label, place_label) labellines.append("(%s)" % m_date)
elif self.includeid == 2 and not date_label and not place_label: if m_place:
label = "(%s)" % fam_id labellines.append("(%s)" % m_place)
elif self.includeid == 2 and not date_label and place_label: label = "\\n".join(labellines)
label = "(%s)\\n(%s)" % (fam_id, place_label) # id on own line labellines = list()
elif self.includeid == 2 and date_label and not place_label: if self.includeid == 1:
label = "(%s)\\n(%s)" % (fam_id, date_label) # id on own line # id on same line
elif self.includeid == 2 and date_label and place_label: labellines.append("(%s)" % fam_id)
label = "(%s)\\n(%s)\\n(%s)" % (fam_id, date_label, place_label) if len(label):
labellines.append(label)
label = ' '.join(labellines)
color = "" color = ""
fill = "" fill = ""
style = "solid" style = "solid"