svn: r3194
This commit is contained in:
Alex Roitman 2004-05-26 03:29:00 +00:00
parent 7cc5d39fc9
commit e7878c26f3

View File

@ -2687,6 +2687,8 @@ class GrampsDB:
return Transaction(msg,self.undodb) return Transaction(msg,self.undodb)
def add_transaction(self,transaction,msg): def add_transaction(self,transaction,msg):
if not len(transaction):
return
transaction.set_description(msg) transaction.set_description(msg)
self.undoindex += 1 self.undoindex += 1
if self.undoindex == UNDO_SIZE: if self.undoindex == UNDO_SIZE:
@ -3600,7 +3602,6 @@ class GrampsDB:
class Transaction: class Transaction:
def __init__(self,msg,db): def __init__(self,msg,db):
self.data = []
self.db = db self.db = db
self.first = None self.first = None
self.last = None self.last = None
@ -3623,7 +3624,9 @@ class Transaction:
return cPickle.loads(self.db[id]) return cPickle.loads(self.db[id])
def __len__(self): def __len__(self):
return len(self.data) if self.last and self.first:
return self.last - self.first + 1
return 0
def display(self): def display(self):
for record in self.get_recnos(): for record in self.get_recnos():