diff --git a/src/RelLib.py b/src/RelLib.py index de1fe821f..cc4aa856c 100644 --- a/src/RelLib.py +++ b/src/RelLib.py @@ -2069,17 +2069,17 @@ class GrampsDB: """creates a new GrampsDB""" self.surnames = [] self.personTable = {} + self.personMap = {} self.placeTable = {} + self.placeMap = {} self.sourceTable = {} + self.sourceMap = {} + self.familyMap = {} self.iprefix = "I%d" self.sprefix = "S%d" self.oprefix = "O%d" self.pprefix = "P%d" self.fprefix = "F%d" - self.familyMap = {} - self.personMap = {} - self.sourceMap = {} - self.placeMap = {} self.new() self.added_files = [] self.genderStats = GenderStats () @@ -2193,12 +2193,12 @@ class GrampsDB: self.surnames = [] self.personMap = {} - self.sourceMap = {} - self.placeMap = {} - self.objectMap = {} self.personTable = {} - self.placeTable = {} + self.sourceMap = {} self.sourceTable = {} + self.placeMap = {} + self.placeTable = {} + self.objectMap = {} self.smapIndex = 0 self.pmapIndex = 0 self.fmapIndex = 0 diff --git a/src/WriteXML.py b/src/WriteXML.py index 8a5794246..b85f6b5c1 100644 --- a/src/WriteXML.py +++ b/src/WriteXML.py @@ -162,8 +162,8 @@ class XmlWriter: owner = self.db.getResearcher() familyMap = self.db.getFamilyMap() familyList = familyMap.keys () - person_len = len(self.db.getPersonKeys()) - family_len = len(familyList) + person_len = self.db.getPersonLength() + family_len = len(familyMap) source_len = len(self.db.getSourceKeys()) place_len = len(self.db.getPlaceKeys()) objMap = self.db.getObjectMap() @@ -203,10 +203,13 @@ class XmlWriter: self.g.write(' default="%s"' % person.getId()) self.g.write(">\n") - keys = self.db.getPersonKeys() - keys.sort () - for key in keys: - person = self.db.getPerson(key) + for key in self.db.sortPersonKeys(): + try: + person = self.db.getPerson(key) + except: + print "Key error %s" % key + continue + if self.callback and count % delta == 0: self.callback(float(count)/float(total)) count = count + 1 diff --git a/src/plugins/WriteFtree.py b/src/plugins/WriteFtree.py index b4bd3deb0..331bc7c8d 100644 --- a/src/plugins/WriteFtree.py +++ b/src/plugins/WriteFtree.py @@ -48,7 +48,7 @@ import Utils import GenericFilter import Errors -from QuestionDialog import MissingMediaDialog +from QuestionDialog import MissingMediaDialog, ErrorDialog from gettext import gettext as _ @@ -135,6 +135,8 @@ class FtreeWriter: Utils.destroy_passed_object(self.topwin) try: self.export(name, pfilter, restrict) + except (IOError,OSError),msg: + ErrorDialog(_("Could not create %s") % name, msg) except: import DisplayTrace DisplayTrace.DisplayTrace()