1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
|
Use bsddb3 instead of deprecated python[berkdb]. Patch by Arfrever.
--- a/planet/idindex.py
+++ b/planet/idindex.py
@@ -13,8 +13,8 @@
cache = config.cache_directory()
index=os.path.join(cache,'index')
if not os.path.exists(index): return None
- import dbhash
- return dbhash.open(filename(index, 'id'),'w')
+ import bsddb3
+ return bsddb3.hashopen(filename(index, 'id'),'w')
except Exception, e:
if e.__class__.__name__ == 'DBError': e = e.args[-1]
from planet import logger as log
@@ -35,8 +35,8 @@
cache = config.cache_directory()
index=os.path.join(cache,'index')
if not os.path.exists(index): os.makedirs(index)
- import dbhash
- index = dbhash.open(filename(index, 'id'),'c')
+ import bsddb3
+ index = bsddb3.hashopen(filename(index, 'id'),'c')
try:
import libxml2
--- a/tests/test_idindex.py
+++ b/tests/test_idindex.py
@@ -67,8 +67,8 @@
self.assertEqual(12,len(doc.getElementsByTagName('planet:name')))
try:
- module = 'dbhash'
+ import bsddb3
except ImportError:
- planet.logger.warn("dbhash is not available => can't test id index")
+ planet.logger.warn("bsddb3 is not available => can't test id index")
for method in dir(idIndexTest):
if method.startswith('test_'): delattr(idIndexTest,method)
|