Fix handle errors in family lines graph
This commit is contained in:
@@ -486,17 +486,18 @@ class FamilyLinesReport(Report):
|
|||||||
for family_handle in person.get_parent_family_handle_list():
|
for family_handle in person.get_parent_family_handle_list():
|
||||||
family = self._db.get_family_from_handle(family_handle)
|
family = self._db.get_family_from_handle(family_handle)
|
||||||
|
|
||||||
father = self._db.get_person_from_handle(
|
father_handle = family.get_father_handle()
|
||||||
family.get_father_handle())
|
if father_handle:
|
||||||
mother = self._db.get_person_from_handle(
|
father = self._db.get_person_from_handle(father_handle)
|
||||||
family.get_mother_handle())
|
|
||||||
if father:
|
if father:
|
||||||
ancestorsNotYetProcessed.add(
|
ancestorsNotYetProcessed.add(father_handle)
|
||||||
family.get_father_handle())
|
|
||||||
self._families.add(family_handle)
|
self._families.add(family_handle)
|
||||||
|
|
||||||
|
mother_handle = family.get_mother_handle()
|
||||||
|
if mother_handle:
|
||||||
|
mother = self._db.get_person_from_handle(mother_handle)
|
||||||
if mother:
|
if mother:
|
||||||
ancestorsNotYetProcessed.add(
|
ancestorsNotYetProcessed.add(mother_handle)
|
||||||
family.get_mother_handle())
|
|
||||||
self._families.add(family_handle)
|
self._families.add(family_handle)
|
||||||
|
|
||||||
def removeUninterestingParents(self):
|
def removeUninterestingParents(self):
|
||||||
@@ -750,16 +751,7 @@ class FamilyLinesReport(Report):
|
|||||||
# get birth place (one of: city, state, or country) we can use
|
# get birth place (one of: city, state, or country) we can use
|
||||||
birthplace = None
|
birthplace = None
|
||||||
if bth_event and self._incplaces:
|
if bth_event and self._incplaces:
|
||||||
place = self._db.get_place_from_handle(
|
birthplace = self.get_event_place(bth_event)
|
||||||
bth_event.get_place_handle())
|
|
||||||
if place:
|
|
||||||
location = get_main_location(self._db, place)
|
|
||||||
if location.get(PlaceType.CITY):
|
|
||||||
birthplace = location.get(PlaceType.CITY)
|
|
||||||
elif location.get(PlaceType.STATE):
|
|
||||||
birthplace = location.get(PlaceType.STATE)
|
|
||||||
elif location.get(PlaceType.COUNTRY):
|
|
||||||
birthplace = location.get(PlaceType.COUNTRY)
|
|
||||||
|
|
||||||
# see if we have a deceased date we can use
|
# see if we have a deceased date we can use
|
||||||
deathStr = None
|
deathStr = None
|
||||||
@@ -773,16 +765,7 @@ class FamilyLinesReport(Report):
|
|||||||
# get death place (one of: city, state, or country) we can use
|
# get death place (one of: city, state, or country) we can use
|
||||||
deathplace = None
|
deathplace = None
|
||||||
if dth_event and self._incplaces:
|
if dth_event and self._incplaces:
|
||||||
place = self._db.get_place_from_handle(
|
deathplace = self.get_event_place(dth_event)
|
||||||
dth_event.get_place_handle())
|
|
||||||
if place:
|
|
||||||
location = get_main_location(self._db, place)
|
|
||||||
if location.get(PlaceType.CITY):
|
|
||||||
deathplace = location.get(PlaceType.CITY)
|
|
||||||
elif location.get(PlaceType.STATE):
|
|
||||||
deathplace = location.get(PlaceType.STATE)
|
|
||||||
elif location.get(PlaceType.COUNTRY):
|
|
||||||
deathplace = location.get(PlaceType.COUNTRY)
|
|
||||||
|
|
||||||
# see if we have an image to use for this person
|
# see if we have an image to use for this person
|
||||||
imagePath = None
|
imagePath = None
|
||||||
@@ -902,16 +885,7 @@ class FamilyLinesReport(Report):
|
|||||||
weddingDate = self._get_date(date)
|
weddingDate = self._get_date(date)
|
||||||
# get the wedding location
|
# get the wedding location
|
||||||
if self._incplaces:
|
if self._incplaces:
|
||||||
place = self._db.get_place_from_handle(
|
weddingPlace = self.get_event_place(event)
|
||||||
event.get_place_handle())
|
|
||||||
if place:
|
|
||||||
location = get_main_location(self._db, place)
|
|
||||||
if location.get(PlaceType.CITY):
|
|
||||||
weddingPlace = location.get(PlaceType.CITY)
|
|
||||||
elif location.get(PlaceType.STATE):
|
|
||||||
weddingPlace = location.get(PlaceType.STATE)
|
|
||||||
elif location.get(PlaceType.COUNTRY):
|
|
||||||
weddingPlace = location.get(PlaceType.COUNTRY)
|
|
||||||
break
|
break
|
||||||
|
|
||||||
# figure out the number of children (if any)
|
# figure out the number of children (if any)
|
||||||
@@ -1012,3 +986,18 @@ class FamilyLinesReport(Report):
|
|||||||
child = self._db.get_person_from_handle(childRef.ref)
|
child = self._db.get_person_from_handle(childRef.ref)
|
||||||
comment = "child: %s" % child.get_primary_name().get_regular_name()
|
comment = "child: %s" % child.get_primary_name().get_regular_name()
|
||||||
self.doc.add_link(fgid, child.get_gramps_id(), comment=comment)
|
self.doc.add_link(fgid, child.get_gramps_id(), comment=comment)
|
||||||
|
|
||||||
|
def get_event_place(self, event):
|
||||||
|
place_text = None
|
||||||
|
place_handle = event.get_place_handle()
|
||||||
|
if place_handle:
|
||||||
|
place = self._db.get_place_from_handle(place_handle)
|
||||||
|
if place:
|
||||||
|
location = get_main_location(self._db, place)
|
||||||
|
if location.get(PlaceType.CITY):
|
||||||
|
place_text = location.get(PlaceType.CITY)
|
||||||
|
elif location.get(PlaceType.STATE):
|
||||||
|
place_text = location.get(PlaceType.STATE)
|
||||||
|
elif location.get(PlaceType.COUNTRY):
|
||||||
|
place_text = location.get(PlaceType.COUNTRY)
|
||||||
|
return place_text
|
||||||
|
Reference in New Issue
Block a user