From 96314bca72bba9d2fffc8b75ed9ab3b199eca354 Mon Sep 17 00:00:00 2001 From: Don Allingham Date: Sat, 25 May 2002 17:16:56 +0000 Subject: [PATCH] Import from XML builds placeTable properly svn: r1005 --- src/GrampsParser.py | 2 ++ src/GrampsZODB.py | 2 +- src/RelLib.py | 5 +++++ 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/GrampsParser.py b/src/GrampsParser.py index efde2aeb2..1ef3deaf9 100644 --- a/src/GrampsParser.py +++ b/src/GrampsParser.py @@ -499,6 +499,7 @@ class GrampsParser: if self.placeobj.get_title() == "": loc = self.placeobj.get_main_location() self.placeobj.set_title(build_place_title(loc)) + self.db.buildPlaceDisplay(self.placeobj.getId()) self.palceobj = None def stop_event(self,tag): @@ -579,6 +580,7 @@ class GrampsParser: self.source_ref = None def stop_source(self,tag): + self.db.buildSourceDisplay(self.source.getId()) self.source = None def stop_sauthor(self,tag): diff --git a/src/GrampsZODB.py b/src/GrampsZODB.py index ffa2f892f..96133a287 100644 --- a/src/GrampsZODB.py +++ b/src/GrampsZODB.py @@ -230,7 +230,7 @@ class GrampsZODB(GrampsDB): def setDefaultPerson(self,person): """sets the default Person to the passed instance""" GrampsDB.setDefaultPerson(self,person) - self.root()['default'] = person + self.root['default'] = person diff --git a/src/RelLib.py b/src/RelLib.py index 9dee3b645..a0c626bf1 100644 --- a/src/RelLib.py +++ b/src/RelLib.py @@ -1850,6 +1850,11 @@ class GrampsDB(Persistent): if nkey != okey and okey != None: del self.personTable[okey] self.personTable[nkey] = self.personMap[nkey].getDisplayInfo() + + def buildPlaceDisplay(self,nkey,okey=None): + if nkey != okey and okey != None: + del self.placeTable[okey] + self.placeTable[nkey] = self.placeMap[nkey].getDisplayInfo() def set_iprefix(self,val): if _id_reg.search(val):