diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 16:49:38 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 16:49:38 +0000 |
commit | bd8128271ad96c97ddaf5c86915a981ddbff86c6 (patch) | |
tree | 19fb138628afa53c660a2db82488d0b703a52fa7 /python/tdbdump.py | |
parent | Initial commit. (diff) | |
download | tdb-upstream.tar.xz tdb-upstream.zip |
Adding upstream version 1.4.10.upstream/1.4.10upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r-- | python/tdbdump.py | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/python/tdbdump.py b/python/tdbdump.py new file mode 100644 index 0000000..988e293 --- /dev/null +++ b/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)) |