[postr] Updated to bsddb3 insteado of former dbhash/bsddb



commit 90e85b6567d9820ff7e235f0f4063b67d6d34fb6
Author: Germán Póo-Caamaño <gpoo gnome org>
Date:   Wed Dec 1 20:47:36 2010 -0800

    Updated to bsddb3 insteado of former dbhash/bsddb
    
    dbhash/bsddb was declared deprecated on Python 2.6.  Its
    replacement is pybsddb (aka bsddb3).
    
    Signed-off-by: Germán Póo-Caamaño <gpoo gnome org>

 src/util.py |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)
---
diff --git a/src/util.py b/src/util.py
index cc8afb2..5ad3410 100644
--- a/src/util.py
+++ b/src/util.py
@@ -71,7 +71,7 @@ def get_buddyicon(flickr, data, size=48):
     """Lookup the buddyicon from the data in @data using @flickr and resize it
     to @size pixels."""
     from twisted.web.client import getPage
-    import dbhash, bsddb
+    import bsddb3
 
     global __buddy_cache
     if __buddy_cache is None:
@@ -80,12 +80,12 @@ def get_buddyicon(flickr, data, size=48):
             os.makedirs(folder)
         path = os.path.join (folder, "buddyicons")
         try:
-            __buddy_cache = dbhash.open(path, "c")
-        except bsddb.db.DBInvalidArgError:
+            __buddy_cache = bsddb3.hashopen(path, "c")
+        except bsddb3.db.DBInvalidArgError:
             # The database needs upgrading, so delete it
             os.remove(path)
-            __buddy_cache = dbhash.open(path, "c")
-    
+            __buddy_cache = bsddb3.hashopen(path, "c")
+
     def load_thumb(page, size):
         loader = gtk.gdk.PixbufLoader()
         loader.set_size (size, size)



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]