Renamed GrampsCursor to BsddbBaseCursor

svn: r15689
This commit is contained in:
Doug Blank 2010-08-08 22:06:54 +00:00
parent c0944d5df0
commit 791ab064f8
4 changed files with 16 additions and 16 deletions

View File

@ -28,11 +28,11 @@ from bsddb import db
#-------------------------------------------------------------------------
#
# GrampsCursor class
# BsddbBaseCursor class
#
#-------------------------------------------------------------------------
class GrampsCursor(object):
class BsddbBaseCursor(object):
"""
Provide a basic iterator that allows the user to cycle through
the elements in a particular map.

View File

@ -49,7 +49,7 @@ from gen.lib import (MediaObject, Person, Family, Source, Event, Place,
Repository, Note, GenderStats, Researcher)
from gen.db.dbconst import *
from gen.utils.callback import Callback
from gen.db import (GrampsCursor, DbReadBase)
from gen.db import (BsddbBaseCursor, DbReadBase)
from Utils import create_id
import Errors
@ -97,10 +97,10 @@ class DbBookmarks(object):
# GrampsDBReadCursor
#
#-------------------------------------------------------------------------
class DbReadCursor(GrampsCursor):
class DbReadCursor(BsddbBaseCursor):
def __init__(self, source, txn=None, **kwargs):
GrampsCursor.__init__(self, txn=txn, **kwargs)
BsddbBaseCursor.__init__(self, txn=txn, **kwargs)
self.cursor = source.db.cursor(txn)
self.source = source

View File

@ -51,7 +51,7 @@ from sys import maxint
from gen.lib import (GenderStats, Person, Family, Event, Place, Source,
MediaObject, Repository, Note)
from gen.db import (DbBsddbRead, DbWriteBase, BSDDBTxn,
DbTxn, GrampsCursor,DbVersionError,
DbTxn, BsddbBaseCursor, DbVersionError,
DbUpgradeRequiredError,
DbUndoBSDDB as DbUndo)
from gen.db.dbconst import *
@ -140,25 +140,25 @@ def find_referenced_handle(key, data):
#-------------------------------------------------------------------------
#
# GrampsWriteCursor
# BsddbWriteCursor
#
#-------------------------------------------------------------------------
class GrampsWriteCursor(GrampsCursor):
class BsddbWriteCursor(BsddbBaseCursor):
def __init__(self, source, txn=None, **kwargs):
GrampsCursor.__init__(self, txn=txn, **kwargs)
BsddbBaseCursor.__init__(self, txn=txn, **kwargs)
self.cursor = source.db.cursor(txn)
self.source = source
#-------------------------------------------------------------------------
#
# DbBsddbAssocCursor
#
#-------------------------------------------------------------------------
class DbBsddbAssocCursor(GrampsCursor):
class DbBsddbAssocCursor(BsddbBaseCursor):
def __init__(self, source, txn=None, **kwargs):
GrampsCursor.__init__(self, txn=txn, **kwargs)
BsddbBaseCursor.__init__(self, txn=txn, **kwargs)
self.cursor = source.cursor(txn)
self.source = source
@ -267,7 +267,7 @@ class DbBsddb(DbBsddbRead, DbWriteBase, UpdateCallback):
""" Helper function to return a cursor over a table """
if update and not txn:
txn = self.env.txn_begin(self.txn)
return GrampsWriteCursor(table, txn=txn or self.txn,
return BsddbWriteCursor(table, txn=txn or self.txn,
update=update, commit=commit)
# cursors for lookups in the reference_map for back reference

View File

@ -51,7 +51,7 @@ from gen.lib import (GenderStats, Source, Person, Family, Event, Place,
from gen.db.write import (KEY_TO_CLASS_MAP, CLASS_TO_KEY_MAP)
from libgrdb import DbGrdb
from gen.db.txn import DbTxn as Transaction
from gen.db.cursor import GrampsCursor
from gen.db.cursor import BsddbBaseCursor
from gen.db.dbconst import *
from gen.db.exceptions import DbVersionError
import const
@ -105,7 +105,7 @@ def find_referenced_handle(key, data):
"""
return str((data)[1][1])
class GrampsBSDDBCursor(GrampsCursor):
class GrampsBSDDBCursor(BsddbBaseCursor):
"""
Cursor to loop through a BSDDB table
"""
@ -113,7 +113,7 @@ class GrampsBSDDBCursor(GrampsCursor):
self.cursor = source.db.cursor(txn)
self.source = source
class GrampsBSDDBAssocCursor(GrampsCursor):
class GrampsBSDDBAssocCursor(BsddbBaseCursor):
def __init__(self, source, txn=None):
self.cursor = source.cursor(txn)