NarrativeWeb: Furthering the use of _individuallist variable. For checking whether a person is in the database or not?
svn: r15634
This commit is contained in:
parent
c9f6fbd0eb
commit
a58d664660
@ -616,16 +616,14 @@ class BasePage(object):
|
|||||||
found = any(p[2] == placetitle for p in place_lat_long)
|
found = any(p[2] == placetitle for p in place_lat_long)
|
||||||
if not found:
|
if not found:
|
||||||
|
|
||||||
latitude = place.get_latitude()
|
if ( place.lat and place.long ):
|
||||||
longitude = place.get_longitude()
|
|
||||||
if ( latitude and longitude ):
|
|
||||||
|
|
||||||
latitude, longitude = conv_lat_lon( latitude,
|
latitude, longitude = conv_lat_lon( place.lat,
|
||||||
longitude,
|
place.long,
|
||||||
"D.D8")
|
"D.D8")
|
||||||
|
|
||||||
place_lat_long.append([ latitude, longitude,
|
place_lat_long.append([ latitude, longitude,
|
||||||
placetitle, place.get_handle() ])
|
placetitle, place.handle ])
|
||||||
|
|
||||||
def _get_event_place(self, person):
|
def _get_event_place(self, person):
|
||||||
"""
|
"""
|
||||||
@ -637,11 +635,7 @@ class BasePage(object):
|
|||||||
return
|
return
|
||||||
db = self.report.database
|
db = self.report.database
|
||||||
|
|
||||||
global _individuallist
|
if check_person_database(person):
|
||||||
# find individual from within the report database
|
|
||||||
found = any(handle == person.handle for handle in _individuallist)
|
|
||||||
if found:
|
|
||||||
|
|
||||||
event_ref_list = person.get_event_ref_list()
|
event_ref_list = person.get_event_ref_list()
|
||||||
for event_ref in event_ref_list:
|
for event_ref in event_ref_list:
|
||||||
event = db.get_event_from_handle(event_ref.ref)
|
event = db.get_event_from_handle(event_ref.ref)
|
||||||
@ -1893,7 +1887,6 @@ class BasePage(object):
|
|||||||
@param: place -- place object from the database
|
@param: place -- place object from the database
|
||||||
@param: table -- table from Placedetail
|
@param: table -- table from Placedetail
|
||||||
"""
|
"""
|
||||||
|
|
||||||
if not place:
|
if not place:
|
||||||
return
|
return
|
||||||
|
|
||||||
@ -1990,9 +1983,6 @@ class IndividualListPage(BasePage):
|
|||||||
BasePage.__init__(self, report, title)
|
BasePage.__init__(self, report, title)
|
||||||
db = report.database
|
db = report.database
|
||||||
|
|
||||||
# handles for this module for use in partner column
|
|
||||||
report_handle_list = person_handle_list
|
|
||||||
|
|
||||||
# plugin variables for this module
|
# plugin variables for this module
|
||||||
showbirth = report.options['showbirth']
|
showbirth = report.options['showbirth']
|
||||||
showdeath = report.options['showdeath']
|
showdeath = report.options['showdeath']
|
||||||
@ -2114,7 +2104,7 @@ class IndividualListPage(BasePage):
|
|||||||
partner_name = self.get_name(partner)
|
partner_name = self.get_name(partner)
|
||||||
if not first_family:
|
if not first_family:
|
||||||
tcell += ", "
|
tcell += ", "
|
||||||
if partner_handle in report_handle_list:
|
if check_person_database(partner):
|
||||||
url = self.report.build_url_fname_html(partner_handle, "ppl")
|
url = self.report.build_url_fname_html(partner_handle, "ppl")
|
||||||
tcell += self.person_link(url, partner, True, gid = partner.gramps_id)
|
tcell += self.person_link(url, partner, True, gid = partner.gramps_id)
|
||||||
else:
|
else:
|
||||||
@ -2166,7 +2156,7 @@ class SurnamePage(BasePage):
|
|||||||
This will create a list of individuals with the same surname
|
This will create a list of individuals with the same surname
|
||||||
"""
|
"""
|
||||||
|
|
||||||
def __init__(self, report, title, surname, person_handle_list, report_handle_list):
|
def __init__(self, report, title, surname, person_handle_list):
|
||||||
BasePage.__init__(self, report, title)
|
BasePage.__init__(self, report, title)
|
||||||
db = report.database
|
db = report.database
|
||||||
|
|
||||||
@ -2268,7 +2258,7 @@ class SurnamePage(BasePage):
|
|||||||
partner_name = self.get_name(partner)
|
partner_name = self.get_name(partner)
|
||||||
if not first_family:
|
if not first_family:
|
||||||
tcell += ','
|
tcell += ','
|
||||||
if partner_handle in report_handle_list:
|
if check_person_database(partner):
|
||||||
url = self.report.build_url_fname_html(partner_handle, "ppl", True)
|
url = self.report.build_url_fname_html(partner_handle, "ppl", True)
|
||||||
tcell += self.person_link(url, partner, True, gid = partner.gramps_id)
|
tcell += self.person_link(url, partner, True, gid = partner.gramps_id)
|
||||||
else:
|
else:
|
||||||
@ -4989,7 +4979,7 @@ class IndividualPage(BasePage):
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
person_name = self.get_name(person)
|
person_name = self.get_name(person)
|
||||||
if person.handle in self.ind_list:
|
if check_person_database(person):
|
||||||
url = self.report.build_url_fname_html(person.handle, "ppl", True)
|
url = self.report.build_url_fname_html(person.handle, "ppl", True)
|
||||||
hyper = self.person_link(url, person, name_style = True)
|
hyper = self.person_link(url, person, name_style = True)
|
||||||
else:
|
else:
|
||||||
@ -5786,7 +5776,7 @@ class NavWebReport(Report):
|
|||||||
"surnames_count")
|
"surnames_count")
|
||||||
|
|
||||||
for (surname, handle_list) in local_list:
|
for (surname, handle_list) in local_list:
|
||||||
SurnamePage(self, self.title, surname, handle_list, ind_list)
|
SurnamePage(self, self.title, surname, handle_list)
|
||||||
self.progress.step()
|
self.progress.step()
|
||||||
|
|
||||||
def source_pages(self, source_list):
|
def source_pages(self, source_list):
|
||||||
@ -6902,3 +6892,14 @@ def build_event_data(db, ind_list):
|
|||||||
|
|
||||||
# return event_handle_list and event types to its caller
|
# return event_handle_list and event types to its caller
|
||||||
return event_handle_list, event_types
|
return event_handle_list, event_types
|
||||||
|
|
||||||
|
def check_person_database(person):
|
||||||
|
"""
|
||||||
|
check to see if a person is in the report database
|
||||||
|
|
||||||
|
@param: person -- person object from the database presumably
|
||||||
|
"""
|
||||||
|
global _individuallist
|
||||||
|
|
||||||
|
# returns True if person is found, and False if not
|
||||||
|
return any(handle == person.handle for handle in _individuallist)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user