* src/GrampsBSDDB.py: provide an upgrade task to rebuild gender stats
svn: r4891
This commit is contained in:
parent
f1b13b49c5
commit
f740ba4cf0
@ -1,4 +1,5 @@
|
|||||||
2005-06-29 Don Allingham <don@gramps-project.org>
|
2005-06-29 Don Allingham <don@gramps-project.org>
|
||||||
|
* src/GrampsBSDDB.py: provide an upgrade task to rebuild gender stats
|
||||||
* src/GrampsDbBase.py: move gender stats handling to the commit_person
|
* src/GrampsDbBase.py: move gender stats handling to the commit_person
|
||||||
task, instead of trying to handle it in the Person() class
|
task, instead of trying to handle it in the Person() class
|
||||||
* src/RelLib.py: removal of genderstats handling
|
* src/RelLib.py: removal of genderstats handling
|
||||||
|
@ -43,7 +43,7 @@ from bsddb import dbshelve, db
|
|||||||
from RelLib import *
|
from RelLib import *
|
||||||
from GrampsDbBase import *
|
from GrampsDbBase import *
|
||||||
|
|
||||||
_DBVERSION = 6
|
_DBVERSION = 7
|
||||||
|
|
||||||
def find_surname(key,data):
|
def find_surname(key,data):
|
||||||
return str(data[3].get_surname())
|
return str(data[3].get_surname())
|
||||||
@ -421,6 +421,8 @@ class GrampsBSDDB(GrampsDbBase):
|
|||||||
self.upgrade_5()
|
self.upgrade_5()
|
||||||
if version < 6:
|
if version < 6:
|
||||||
self.upgrade_6()
|
self.upgrade_6()
|
||||||
|
if version < 7:
|
||||||
|
self.upgrade_7()
|
||||||
self.metadata['version'] = _DBVERSION
|
self.metadata['version'] = _DBVERSION
|
||||||
print 'Successfully finished all upgrades'
|
print 'Successfully finished all upgrades'
|
||||||
|
|
||||||
@ -737,3 +739,16 @@ class GrampsBSDDB(GrampsDbBase):
|
|||||||
if val[1] != 6:
|
if val[1] != 6:
|
||||||
order.append(val)
|
order.append(val)
|
||||||
self.set_media_column_order(order)
|
self.set_media_column_order(order)
|
||||||
|
|
||||||
|
def upgrade_7(self):
|
||||||
|
print "Upgrading to DB version 7"
|
||||||
|
|
||||||
|
self.genderStats = GenderStats()
|
||||||
|
cursor = self.get_person_cursor()
|
||||||
|
data = cursor.first()
|
||||||
|
while data:
|
||||||
|
handle,val = data
|
||||||
|
p = Person(val)
|
||||||
|
self.genderStats.count_person(p,self)
|
||||||
|
data = cursor.next()
|
||||||
|
cursor.close()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user