Improved checking

svn: r1069
This commit is contained in:
Don Allingham 2002-07-03 21:50:21 +00:00
parent 1cc8f935a8
commit 8093a3bbaa
5 changed files with 18 additions and 7 deletions

View File

@ -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)

View File

@ -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()

View File

@ -1859,6 +1859,9 @@ class GrampsDB(Persistent):
self.placeMap = {}
self.new()
def get_type(self):
return 'GrampsDB'
def close(self):
pass

View File

@ -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 "

View File

@ -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()