1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-23 17:34:34 +03:00
samba-mirror/lib/tdb/python/tdbdump.py
Douglas Bagnall aecb2b779b python: remove all 'from __future__ import print_function'
This made Python 2's print behave like Python 3's print().

In some cases, where we had:

   from __future__ import print_function
   """Intended module documentation..."""

this will have the side effect of making the intended module documentation
work as the actual module documentation (i.e. becoming __doc__), because
it is once again the first statement in the module.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2021-04-28 03:43:34 +00:00

13 lines
294 B
Python

#!/usr/bin/env python3
# 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.items():
print("{\nkey(%d) = %r\ndata(%d) = %r\n}" % (len(k), k, len(v), v))