1 """Extended disk hashes package. It extends anydbm/whichdb with ZODB and
3 Author: Oleg Broytman <phd@phd.pp.ru>
4 Copyright (C) 2001-2003 PhiloSoft Design
8 __all__ = ["zshelve", "ZODBhash", "MKhash"]
12 anydbm._names.insert(len(anydbm._names)-1, ['ZODBhash', 'MKhash'])
13 # Insert before dumbdbm
17 _orig_module = whichdb
18 _orig_whichdb = _orig_module.whichdb
20 def whichdb(filename):
21 result = _orig_whichdb(filename)
26 f = open(filename, "rb")
30 # Read the start of the file -- the magic number
34 # Return "" if not at least 4 bytes
49 _orig_module.whichdb = whichdb # Now install our extended replacement
50 whichdb.__doc__ = _orig_whichdb.__doc__