mirror of
https://github.com/internetarchive/warcprox.git
synced 2025-01-18 13:22:09 +01:00
utility for inspecting deduplication database (or any dbm database)
This commit is contained in:
parent
03fe7179f8
commit
534c61a4c1
22
dump-anydbm.py
Executable file
22
dump-anydbm.py
Executable file
@ -0,0 +1,22 @@
|
||||
#!/usr/bin/python
|
||||
# vim:set sw=4 et:
|
||||
#
|
||||
|
||||
"""
|
||||
Dump contents of database to stdout. Database can be any file that the anydbm
|
||||
module can read. Included with warcprox because it's useful for inspecting a
|
||||
deduplication database, but it is a generic tool.
|
||||
"""
|
||||
|
||||
import anydbm
|
||||
import sys
|
||||
|
||||
if __name__ == "__main__":
|
||||
if len(sys.argv) != 2:
|
||||
sys.stderr.write("usage: {} DBM_FILE\n".format(sys.argv[0]))
|
||||
exit(1)
|
||||
|
||||
db = anydbm.open(sys.argv[1])
|
||||
for key in db:
|
||||
print("{}:{}".format(key, db[key]))
|
||||
|
Loading…
x
Reference in New Issue
Block a user