git.samba.org
/
metze
/
ctdb
/
wip.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
236dc2f
)
tdb: Add simple reimplementation of tdbdump in Python as an example of the tdb Python...
author
Jelmer Vernooij
<jelmer@samba.org>
Thu, 10 Jan 2008 20:44:38 +0000
(21:44 +0100)
committer
Stefan Metzmacher
<metze@samba.org>
Wed, 16 Dec 2009 07:03:50 +0000
(08:03 +0100)
Signed-off-by: Stefan Metzmacher <metze@samba.org>
lib/tdb/python/tdbdump.py
[new file with mode: 0644]
patch
|
blob
diff --git a/lib/tdb/python/tdbdump.py
b/lib/tdb/python/tdbdump.py
new file mode 100644
(file)
index 0000000..
d759d77
--- /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)