1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-26 10:04:02 +03:00

tdb: Add simple reimplementation of tdbdump in Python as an example of the tdb Python bindings.

This commit is contained in:
Jelmer Vernooij 2008-01-10 21:44:38 +01:00
parent 4720f53a92
commit 47d797f788

View File

@ -0,0 +1,12 @@
#!/usr/bin/python
# Trivial reimplementation of tdbdump in Python
import tdb, sys
if len(sys.argv) < 2:
print "Usage: tdbdump.py <tdb-file>"
sys.exit(1)
db = tdb.Tdb(sys.argv[1])
for (k, v) in db.iteritems():
print "{\nkey(%d) = %r\ndata(%d) = %r\n}" % (len(k), k, len(v), v)