1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-06 13:18:07 +03:00
samba-mirror/lib/tdb/python/tdbdump.py
Joe Guo a07279b78a PY3: change shebang to python3 in lib dir
Signed-off-by: Joe Guo <joeg@catalyst.net.nz>
Reviewed-by: Noel Power <npower@samba.org>
2018-12-14 14:40:20 +01:00

14 lines
332 B
Python

#!/usr/bin/env python3
# Trivial reimplementation of tdbdump in Python
from __future__ import print_function
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.items():
print("{\nkey(%d) = %r\ndata(%d) = %r\n}" % (len(k), k, len(v), v))