* src/GrampsDb/_GrampsDbBase.py (find_next_*_gramps_id): check
whether the key exists, do not read. * src/GrampsDb/_GrampsBSDDB.py (find_next_*_gramps_id): Remove methods, as there's no need to override ones the DbBase now. svn: r5860
This commit is contained in:
parent
024b2a140e
commit
04de8dc8d4
@ -1,3 +1,9 @@
|
||||
2006-01-31 Alex Roitman <shura@gramps-project.org>
|
||||
* src/GrampsDb/_GrampsDbBase.py (find_next_*_gramps_id): check
|
||||
whether the key exists, do not read.
|
||||
* src/GrampsDb/_GrampsBSDDB.py (find_next_*_gramps_id): Remove
|
||||
methods, as there's no need to override ones the DbBase now.
|
||||
|
||||
2006-01-31 Don Allingham <don@gramps-project.org>
|
||||
* src/EditPerson.py: clean up building notebook pages
|
||||
* src/DisplayTabs.py: support for drag-n-drop
|
||||
|
@ -964,90 +964,6 @@ class GrampsBSDDB(GrampsDbBase):
|
||||
add_func(obj,transaction)
|
||||
return obj
|
||||
|
||||
def find_next_person_gramps_id(self):
|
||||
"""
|
||||
Returns the next available GRAMPS' ID for a Person object based
|
||||
off the person ID prefix.
|
||||
"""
|
||||
index = self.iprefix % self.pmap_index
|
||||
while self.id_trans.get(str(index),txn=self.txn):
|
||||
self.pmap_index += 1
|
||||
index = self.iprefix % self.pmap_index
|
||||
self.pmap_index += 1
|
||||
return index
|
||||
|
||||
def find_next_place_gramps_id(self):
|
||||
"""
|
||||
Returns the next available GRAMPS' ID for a Place object based
|
||||
off the person ID prefix.
|
||||
"""
|
||||
index = self.pprefix % self.lmap_index
|
||||
while self.pid_trans.get(str(index),txn=self.txn):
|
||||
self.lmap_index += 1
|
||||
index = self.pprefix % self.lmap_index
|
||||
self.lmap_index += 1
|
||||
return index
|
||||
|
||||
def find_next_event_gramps_id(self):
|
||||
"""
|
||||
Returns the next available GRAMPS' ID for a Event object based
|
||||
off the person ID prefix.
|
||||
"""
|
||||
index = self.eprefix % self.emap_index
|
||||
while self.eid_trans.get(str(index),txn=self.txn):
|
||||
self.emap_index += 1
|
||||
index = self.eprefix % self.emap_index
|
||||
self.emap_index += 1
|
||||
return index
|
||||
|
||||
def find_next_object_gramps_id(self):
|
||||
"""
|
||||
Returns the next available GRAMPS' ID for a MediaObject object based
|
||||
off the person ID prefix.
|
||||
"""
|
||||
index = self.oprefix % self.omap_index
|
||||
while self.oid_trans.get(str(index),txn=self.txn):
|
||||
self.omap_index += 1
|
||||
index = self.oprefix % self.omap_index
|
||||
self.omap_index += 1
|
||||
return index
|
||||
|
||||
def find_next_source_gramps_id(self):
|
||||
"""
|
||||
Returns the next available GRAMPS' ID for a Source object based
|
||||
off the person ID prefix.
|
||||
"""
|
||||
index = self.sprefix % self.smap_index
|
||||
while self.sid_trans.get(str(index),txn=self.txn):
|
||||
self.smap_index += 1
|
||||
index = self.sprefix % self.smap_index
|
||||
self.smap_index += 1
|
||||
return index
|
||||
|
||||
def find_next_family_gramps_id(self):
|
||||
"""
|
||||
Returns the next available GRAMPS' ID for a Family object based
|
||||
off the person ID prefix.
|
||||
"""
|
||||
index = self.fprefix % self.fmap_index
|
||||
while self.fid_trans.get(str(index),txn=self.txn):
|
||||
self.fmap_index += 1
|
||||
index = self.fprefix % self.fmap_index
|
||||
self.fmap_index += 1
|
||||
return index
|
||||
|
||||
def find_next_repository_gramps_id(self):
|
||||
"""
|
||||
Returns the next available GRAMPS' ID for a Respository object based
|
||||
off the repository ID prefix.
|
||||
"""
|
||||
index = self.rprefix % self.rmap_index
|
||||
while self.rid_trans.get(str(index),txn=self.txn):
|
||||
self.rmap_index += 1
|
||||
index = self.rprefix % self.rmap_index
|
||||
self.rmap_index += 1
|
||||
return index
|
||||
|
||||
def transaction_begin(self,msg="",batch=False):
|
||||
"""
|
||||
Creates a new Transaction tied to the current UNDO database. The
|
||||
|
@ -485,7 +485,7 @@ class GrampsDbBase(GrampsDBCallback):
|
||||
off the person ID prefix.
|
||||
"""
|
||||
index = self.iprefix % self.pmap_index
|
||||
while self.id_trans.get(str(index)):
|
||||
while self.id_trans.has_key(str(index)):
|
||||
self.pmap_index += 1
|
||||
index = self.iprefix % self.pmap_index
|
||||
self.pmap_index += 1
|
||||
@ -497,7 +497,7 @@ class GrampsDbBase(GrampsDBCallback):
|
||||
off the person ID prefix.
|
||||
"""
|
||||
index = self.pprefix % self.lmap_index
|
||||
while self.pid_trans.get(str(index)):
|
||||
while self.pid_trans.has_key(str(index)):
|
||||
self.lmap_index += 1
|
||||
index = self.pprefix % self.lmap_index
|
||||
self.lmap_index += 1
|
||||
@ -509,7 +509,7 @@ class GrampsDbBase(GrampsDBCallback):
|
||||
off the person ID prefix.
|
||||
"""
|
||||
index = self.eprefix % self.emap_index
|
||||
while self.eid_trans.get(str(index)):
|
||||
while self.eid_trans.has_key(str(index)):
|
||||
self.emap_index += 1
|
||||
index = self.eprefix % self.emap_index
|
||||
self.emap_index += 1
|
||||
@ -521,7 +521,7 @@ class GrampsDbBase(GrampsDBCallback):
|
||||
off the person ID prefix.
|
||||
"""
|
||||
index = self.oprefix % self.omap_index
|
||||
while self.oid_trans.get(str(index)):
|
||||
while self.oid_trans.has_key(str(index)):
|
||||
self.omap_index += 1
|
||||
index = self.oprefix % self.omap_index
|
||||
self.omap_index += 1
|
||||
@ -533,7 +533,7 @@ class GrampsDbBase(GrampsDBCallback):
|
||||
off the person ID prefix.
|
||||
"""
|
||||
index = self.sprefix % self.smap_index
|
||||
while self.sid_trans.get(str(index)):
|
||||
while self.sid_trans.has_key(str(index)):
|
||||
self.smap_index += 1
|
||||
index = self.sprefix % self.smap_index
|
||||
self.smap_index += 1
|
||||
@ -545,7 +545,7 @@ class GrampsDbBase(GrampsDBCallback):
|
||||
off the person ID prefix.
|
||||
"""
|
||||
index = self.fprefix % self.fmap_index
|
||||
while self.fid_trans.get(str(index)):
|
||||
while self.fid_trans.has_key(str(index)):
|
||||
self.fmap_index += 1
|
||||
index = self.fprefix % self.fmap_index
|
||||
self.fmap_index += 1
|
||||
@ -557,7 +557,7 @@ class GrampsDbBase(GrampsDBCallback):
|
||||
off the repository ID prefix.
|
||||
"""
|
||||
index = self.rprefix % self.rmap_index
|
||||
while self.rid_trans.get(str(index)):
|
||||
while self.rid_trans.has_key(str(index)):
|
||||
self.rmap_index += 1
|
||||
index = self.rprefix % self.rmap_index
|
||||
self.rmap_index += 1
|
||||
|
Loading…
Reference in New Issue
Block a user