summaryrefslogtreecommitdiff
path: root/lib/tdb/python/tdbdump.py
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2008-09-18 20:29:05 +0200
committerJelmer Vernooij <jelmer@samba.org>2008-09-18 20:29:05 +0200
commit729ffbae086309992d7433a296fca64f6800f8fa (patch)
tree6c133d2b91ab9313da11bf8bad15f497e1b5c61f /lib/tdb/python/tdbdump.py
parent88ad1a936ccd2451d6dbf542a0a746ad71a3e968 (diff)
parentfc7050e54c69919d754ca0adf3f2f741a501fec4 (diff)
downloadsamba-729ffbae086309992d7433a296fca64f6800f8fa.tar.gz
samba-729ffbae086309992d7433a296fca64f6800f8fa.tar.bz2
samba-729ffbae086309992d7433a296fca64f6800f8fa.zip
Merge branch 'master' of ssh://git.samba.org/data/git/samba into noejs
Conflicts: source4/main.mk
Diffstat (limited to 'lib/tdb/python/tdbdump.py')
-rw-r--r--lib/tdb/python/tdbdump.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/lib/tdb/python/tdbdump.py b/lib/tdb/python/tdbdump.py
new file mode 100644
index 0000000000..d759d771c8
--- /dev/null
+++ b/lib/tdb/python/tdbdump.py
@@ -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)