mirror of
https://github.com/samba-team/samba.git
synced 2024-12-25 23:21:54 +03:00
tdb: Add simple reimplementation of tdbdump in Python as an example of the tdb Python bindings. (This used to be commit 47d797f788
) (cherry picked from samba commit 6bdd1425b7
)
Signed-off-by: Stefan Metzmacher <metze@samba.org> (This used to be ctdb commit 363c34d4bb488609317794cd3153d85c12643110)
This commit is contained in:
parent
e58068d666
commit
4c69b5e0fd
12
ctdb/lib/tdb/python/tdbdump.py
Normal file
12
ctdb/lib/tdb/python/tdbdump.py
Normal 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)
|
Loading…
Reference in New Issue
Block a user