Improved checking
svn: r1069
This commit is contained in:
parent
1cc8f935a8
commit
8093a3bbaa
@ -28,6 +28,9 @@ class GrampsXML(GrampsDB):
|
|||||||
def get_base(self):
|
def get_base(self):
|
||||||
return const.xmlFile
|
return const.xmlFile
|
||||||
|
|
||||||
|
def get_type(self):
|
||||||
|
return 'GrampsXML'
|
||||||
|
|
||||||
def new(self):
|
def new(self):
|
||||||
GrampsDB.new(self)
|
GrampsDB.new(self)
|
||||||
|
|
||||||
|
@ -128,6 +128,9 @@ class GrampsZODB(GrampsDB):
|
|||||||
self.conn = None
|
self.conn = None
|
||||||
GrampsDB.__init__(self)
|
GrampsDB.__init__(self)
|
||||||
|
|
||||||
|
def get_type(self):
|
||||||
|
return 'GrampsZODB'
|
||||||
|
|
||||||
def close(self):
|
def close(self):
|
||||||
self.db.close()
|
self.db.close()
|
||||||
|
|
||||||
|
@ -1859,6 +1859,9 @@ class GrampsDB(Persistent):
|
|||||||
self.placeMap = {}
|
self.placeMap = {}
|
||||||
self.new()
|
self.new()
|
||||||
|
|
||||||
|
def get_type(self):
|
||||||
|
return 'GrampsDB'
|
||||||
|
|
||||||
def close(self):
|
def close(self):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
@ -92,7 +92,7 @@ startup = 1
|
|||||||
#
|
#
|
||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
progName = "GRAMPS"
|
progName = "GRAMPS"
|
||||||
version = "@VERSIONSTRING@"
|
version = "0.8.0-pre"
|
||||||
copyright = "© 2001-2002 Donald N. Allingham"
|
copyright = "© 2001-2002 Donald N. Allingham"
|
||||||
authors = ["Donald N. Allingham", "David Hampton","Donald A. Peterson"]
|
authors = ["Donald N. Allingham", "David Hampton","Donald A. Peterson"]
|
||||||
comments = _("GRAMPS (Genealogical Research and Analysis "
|
comments = _("GRAMPS (Genealogical Research and Analysis "
|
||||||
|
@ -65,8 +65,8 @@ class CheckIntegrity:
|
|||||||
|
|
||||||
def check_for_broken_family_links(self):
|
def check_for_broken_family_links(self):
|
||||||
self.broken_links = []
|
self.broken_links = []
|
||||||
family_list = self.db.getFamilyMap().values()[:]
|
for key in self.db.getFamilyMap().keys():
|
||||||
for family in family_list:
|
family = self.db.getFamily(key)
|
||||||
father = family.getFather()
|
father = family.getFather()
|
||||||
mother = family.getMother()
|
mother = family.getMother()
|
||||||
|
|
||||||
@ -95,20 +95,22 @@ class CheckIntegrity:
|
|||||||
self.bad_photo.append(photo)
|
self.bad_photo.append(photo)
|
||||||
|
|
||||||
def cleanup_empty_families(self,automatic):
|
def cleanup_empty_families(self,automatic):
|
||||||
family_list = self.db.getFamilyMap().values()[:]
|
for key in self.db.getFamilyMap().keys():
|
||||||
for family in family_list:
|
family = self.db.getFamily(key)
|
||||||
if family.getFather() == None and family.getMother() == None:
|
if family.getFather() == None and family.getMother() == None:
|
||||||
Utils.modified()
|
Utils.modified()
|
||||||
self.empty_family.append(family)
|
self.empty_family.append(family)
|
||||||
self.delete_empty_family(family)
|
self.delete_empty_family(family)
|
||||||
|
|
||||||
def delete_empty_family(self,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)
|
child.removeAltFamily(family)
|
||||||
self.db.deleteFamily(family)
|
self.db.deleteFamily(family)
|
||||||
|
|
||||||
def check_parent_relationships(self):
|
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()
|
father = family.getFather()
|
||||||
mother = family.getMother()
|
mother = family.getMother()
|
||||||
type = family.getRelationship()
|
type = family.getRelationship()
|
||||||
|
Loading…
Reference in New Issue
Block a user