5449: Pedigree view crashes ... : trailing space and replace list() by set()

This commit is contained in:
SNoiraud 2016-04-10 09:55:50 +02:00
parent 0650bd8643
commit 3fe0aaa88a

View File

@ -134,7 +134,7 @@ class FindLoop(ManagedWindow) :
count += 1
self.current = person
self.parent = None
self.descendants(person_handle, [])
self.descendants(person_handle, set())
self.progress.set_header("%d/%d" % (count, len(people)))
self.progress.step()
@ -145,10 +145,10 @@ class FindLoop(ManagedWindow) :
def descendants(self, person_handle, new_list):
person = self.db.get_person_from_handle(person_handle)
plist = []
pset = set()
for item in new_list:
plist.append(item)
if person in plist:
pset.add(item)
if person.handle in pset:
# We found one loop
father_id = self.current.get_gramps_id()
father = _nd.display(self.current)
@ -169,7 +169,7 @@ class FindLoop(ManagedWindow) :
if not found:
self.model.append(value)
return
plist.append(person)
pset.add(person.handle)
for family_handle in person.get_family_handle_list():
family = self.db.get_family_from_handle(family_handle)
self.curr_fam = family.get_gramps_id()
@ -179,7 +179,7 @@ class FindLoop(ManagedWindow) :
for child_ref in family.get_child_ref_list():
child_handle = child_ref.ref
self.parent = person
self.descendants(child_handle, plist)
self.descendants(child_handle, pset)
def rowActivated(self, treeView, path, column) :
# first we need to check that the row corresponds to a person