I have a preference for gdbm when building DBM based dictionaries but
have found I cannot count on it being there all the time. Therefore, I
have created this little tidbit which you call before opening your
anydbm database to bias the preference towards gdbm instead of dbhash:
# bias DBM towards gdbm if at all possible.
"""bias anydbm to gdbm"""
_mod = __import__("gdbm")
# and other words, if you can import gdbm, make it the default
anydbm._defaultmod = _mod
open_DBM = anydbm.open(DBM_path, 'c')
if you have gdbm enabled, it will use that otherwise it will default to
the search list in anydbm. obviously, this can be used to bias anydbm
to meet your own preferences
|All times are GMT. The time now is 09:14 PM.|
Powered by vBulletin®. Copyright ©2000 - 2013, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.