diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 17:20:00 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 17:20:00 +0000 |
commit | 8daa83a594a2e98f39d764422bfbdbc62c9efd44 (patch) | |
tree | 4099e8021376c7d8c05bdf8503093d80e9c7bad0 /lib/tdb/python/tdbdump.py | |
parent | Initial commit. (diff) | |
download | samba-8daa83a594a2e98f39d764422bfbdbc62c9efd44.tar.xz samba-8daa83a594a2e98f39d764422bfbdbc62c9efd44.zip |
Adding upstream version 2:4.20.0+dfsg.upstream/2%4.20.0+dfsg
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'lib/tdb/python/tdbdump.py')
-rw-r--r-- | lib/tdb/python/tdbdump.py | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/lib/tdb/python/tdbdump.py b/lib/tdb/python/tdbdump.py new file mode 100644 index 0000000..988e293 --- /dev/null +++ b/lib/tdb/python/tdbdump.py @@ -0,0 +1,17 @@ +#!/usr/bin/env python3 +# Trivial reimplementation of tdbdump in Python + +import sys + +sys.path.insert(0, "bin/python") + +import tdb + +if len(sys.argv) < 2: + print("Usage: tdbdump.py <tdb-file>") + sys.exit(1) + +db = tdb.Tdb(sys.argv[1]) +for k in db.keys(): + v = db.get(k) + print("{\nkey(%d) = %r\ndata(%d) = %r\n}" % (len(k), k, len(v), v)) |