Improved checking
svn: r1069
This commit is contained in:
parent
1cc8f935a8
commit
8093a3bbaa
@ -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)
|
||||
|
||||
|
@ -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()
|
||||
|
||||
|
@ -1859,6 +1859,9 @@ class GrampsDB(Persistent):
|
||||
self.placeMap = {}
|
||||
self.new()
|
||||
|
||||
def get_type(self):
|
||||
return 'GrampsDB'
|
||||
|
||||
def close(self):
|
||||
pass
|
||||
|
||||
|
@ -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 "
|
||||
|
@ -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()
|
||||
|
Loading…
Reference in New Issue
Block a user