Faster resolving of references
svn: r808
This commit is contained in:
parent
25a2488cc8
commit
fd2a2f43a3
@ -145,7 +145,7 @@ class GedcomParser:
|
|||||||
self.smap = {}
|
self.smap = {}
|
||||||
self.nmap = {}
|
self.nmap = {}
|
||||||
self.refn = {}
|
self.refn = {}
|
||||||
self.added = []
|
self.added = {}
|
||||||
self.gedmap = GedcomInfoDB()
|
self.gedmap = GedcomInfoDB()
|
||||||
self.gedsource = None
|
self.gedsource = None
|
||||||
self.dir_path = os.path.dirname(file)
|
self.dir_path = os.path.dirname(file)
|
||||||
@ -371,7 +371,7 @@ class GedcomParser:
|
|||||||
self.update(self.people_obj,str(self.indi_count))
|
self.update(self.people_obj,str(self.indi_count))
|
||||||
self.indi_count = self.indi_count + 1
|
self.indi_count = self.indi_count + 1
|
||||||
self.person = self.db.findPerson(matches[1],self.pmap)
|
self.person = self.db.findPerson(matches[1],self.pmap)
|
||||||
self.added.append(self.person)
|
self.added[self.person] = 1
|
||||||
self.parse_individual()
|
self.parse_individual()
|
||||||
elif matches[2] in ["SUBM","SUBN"]:
|
elif matches[2] in ["SUBM","SUBN"]:
|
||||||
self.ignore_sub_junk(1)
|
self.ignore_sub_junk(1)
|
||||||
@ -1642,8 +1642,11 @@ class GedcomParser:
|
|||||||
prefix = self.db.iprefix
|
prefix = self.db.iprefix
|
||||||
pmap = self.db.getPersonMap()
|
pmap = self.db.getPersonMap()
|
||||||
renamed = []
|
renamed = []
|
||||||
|
index = 0
|
||||||
new_pmax = self.db.pmapIndex
|
new_pmax = self.db.pmapIndex
|
||||||
for person in self.added:
|
for person in self.added.keys():
|
||||||
|
print index,person.getPrimaryName().getName()
|
||||||
|
index = index + 1
|
||||||
if self.refn.has_key(person):
|
if self.refn.has_key(person):
|
||||||
val = self.refn[person]
|
val = self.refn[person]
|
||||||
new_key = prefix % val
|
new_key = prefix % val
|
||||||
@ -1662,7 +1665,7 @@ class GedcomParser:
|
|||||||
pmap[new_key] = person
|
pmap[new_key] = person
|
||||||
person.setId(new_key)
|
person.setId(new_key)
|
||||||
# person currently using it was just added, change it
|
# person currently using it was just added, change it
|
||||||
elif tp in self.added:
|
elif self.added.has_key(tp):
|
||||||
del pmap[person.getId()]
|
del pmap[person.getId()]
|
||||||
pmap[new_key] = person
|
pmap[new_key] = person
|
||||||
person.setId(new_key)
|
person.setId(new_key)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user