From 8093a3bbaa80bd159e912f549140a74f3742aa9a Mon Sep 17 00:00:00 2001 From: Don Allingham Date: Wed, 3 Jul 2002 21:50:21 +0000 Subject: [PATCH] Improved checking svn: r1069 --- gramps/src/GrampsXML.py | 3 +++ gramps/src/GrampsZODB.py | 3 +++ gramps/src/RelLib.py | 3 +++ gramps/src/const.py | 2 +- gramps/src/plugins/Check.py | 14 ++++++++------ 5 files changed, 18 insertions(+), 7 deletions(-) diff --git a/gramps/src/GrampsXML.py b/gramps/src/GrampsXML.py index b6ee9fe2e..60ff140c6 100644 --- a/gramps/src/GrampsXML.py +++ b/gramps/src/GrampsXML.py @@ -28,6 +28,9 @@ class GrampsXML(GrampsDB): def get_base(self): return const.xmlFile + def get_type(self): + return 'GrampsXML' + def new(self): GrampsDB.new(self) diff --git a/gramps/src/GrampsZODB.py b/gramps/src/GrampsZODB.py index 3b1d71551..82a51ee4c 100644 --- a/gramps/src/GrampsZODB.py +++ b/gramps/src/GrampsZODB.py @@ -128,6 +128,9 @@ class GrampsZODB(GrampsDB): self.conn = None GrampsDB.__init__(self) + def get_type(self): + return 'GrampsZODB' + def close(self): self.db.close() diff --git a/gramps/src/RelLib.py b/gramps/src/RelLib.py index f976191cd..f68a87adb 100644 --- a/gramps/src/RelLib.py +++ b/gramps/src/RelLib.py @@ -1859,6 +1859,9 @@ class GrampsDB(Persistent): self.placeMap = {} self.new() + def get_type(self): + return 'GrampsDB' + def close(self): pass diff --git a/gramps/src/const.py b/gramps/src/const.py index 50f7f17ac..e0a6d1714 100644 --- a/gramps/src/const.py +++ b/gramps/src/const.py @@ -92,7 +92,7 @@ startup = 1 # #------------------------------------------------------------------------- progName = "GRAMPS" -version = "@VERSIONSTRING@" +version = "0.8.0-pre" copyright = "© 2001-2002 Donald N. Allingham" authors = ["Donald N. Allingham", "David Hampton","Donald A. Peterson"] comments = _("GRAMPS (Genealogical Research and Analysis " diff --git a/gramps/src/plugins/Check.py b/gramps/src/plugins/Check.py index 1a98c8e01..a59652352 100644 --- a/gramps/src/plugins/Check.py +++ b/gramps/src/plugins/Check.py @@ -65,8 +65,8 @@ class CheckIntegrity: def check_for_broken_family_links(self): self.broken_links = [] - family_list = self.db.getFamilyMap().values()[:] - for family in family_list: + for key in self.db.getFamilyMap().keys(): + family = self.db.getFamily(key) father = family.getFather() mother = family.getMother() @@ -95,20 +95,22 @@ class CheckIntegrity: self.bad_photo.append(photo) def cleanup_empty_families(self,automatic): - family_list = self.db.getFamilyMap().values()[:] - for family in family_list: + for key in self.db.getFamilyMap().keys(): + family = self.db.getFamily(key) if family.getFather() == None and family.getMother() == None: Utils.modified() self.empty_family.append(family) self.delete_empty_family(family) def delete_empty_family(self,family): - for child in self.db.getPersonMap().values(): + for key in self.db.getPersonKeys(): + child = self.db.getPerson(key) child.removeAltFamily(family) self.db.deleteFamily(family) def check_parent_relationships(self): - for family in self.db.getFamilyMap().values(): + for key in self.db.getFamilyMap().keys(): + family = self.db.getFamily(key) father = family.getFather() mother = family.getMother() type = family.getRelationship()