1 """Extended disk hashes package.
3 It extends anydbm/whichdb with ZODB and MetaKit-based hashes."""
6 __all__ = ["zshelve", "ZODBhash", "MKhash"]
10 anydbm._names.insert(len(anydbm._names)-1, ['ZODBhash', 'MKhash'])
11 # Insert before dumbdbm
15 _orig_module = whichdb
16 _orig_whichdb = _orig_module.whichdb
18 def whichdb(filename):
19 result = _orig_whichdb(filename)
24 f = open(filename, "rb")
28 # Read the start of the file -- the magic number
32 # Return "" if not at least 4 bytes
47 _orig_module.whichdb = whichdb # Now install our extended replacement
48 whichdb.__doc__ = _orig_whichdb.__doc__