[Spambayes-checkins] spambayes/spambayes dbmstorage.py,1.14,1.15
Tony Meyer
anadelonbrin at users.sourceforge.net
Fri Apr 7 04:23:09 CEST 2006
Update of /cvsroot/spambayes/spambayes/spambayes
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19059/spambayes
Modified Files:
dbmstorage.py
Log Message:
Fix #1387709: if dbm_type is non default, then use it, not whichdb, to determine database type.
Index: dbmstorage.py
===================================================================
RCS file: /cvsroot/spambayes/spambayes/spambayes/dbmstorage.py,v
retrieving revision 1.14
retrieving revision 1.15
diff -C2 -d -r1.14 -r1.15
*** dbmstorage.py 24 Jan 2005 05:56:37 -0000 1.14
--- dbmstorage.py 7 Apr 2006 02:23:05 -0000 1.15
***************
*** 59,63 ****
def open(db_name, mode):
! if os.path.exists(db_name):
# let the file tell us what db to use
dbm_type = whichdb.whichdb(db_name)
--- 59,65 ----
def open(db_name, mode):
! if os.path.exists(db_name) and \
! options.default("globals", "dbm_type") != \
! options["globals", "dbm_type"]:
# let the file tell us what db to use
dbm_type = whichdb.whichdb(db_name)
***************
*** 68,72 ****
dbm_type = "db3hash"
else:
! # fresh file - open with what the user specified
dbm_type = options["globals", "dbm_type"].lower()
f = open_funcs.get(dbm_type)
--- 70,74 ----
dbm_type = "db3hash"
else:
! # fresh file or overridden - open with what the user specified
dbm_type = options["globals", "dbm_type"].lower()
f = open_funcs.get(dbm_type)
More information about the Spambayes-checkins
mailing list