provide lower level access for cursors, but retain XML/GEDCOM compatiblity
svn: r6181
This commit is contained in:
parent
d16df0e35a
commit
6496b1a815
@ -84,16 +84,24 @@ def find_primary_handle(key,data):
|
||||
def find_referenced_handle(key,data):
|
||||
return str((data)[1][1])
|
||||
|
||||
import cPickle as pickle
|
||||
|
||||
class GrampsBSDDBCursor(GrampsCursor):
|
||||
|
||||
def __init__(self,source,txn=None):
|
||||
self.cursor = source.cursor(txn)
|
||||
self.cursor = source.db.cursor(txn)
|
||||
|
||||
def first(self):
|
||||
return self.cursor.first()
|
||||
d = self.cursor.first()
|
||||
if d:
|
||||
return (d[0],pickle.loads(d[1]))
|
||||
return None
|
||||
|
||||
def next(self):
|
||||
return self.cursor.next()
|
||||
d = self.cursor.next()
|
||||
if d:
|
||||
return (d[0],pickle.loads(d[1]))
|
||||
return None
|
||||
|
||||
def close(self):
|
||||
self.cursor.close()
|
||||
|
@ -149,12 +149,11 @@ class PeopleModel(gtk.GenericTreeModel):
|
||||
|
||||
self.sortnames = {}
|
||||
|
||||
cursor = self.db.person_map.db.cursor()
|
||||
cursor = self.db.get_person_cursor()
|
||||
node = cursor.first()
|
||||
|
||||
while node:
|
||||
handle,d = node
|
||||
d = pickle.loads(d)
|
||||
if not (handle in skip or (dfilter and not dfilter.match(handle))):
|
||||
name_data = d[_NAME_COL]
|
||||
self.sortnames[handle] = nsn(name_data)
|
||||
|
Loading…
Reference in New Issue
Block a user