fix for cursor set

svn: r5570
This commit is contained in:
Richard Taylor 2005-12-17 20:13:23 +00:00
parent 9c1db9ff45
commit 9385212033
3 changed files with 17 additions and 5 deletions

View File

@ -1,3 +1,8 @@
2005-12-17 Richard Taylor <rjt-gramps@thegrindstone.me.uk>
* src/GrampsBSDDB.py: added work around for cursor set not
returing None.
* test/GrampsDbBase_Test.py: corrected indent as found by Benny
2005-12-16 Richard Taylor <rjt-gramps@thegrindstone.me.uk>
* test/GrampsDbBase_Test.py: added a crude performance test.
* test/RunAllTests.py: fixed log level setting.

View File

@ -449,7 +449,11 @@ class GrampsBSDDB(GrampsDbBase):
# that include a reference to the object we are looking for.
referenced_cur = self.get_reference_map_referenced_cursor()
ret = referenced_cur.set(handle)
try:
ret = referenced_cur.set(handle)
except:
ret = None
while (ret is not None):
(key,data) = ret
@ -472,8 +476,11 @@ class GrampsBSDDB(GrampsDbBase):
"""Remove all references to the primary object from the reference_map"""
primary_cur = self.get_reference_map_primary_cursor()
ret = primary_cur.set(handle)
try:
ret = primary_cur.set(handle)
except:
ret = None
while (ret is not None):
(key,data) = ret

View File

@ -60,7 +60,7 @@ class ReferenceMapTest (unittest.TestCase):
lnk_sources.add(sources[source_idx-1])
source_idx = (source_idx+1) % len(sources)
add_func(lnk_sources)
add_func(lnk_sources)
return
@ -202,7 +202,7 @@ class ReferenceMapTest (unittest.TestCase):
def test_performance(self):
self._populate_database(num_sources = 100,
num_persons = 10,
num_persons = 80,
num_families = 10,
num_events = 10,
num_places = 10,